/* ============ Particles.js Hintergrund ============ */
#particles-js {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

body.has-particles::before {
    opacity: 0.35;
}

.site-shell,
.site-header,
.site-main,
.footer {
    position: relative;
    z-index: 1;
}

.cookie-banner,
.cookie-overlay,
.mobile-menu-overlay,
.mobile-menu-sheet {
    z-index: 2000;
}

/* ============ Moderner Site-Header (Logo + Nav vereint) ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(8, 12, 18, 0.72);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    background: rgba(8, 12, 18, 0.92);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 77, 77, 0.45) 20%,
        rgba(0, 212, 255, 0.35) 80%,
        transparent
    );
    pointer-events: none;
}

:root {
    --fg-sticky-top: 72px;
}

.site-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    min-height: 72px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.site-brand:hover {
    color: inherit;
}

.site-brand-logo-wrap {
    position: relative;
    flex-shrink: 0;
}

.site-brand-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    opacity: 0.35;
    filter: blur(8px);
    z-index: 0;
}

.site-brand-img {
    position: relative;
    z-index: 1;
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.site-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.site-brand-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #c8d0e0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.15;
}

.site-brand-tagline {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.2rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #ff6b6b;
    background: rgba(255, 77, 77, 0.12);
    border: 1px solid rgba(255, 77, 77, 0.25);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    width: fit-content;
}

.site-brand-badge .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 0;
    background: #ff4d4d;
    animation: sitePulse 1.5s ease infinite;
}

@keyframes sitePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ============ Professionelle Navigation ============ */
.site-nav {
    display: flex;
    justify-content: center;
    min-width: 0;
}

.site-nav-menu {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    list-style: none;
    margin: 0;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
}

.site-nav-menu > li > a,
.site-nav-menu .nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.site-nav-menu > li > a .nav-icon,
.site-nav-menu .nav-dropdown-toggle .nav-icon {
    font-size: 1rem;
    opacity: 0.85;
}

.site-nav-menu > li > a:hover,
.site-nav-menu .nav-dropdown-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.site-nav-menu > li > a.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 4px 16px rgba(255, 77, 77, 0.35);
}

.site-nav-menu .nav-dropdown-toggle.active {
    color: #ff8a8a;
    background: rgba(255, 77, 77, 0.1);
}

.site-nav-menu .nav-dropdown-menu {
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(14, 18, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    padding: 0.35rem;
}

.site-nav-menu .nav-dropdown:hover .nav-dropdown-menu {
    transform: translateX(-50%) translateY(0);
}

.site-nav-menu .nav-dropdown-menu li a {
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.site-header-actions .btn-ghost {
    border: 1px solid transparent;
}

.site-header-actions .btn-ghost:hover {
    border-color: var(--border-color);
}

.site-header-actions .btn-primary {
    padding: 0.5rem 1.1rem;
    font-size: 0.85rem;
}

.site-header .menu-toggle {
    display: none;
}

.site-main {
    min-height: calc(100vh - 72px);
}

/* ============ Modernere Seiten-Header (compact-header) ============ */
.compact-header {
    background: rgba(21, 29, 41, 0.55);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.compact-title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-header h2,
.page-hero h1 {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

/* Legacy: alte Klassen verstecken wenn site-header aktiv */
.top-header {
    display: none !important;
}

.navbar:not(.legacy-navbar) {
    display: none !important;
}

@media (max-width: 1100px) {
    .site-brand-tagline,
    .site-brand-badge {
        display: none;
    }

    .site-brand-title {
        font-size: 1.05rem;
    }

    .site-nav-menu > li > a,
    .site-nav-menu .nav-dropdown-toggle {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    :root {
        --fg-sticky-top: 60px;
    }

    .site-header-inner {
        grid-template-columns: 1fr auto;
        padding: 0.5rem 1rem;
        min-height: 60px;
    }

    .site-nav {
        display: none;
    }

    .site-header-actions {
        display: none;
    }

    .site-header .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        font-size: 1.25rem;
        cursor: pointer;
    }

    .site-brand-img {
        height: 44px;
    }

    /* Mobile: altes nav menu für Toggle falls noch genutzt */
    .site-nav-menu.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 1rem;
        right: 1rem;
        background: rgba(12, 16, 24, 0.98);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        padding: 0.75rem;
        z-index: 1001;
        box-shadow: var(--shadow-lg);
    }

    /* Handy-App Navigation unten */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1100 !important;
        background: rgba(12, 16, 24, 0.96);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .mobile-nav-item {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0;
    }

    body.site-shell {
        padding-bottom: calc(56px + env(safe-area-inset-bottom));
    }

    .site-shell .footer {
        display: none;
    }
}

/* Monitor: keine Navigation */
body.monitor-active .site-header,
body.monitor-active .mobile-bottom-nav,
body.monitor-active .footer {
    display: none !important;
}

/* Eckige Badges & Chips site-weit (Navbar-Stil bleibt) */
.live-badge,
.stat-badge,
.station-badge,
.alarm-card-type,
.alarm-card-box,
.filter-chip,
.monitor-station-badge,
.setup-chip,
.wall-filter-label,
.nachalarm-badge,
.nachalarmierung-badge {
    border-radius: var(--radius-sm) !important;
}

.user-avatar {
    border-radius: var(--radius-sm) !important;
}

.user-avatar-img {
    display: block;
    object-fit: cover;
}

.btn,
.card,
.modal-content,
.alarm-card,
.alarm-card-box,
.stat-card,
.auth-card {
    border-radius: var(--radius-sm);
}
