/* Header & navigasi */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(10, 26, 44, 0.72);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-ice);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(127, 224, 255, 0.10);
    border: 1px solid var(--border-ice);
    color: var(--accent-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.header-user-ic {
    font-size: 0.9rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--accent-secondary);
    font-weight: 700;
    font-size: 1.25rem;
}

.brand-icon {
    font-size: 1.4rem;
}

.main-nav {
    display: flex;
    gap: 16px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 5px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.main-nav a:hover {
    color: var(--accent-primary);
}

.main-nav a.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-ice);
    background: rgba(8, 21, 36, 0.6);
    padding: 24px 0;
    text-align: center;
    color: var(--text-soft);
}

/* Header user -> tombol logout */
.header-user-form {
    margin: 0;
}

.header-user {
    cursor: pointer;
    font-family: inherit;
}

.header-user:hover {
    background: rgba(127, 224, 255, 0.18);
    border-color: var(--accent-primary);
}

.header-user-out {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsif header & navigasi */
@media (max-width: 720px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 12px 0;
        gap: 10px;
    }

    .header-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .main-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        width: 100%;
        padding: 2px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 9px 12px;
        border-radius: 10px;
    }

    .main-nav a.active {
        background: rgba(127, 224, 255, 0.10);
    }
}

/* Dropdown navigasi (grup "Belajar") */
.nav-drop {
    position: relative;
}

.nav-drop-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 5px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-drop-toggle::-webkit-details-marker {
    display: none;
}

.nav-drop-toggle:hover {
    color: var(--accent-primary);
}

.nav-drop-aktif .nav-drop-toggle {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.nav-drop-caret {
    font-size: 0.7rem;
    color: var(--text-soft);
    transition: transform 0.2s ease;
}

.nav-drop[open] .nav-drop-caret {
    transform: rotate(180deg);
}

.nav-drop-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 160px;
    padding: 8px;
    background: rgba(10, 26, 44, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-ice);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(4, 12, 24, 0.5);
    z-index: 40;
    animation: navDropFade 0.16s ease;
}

.nav-drop-panel::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-drop-panel a {
    padding: 9px 14px;
    border-radius: 10px;
    border-bottom: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-drop-panel a:hover {
    background: rgba(127, 224, 255, 0.12);
    color: var(--accent-primary);
}

.nav-drop-panel a.active {
    background: rgba(127, 224, 255, 0.14);
    color: var(--accent-primary);
    border-bottom: none;
}

@keyframes navDropFade {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 720px) {
    .nav-drop-panel {
        position: static;
        transform: none;
        min-width: 0;
        margin-top: 8px;
        animation: none;
    }

    .nav-drop-panel::before {
        display: none;
    }
}

/* Chip statistik di header halaman (penonton live + total pengunjung) */
.hal-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.hal-stats-center {
    justify-content: center;
}

.hal-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(127, 224, 255, 0.10), rgba(127, 224, 255, 0.03));
    border: 1px solid var(--border-ice);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(4, 12, 24, 0.25);
    backdrop-filter: blur(6px);
}

.hal-stat b,
.hal-stat strong {
    color: var(--accent-secondary);
    font-weight: 800;
}

.hal-stat-ic {
    font-size: 0.95rem;
    line-height: 1;
}

.hal-stat-live {
    color: var(--accent-secondary);
    border-color: rgba(127, 224, 255, 0.45);
    background: linear-gradient(135deg, rgba(127, 224, 255, 0.20), rgba(127, 224, 255, 0.06));
    box-shadow: 0 4px 16px rgba(95, 211, 240, 0.18);
}

/* Titik denyut "sedang melihat" */
.live-dot {
    position: relative;
    width: 9px;
    height: 9px;
    flex: none;
    border-radius: 50%;
    background: #4fe08b;
    box-shadow: 0 0 0 rgba(79, 224, 139, 0.6);
    animation: livePulse 1.8s ease-out infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(79, 224, 139, 0.55); }
    70% { box-shadow: 0 0 0 8px rgba(79, 224, 139, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 224, 139, 0); }
}