/* ============================================
   PB Medienscanner — Redesign 27.02.2026
   Brand: Schwarz + Gelb (#e0d646)
   ============================================ */
:root {
    --black: #000;
    --yellow: #e0d646;
    --yellow-hover: #d4c23f;
    --yellow-light: #f5f0c4;
    --yellow-10: rgba(224,214,70,0.1);
    --yellow-20: rgba(224,214,70,0.2);
    --yellow-35: rgba(224,214,70,0.35);
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-700: #404040;
    --white: #fff;
    --cta: #ffffff;
    --cta-text: #000000;
    --cta-hover: #e5e5e5;
    --cta-glow: rgba(255,255,255,0.25);
    --cta-glow-hover: rgba(255,255,255,0.4);
    --danger: #d93025;
    --danger-light: #fce8e6;
    --success: #188038;
    --bg: var(--gray-50);
    --bg-card: var(--white);
    --bg-header: var(--black);
    --text: #1a1a1a;
    --text-secondary: var(--gray-500);
    --text-muted: var(--gray-400);
    --border: var(--gray-200);
    --border-light: var(--gray-100);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --max-width: 1400px;
    --header-height: 56px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-card: #161616;
    --bg-header: var(--black);
    --text: #e5e5e5;
    --text-secondary: var(--gray-400);
    --text-muted: var(--gray-500);
    --border: #2a2a2a;
    --border-light: #1e1e1e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5);
    --yellow-light: #2a2510;
    --yellow-10: rgba(224,214,70,0.08);
    --yellow-20: rgba(224,214,70,0.15);
    --danger-light: #3a1512;
    --cta: #ffffff;
    --cta-text: #000000;
    --cta-hover: #e0e0e0;
    --cta-glow: rgba(255,255,255,0.2);
    --cta-glow-hover: rgba(255,255,255,0.35);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--yellow-hover); text-decoration: none; }
a:hover { color: var(--yellow); text-decoration: underline; }

/* Skip Nav */
.skip-nav {
    position: absolute; left: -9999px; top: 0;
    background: var(--yellow); color: var(--black);
    padding: 0.5rem 1rem; z-index: 10000;
    border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-nav:focus { left: 0; }

/* ============================================
   HEADER
   ============================================ */
header {
    position: sticky; top: 0; z-index: 100;
    background: var(--bg-header);
    border-bottom: 2px solid var(--yellow);
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.25rem; height: var(--header-height);
}
.header-brand {
    display: flex; align-items: center; gap: 0.65rem;
    text-decoration: none; color: var(--white); flex-shrink: 0;
}
.header-brand:hover { text-decoration: none; color: var(--yellow); }
.brand-icon { height: 32px; width: auto; display: block; }
.brand-name {
    font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; color: var(--white);
}

/* Desktop Nav */
.header-nav {
    display: flex; align-items: center; gap: 0.15rem;
}
.nav-link {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    color: rgba(255,255,255,0.65); text-decoration: none;
    transition: all var(--transition);
    border: none; background: none; cursor: pointer;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--white); text-decoration: none; }
.nav-link.active { color: var(--yellow); }
.nav-link-cta {
    background: var(--yellow) !important; color: var(--black) !important; font-weight: 600;
}
.nav-link-cta:hover { background: var(--yellow-hover) !important; }
.nav-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.15); margin: 0 0.25rem; }

/* Theme Toggle */
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    border: none; background: none; cursor: pointer;
    color: rgba(255,255,255,0.5); font-size: 1.05rem;
    transition: all var(--transition);
}
.theme-toggle:hover { background: rgba(255,255,255,0.08); color: var(--yellow); }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 4px;
    padding: 8px; border: none; background: none; cursor: pointer;
}
.hamburger span {
    display: block; width: 20px; height: 2px;
    background: var(--white); border-radius: 2px; transition: all var(--transition);
}

/* Mobile Nav */
.mobile-nav {
    display: none; position: fixed;
    top: var(--header-height); left: 0; right: 0; bottom: 0;
    background: var(--bg-card); z-index: 99;
    padding: 0.5rem; overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav .nav-link {
    display: flex; width: 100%;
    padding: 0.85rem 1rem; font-size: 1rem;
    color: var(--text); border-bottom: 1px solid var(--border-light);
}
.mobile-nav .nav-link:hover { background: var(--yellow-10); }

/* ============================================
   HERO / CTA
   ============================================ */
.hero {
    background: var(--black);
    border-bottom: 2px solid var(--yellow);
}
.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto; padding: 1.4rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; flex-wrap: wrap;
}
.hero-text { flex: 1; min-width: 0; }
.hero-title {
    font-size: 1.4rem; font-weight: 700; color: var(--yellow);
    letter-spacing: -0.02em; line-height: 1.3; margin: 0 0 0.35rem;
}
.hero-subtitle {
    font-size: 0.84rem; color: rgba(255,255,255,0.7);
    line-height: 1.55; max-width: 600px;
}
.hero-right {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 0.75rem; flex-shrink: 0;
}
.hero-badges { display: flex; gap: 0.5rem; align-items: stretch; }
.hero-badge {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0.5rem 1rem; border: 1px solid rgba(224,214,70,0.35);
    border-radius: var(--radius-sm); background: rgba(224,214,70,0.1); min-width: 88px;
}
.hero-badge-value {
    font-size: 1.4rem; font-weight: 800; color: var(--yellow);
    line-height: 1.2; letter-spacing: -0.02em;
}
.hero-badge-label {
    font-size: 0.67rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: rgba(255,255,255,0.55); margin-top: 0.15rem;
}
.hero-badge-live { display: flex; align-items: center; gap: 0.3rem; }
.hero-cta {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 1rem; font-weight: 700;
    color: var(--cta-text); background: var(--cta);
    padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
    text-decoration: none; white-space: nowrap;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px var(--cta-glow);
    width: 100%; justify-content: center; letter-spacing: 0.01em;
}
.hero-cta:hover {
    background: var(--cta-hover); text-decoration: none; color: var(--cta-text);
    transform: translateY(-2px); box-shadow: 0 6px 20px var(--cta-glow-hover);
}
.status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #34a853; display: inline-block;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ============================================
   TOOLBAR
   ============================================ */
.toolbar {
    max-width: var(--max-width); margin: 0 auto;
    padding: 1rem 1.25rem 0; display: flex; flex-direction: column; gap: 0.75rem;
}
.search-bar { position: relative; max-width: 440px; }
.search-bar input {
    width: 100%; padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1.5px solid var(--border); border-radius: 999px;
    font-size: 0.88rem; background: var(--bg-card); color: var(--text);
    transition: all var(--transition); outline: none;
}
.search-bar input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-20); }
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon {
    position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.95rem; pointer-events: none;
}
.filter-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.filter-label {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); flex-shrink: 0;
}
.region-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.region-chip {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.35rem 0.75rem; border: 1.5px solid var(--border);
    border-radius: 999px; font-size: 0.8rem; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card);
    cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.region-chip:hover { border-color: var(--yellow); color: var(--gray-700); background: var(--yellow-10); }
.region-chip.active { border-color: var(--yellow); background: var(--yellow); color: var(--black); font-weight: 600; }
.chip-count { font-size: 0.7rem; opacity: 0.7; }
.sort-controls { margin-left: auto; display: flex; align-items: center; gap: 0.3rem; }
.sort-btn {
    padding: 0.3rem 0.65rem; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.75rem; font-weight: 500;
    color: var(--text-secondary); background: var(--bg-card);
    cursor: pointer; transition: all var(--transition);
}
.sort-btn.active { background: var(--black); color: var(--yellow); border-color: var(--black); }
[data-theme="dark"] .sort-btn.active { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

/* ============================================
   MAIN GRID
   ============================================ */
.main-content {
    max-width: var(--max-width); margin: 0 auto; padding: 1rem 1.25rem 2rem;
}
.tile-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 0.85rem;
}

/* ============================================
   NEWS TILE
   ============================================ */
.tile {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); overflow: hidden;
    transition: all var(--transition); display: flex; flex-direction: column;
}
.tile:hover { box-shadow: var(--shadow-md); border-color: var(--border); }
.tile-header {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.7rem 0.85rem; background: var(--black);
    border-bottom: 2px solid var(--yellow);
}
.tile-favicon {
    width: 20px; height: 20px; border-radius: 3px;
    object-fit: contain; flex-shrink: 0; background: var(--white); padding: 1px;
}
.tile-source {
    font-size: 0.85rem; font-weight: 600; color: var(--white);
    flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-source a { color: var(--white); text-decoration: none; }
.tile-source a:hover { color: var(--yellow); text-decoration: none; }
.tile-dismiss {
    width: 26px; height: 26px; border-radius: 50%;
    border: none; background: none; cursor: pointer;
    color: rgba(255,255,255,0.3); font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); flex-shrink: 0; opacity: 0;
}
.tile:hover .tile-dismiss { opacity: 1; }
.tile-dismiss:hover { background: rgba(255,255,255,0.1); color: var(--danger); }
.tile-body { padding: 0.35rem 0; flex-grow: 1; }
.tile-body ul { list-style: none; }
.headline-item {
    display: flex; align-items: baseline; gap: 0.5rem;
    padding: 0.4rem 0.85rem; transition: background var(--transition); cursor: pointer;
}
.headline-item:hover { background: var(--yellow-10); }
.headline-time {
    font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0;
    min-width: 36px; font-variant-numeric: tabular-nums;
}
.headline-text {
    font-size: 0.86rem; color: var(--text); line-height: 1.4;
    transition: color var(--transition);
}
.headline-item:hover .headline-text { color: var(--gray-700); }
[data-theme="dark"] .headline-item:hover .headline-text { color: var(--yellow); }
.headline-new .headline-text { font-weight: 600; }
.headline-new::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: var(--yellow); flex-shrink: 0; margin-top: 0.4rem;
}

/* ============================================
   ARTICLE DRAWER
   ============================================ */
.drawer-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 200; animation: fadeIn 0.15s ease;
}
.drawer-overlay.open { display: block; }
.drawer {
    position: fixed; bottom: 0; left: 0; right: 0;
    max-height: 65vh; background: var(--bg-card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 201; display: none; flex-direction: column;
    box-shadow: var(--shadow-lg); animation: slideUp 0.25s ease;
}
.drawer.open { display: flex; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.drawer-handle { display: flex; justify-content: center; padding: 0.6rem; cursor: grab; }
.drawer-handle-bar { width: 36px; height: 4px; border-radius: 2px; background: var(--border); }
.drawer-content { padding: 0 1.25rem 1.25rem; overflow-y: auto; flex-grow: 1; }
.drawer-source { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.6rem; }
.drawer-source img { width: 16px; height: 16px; border-radius: 2px; }
.drawer-source span { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.drawer-headline {
    font-size: 1.1rem; font-weight: 700; line-height: 1.4;
    margin-bottom: 0.6rem; letter-spacing: -0.01em;
}
.drawer-meta {
    display: flex; gap: 1rem; margin-bottom: 0.85rem;
    font-size: 0.76rem; color: var(--text-muted);
}
.drawer-preview {
    font-size: 0.88rem; color: var(--text-secondary);
    line-height: 1.6; margin-bottom: 1.15rem;
    border-left: 3px solid var(--yellow); padding-left: 0.85rem;
}
.drawer-actions { display: flex; gap: 0.5rem; }
.drawer-btn {
    flex: 1; padding: 0.65rem 0.85rem; border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 600; text-align: center;
    cursor: pointer; border: none; transition: all var(--transition);
    text-decoration: none; display: inline-flex; align-items: center;
    justify-content: center; gap: 0.3rem;
}
.drawer-btn-primary { background: var(--yellow); color: var(--black); }
.drawer-btn-primary:hover { background: var(--yellow-hover); color: var(--black); text-decoration: none; }
.drawer-btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.drawer-btn-secondary:hover { background: var(--border-light); }

/* ============================================
   LOGIN MODAL
   ============================================ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.6); z-index: 300;
    align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg); width: 100%; max-width: 400px;
    overflow: hidden; animation: fadeIn 0.2s ease;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; background: var(--black); color: var(--white);
    border-bottom: 2px solid var(--yellow);
}
.modal-header h2, .modal-header h3 { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--white); }
.modal-close {
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: none; cursor: pointer;
    color: rgba(255,255,255,0.5); font-size: 1.15rem;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.modal-body { padding: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block; font-size: 0.8rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 0.3rem;
}
.form-group input {
    width: 100%; padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.88rem; background: var(--bg); color: var(--text);
    transition: all var(--transition); outline: none;
}
.form-group input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-20); }
.form-submit {
    width: 100%; padding: 0.7rem; border: none; border-radius: var(--radius-sm);
    background: var(--yellow); color: var(--black);
    font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all var(--transition);
}
.form-submit:hover { background: var(--yellow-hover); }
.form-footer { text-align: center; margin-top: 1rem; font-size: 0.82rem; color: var(--text-muted); }
.form-divider {
    display: flex; align-items: center; gap: 0.75rem;
    margin: 1.1rem 0; font-size: 0.75rem; color: var(--text-muted);
}
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Page forms (login.php, register.php, profil.php) */
main.page-content { max-width: 600px; margin: 2rem auto; padding: 0 1.25rem; }
main.page-content h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
main.page-content section { margin-bottom: 2rem; }
.error { color: var(--danger); font-size: 0.88rem; margin-bottom: 0.75rem; font-weight: 500; }
.success { color: var(--success); font-size: 0.88rem; margin-bottom: 0.75rem; font-weight: 500; }
.register-field { margin-bottom: 0.75rem; }
.danger-zone {
    border: 1px solid var(--danger); border-radius: var(--radius-md);
    padding: 1.25rem; background: var(--danger-light);
}
.danger-zone h2 { color: var(--danger); }
.source-list h3 { margin-top: 1rem; margin-bottom: 0.4rem; font-size: 0.95rem; }
.region-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.region-group label { font-size: 0.85rem; cursor: pointer; white-space: nowrap; }

/* ============================================
   AUTH PAGES (login, register)
   ============================================ */
.auth-container { max-width: 480px; margin: 0 auto; }
.auth-back { margin-bottom: 1.5rem; }
.auth-back a { color: var(--text-secondary); font-size: 0.85rem; }
.auth-back a:hover { color: var(--yellow); }
.auth-section { margin-bottom: 1.5rem; }
.auth-section h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.25rem; }
.auth-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.register-consent { margin: 1rem 0; }
.register-consent label { font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; }
.register-consent a { color: var(--yellow-hover); text-decoration: underline; }

/* ============================================
   PROFILE PAGE
   ============================================ */
.profile-container { max-width: 700px; margin: 0 auto; }
.profile-container h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.profile-section { background: var(--bg-card); border-radius: var(--radius-md); padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.profile-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.info-box { background: var(--yellow-10); border-left: 3px solid var(--yellow); padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.85rem; color: var(--text-secondary); }
.form-submit-danger { background: var(--danger) !important; }
.form-submit-danger:hover { background: #c62b20 !important; }

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--black); color: rgba(255,255,255,0.5);
    padding: 1.25rem; border-top: 2px solid var(--yellow);
}
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.5rem;
}
.footer-copy { font-size: 0.78rem; }
.footer-links { display: flex; gap: 1.15rem; }
.footer-links a { font-size: 0.78rem; color: rgba(255,255,255,0.4); transition: color var(--transition); }
.footer-links a:hover { color: var(--yellow); text-decoration: none; }

/* Back to Top */
.back-to-top {
    position: fixed; bottom: 1.25rem; right: 1.25rem;
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--black); color: var(--yellow);
    border: 2px solid var(--yellow); cursor: pointer;
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); transition: all var(--transition);
    opacity: 0; transform: translateY(10px); pointer-events: none; z-index: 50;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--yellow); color: var(--black); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-nav { display: none; }
    .hamburger { display: flex; }
    .tile-grid { grid-template-columns: 1fr; }
    .filter-row { flex-direction: column; align-items: flex-start; }
    .sort-controls { margin-left: 0; }
    .region-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.25rem; width: 100%; }
    .region-chip { flex-shrink: 0; }
    .hero-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .hero-right { align-items: flex-start; width: 100%; }
    .hero-cta { width: 100%; justify-content: center; }
    .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 400px) {
    .brand-name { font-size: 1rem; }
    .search-bar input { font-size: 0.85rem; }
}
