/* ========== SMAN 81 JAKARTA - REFINED HEADER ========== */
/* Clean institutional design with professional polish */

/* CSS Custom Properties */
:root {
    --header-primary: #1e3a5f;
    --header-accent: #c9a227;
    --header-text: #2d3748;
    --header-text-light: #64748b;
    --header-bg: #ffffff;
    --header-border: #e2e8f0;
    --header-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
    --header-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Main Header Container */
#main-header {
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--header-shadow);
}

/* Top Bar - Refined institutional blue */
.header-top {
    background: linear-gradient(135deg, var(--header-primary) 0%, #0f2744 100%);
    border-top: 3px solid var(--header-accent);
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

.header-top-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.header-top-info li {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.9);
}

.header-top-info li i {
    color: var(--header-accent);
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.header-top-info li a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: color var(--header-transition);
}

.header-top-info li a:hover {
    color: var(--header-accent);
}

/* Flash News Marquee */
.header-top-flashnews {
    flex: 1;
    max-width: 500px;
    margin: 0 1.5rem;
    overflow: hidden;
}

.header-top-flashnews a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 0.35rem 0.75rem;
    transition: all 0.2s ease;
}

.header-top-flashnews a:hover {
    background: rgba(255,255,255,0.2);
}

.flash-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--header-accent);
    border-radius: 50%;
    flex-shrink: 0;
}

.flash-icon i {
    font-size: 0.625rem;
    color: #1e3a5f;
}

.flash-marquee {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 1.25rem;
}

.flash-text {
    display: inline-block;
    white-space: nowrap;
    font-size: 0.75rem;
    animation: marquee 15s linear infinite;
    padding-left: 100%;
}

.flash-text:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 64px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.nav-logo img.logo-desktop {
    height: 48px;
    width: auto;
    transition: transform var(--header-transition);
}

.nav-logo img.logo-mobile {
    height: 40px;
    width: auto;
    display: none;
}

.nav-logo:hover img {
    transform: scale(1.02);
}

.nav-logo-text {
    display: none;
}

.verified-badge {
    vertical-align: -2px;
    flex-shrink: 0;
}

/* Hamburger Button */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 1002;
    padding: 4px;
    border-radius: 6px;
    transition: background var(--header-transition);
}

.nav-hamburger:hover {
    background: rgba(0,0,0,0.05);
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--header-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.nav-menu > li {
    position: relative;
}

/* Login button - Far right on desktop, red badge style */
.nav-auth {
    order: 99;
    margin-left: 1rem;
}

.nav-auth a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    color: #fff !important;
    background: #e94560;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: all var(--header-transition);
    box-shadow: 0 2px 8px rgba(233,69,96,0.3);
}

.nav-auth a:hover {
    background: #ad2741 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233,69,96,0.4);
}
 

.nav-auth a i {
    font-size: 0.875rem;
}

/* Nav Links */
.nav-menu > li > a,
.nav-menu > li > .nav-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    color: var(--header-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--header-transition);
    cursor: pointer;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.nav-menu > li > a:hover,
.nav-menu > li > .nav-link:hover,
.nav-menu > li:hover > a,
.nav-menu > li:hover > .nav-link {
    color: var(--header-primary);
    background: rgba(30,58,95,0.06);
}

.nav-menu > li > a i.fa-chevron-down,
.nav-menu > li > .nav-link i.fa-chevron-down {
    font-size: 0.5rem;
    opacity: 0.6;
    transition: transform var(--header-transition);
}

.nav-menu > li:hover > .nav-link i.fa-chevron-down {
    transform: rotate(180deg);
}

/* Dropdown Menu - Desktop: Vertical list, no icons */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--header-bg);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 10px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    z-index: 1000;
    border: 1px solid var(--header-border);
    border-top: none;
    display: flex;
    flex-direction: column;
}

.nav-menu > li:hover > .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown items - Clean vertical list without icons */
.nav-dropdown li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.nav-dropdown li a {
    display: block;
    width: 100%;
    padding: 0.625rem 1.25rem;
    color: var(--header-text);
    font-size: 0.875rem;
    font-weight: 450;
    text-decoration: none;
    transition: all var(--header-transition);
    white-space: nowrap;
    box-sizing: border-box;
}

.nav-dropdown li a:hover {
    background: rgba(30,58,95,0.06);
    color: var(--header-primary);
}

/* Hide icons in dropdown */
.nav-dropdown li a i {
    display: none;
}

/* Nav Separator */
.nav-separator {
    width: 1px;
    height: 20px;
    background: var(--header-border);
    margin: 0 0.5rem;
}

/* Desktop Only Item */
.desktop-only {
    display: block;
}

/* ========== MOBILE STYLES ========== */
@media (max-width: 1024px) {
    .nav-hamburger {
        display: flex;
    }

    .desktop-only {
        display: none !important;
    }

    /* Mobile Menu - White background, slides from right */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 85% !important;
        max-width: 340px !important;
        height: 100vh !important;
        height: 100dvh !important;
        background: #ffffff !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0 !important;
        gap: 0 !important;
        overflow-y: auto !important;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: -8px 0 30px rgba(0,0,0,0.15) !important;
        z-index: 1001 !important;
    }

    .nav-menu.active {
        right: 0 !important;
    }

    /* Mobile Menu Header */
    .nav-menu::before {
        content: 'Menu';
        display: block;
        padding: 1.25rem 1.5rem;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: #64748b;
        border-bottom: 1px solid #e2e8f0;
        background: #f8fafc !important;
    }

    /* Login Button - First priority in mobile */
    .nav-auth {
        order: -1;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--header-border);
        margin: 0 !important;
        background: #f8fafc;
    }

    .nav-auth a {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
        background: #e94560 !important;
        color: #fff !important;
        border-radius: 50px !important;
        box-shadow: 0 2px 8px rgba(233,69,96,0.3);
    }

    .nav-auth a:hover {
        background: #d63050 !important;
    }

    .nav-menu > li {
        border-bottom: 1px solid #e2e8f0 !important;
        background: #ffffff !important;
    }

    .nav-menu > li:last-child {
        border-bottom: none !important;
    }

    .nav-menu > li > a,
    .nav-menu > li > .nav-link {
        padding: 1rem 1.5rem !important;
        justify-content: space-between !important;
        color: #2d3748 !important;
        border-radius: 0 !important;
        font-size: 0.9375rem !important;
        background: transparent !important;
    }

    .nav-menu > li > a:hover,
    .nav-menu > li > .nav-link:hover {
        background: #f8fafc !important;
        color: #1e3a5f !important;
    }

    .nav-menu > li > a i.fa-chevron-down,
    .nav-menu > li > .nav-link i.fa-chevron-down {
        font-size: 0.625rem !important;
        opacity: 0.5 !important;
        transition: transform 0.3s ease !important;
        color: #2d3748 !important;
    }

    .nav-menu > li.submenu-open > .nav-link i.fa-chevron-down {
        transform: rotate(180deg) !important;
    }

    /* Mobile Dropdown - Expandable submenu */
    .nav-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background: #f1f5f9 !important;
        border-radius: 0 !important;
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.04) !important;
        border: none !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .nav-menu > li.submenu-open > .nav-dropdown {
        max-height: 800px !important;
        padding: 0.5rem 0 !important;
    }

    .nav-dropdown li {
        display: block !important;
        width: 100% !important;
        background: #f1f5f9 !important;
    }

    .nav-dropdown li a {
        display: block !important;
        width: 100% !important;
        padding: 0.875rem 1.5rem 0.875rem 2.25rem !important;
        color: #2d3748 !important;
        border-radius: 0 !important;
        font-size: 0.875rem !important;
        border-bottom: 1px solid rgba(0,0,0,0.06) !important;
        position: relative !important;
        box-sizing: border-box !important;
        background: transparent !important;
    }

    .nav-dropdown li:last-child a {
        border-bottom: none !important;
    }

    .nav-dropdown li a::before {
        content: '' !important;
        position: absolute !important;
        left: 1.5rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 4px !important;
        height: 4px !important;
        background: #1e3a5f !important;
        border-radius: 50% !important;
        opacity: 0.4 !important;
    }

    .nav-dropdown li a:hover {
        background: #e2e8f0 !important;
        color: #1e3a5f !important;
    }

    .nav-dropdown li a:hover::before {
        opacity: 1 !important;
    }

    .nav-separator {
        display: none;
    }

    /* Mobile Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        height: 100dvh;
        background: rgba(15,39,68,0.4);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* ========== SMALL MOBILE ========== */
@media (max-width: 480px) {
    .main-nav {
        padding: 0 1rem;
        min-height: 56px;
    }

    .nav-logo img.logo-desktop {
        display: none;
    }

    .nav-logo img.logo-mobile {
        display: block;
        height: 36px;
    }

    .nav-logo-text {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 1.05rem;
        font-weight: 700;
        color: #1a1a2e;
        white-space: nowrap;
    }

    .nav-logo-text .verified-badge {
        vertical-align: -1px;
        margin-bottom: 2px;
    }

    .header-top-info {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .nav-menu {
        max-width: 100%;
        width: 100%;
    }
}

/* ========== HEADER TOP RESPONSIVE ========== */
@media (max-width: 1024px) {
    .header-top-flashnews {
        max-width: 300px;
        margin: 0 1rem;
    }
}

@media (max-width: 768px) {
    .header-top .container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .header-top-info {
        justify-content: center;
        width: 100%;
        order: 1;
    }

    .header-top-flashnews {
        width: 100%;
        max-width: 100%;
        margin: 0;
        order: 2;
    }

    .header-top-right {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-top-info {
        display: none;
    }

    .header-top-flashnews {
        order: 1;
    }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
.nav-menu > li > a:focus,
.nav-menu > li > .nav-link:focus,
.nav-dropdown li a:focus,
.nav-auth a:focus {
    outline: 2px solid var(--header-primary);
    outline-offset: 2px;
}
