/* Header & Navigation Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

/* Top Banner */
.top-banner {
    background: #000000;
    position: relative;
    overflow: hidden;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100%;
    background: radial-gradient(circle at top, rgba(111, 231, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    flex-wrap: nowrap;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

.badge-new {
    background: var(--secondary-gradient);
    color: #000000;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: none;
    flex-shrink: 0;
}

.banner-title {
    color: var(--nmca-green);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.banner-text {
    color: #FFFFFF;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}


/* Navbar */
.navbar {
    height: 70px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.8) !important;
    height: 64px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

.nav-container-full {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 4rem;
    max-width: 1440px;
    --primary-blue: #FF00CC;
    --brand-gradient: linear-gradient(to right, #FF00CC, #A020F0);
    margin: 0 auto;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    height: 40px;
    width: auto;
    transition: height 0.3s;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    height: 100%;
    /* Important: Bridge the gap */
}

.nav-item {
    position: static;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link-btn {
    border: none;
    background: transparent;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.625rem 1.125rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Integrated SVG Arrow tip */
.menu-arrow-tip {
    position: absolute;
    top: -7px;
    /* Flush with menu top */
    left: 0;
    transform: translateX(-50%);
    width: 16px;
    height: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-arrow-tip svg {
    width: 16px;
    height: 7px;
    display: block;
}

.nav-link-btn.active {
    background: rgba(255, 255, 255, 0.123) !important;
    color: #FFFFFF !important;
}

.nav-link-btn.active .chevron {
    transform: rotate(180deg);
    color: #FFFFFF !important;
}

.chevron {
    font-size: 0.75rem;
    transition: transform 0.3s;
    color: rgba(255, 255, 255, 0.6);
}

/* Mega Menu Core */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 128px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: visible;
    /* Allow arrow to stick out */
    color: #1C1C1E;
    width: auto;
    padding: 2rem 2.5rem;
    transition: all 0.3s ease;
}

/* Unified Premium Widths */
.mega-menu[x-show*='challenge'],
.mega-menu[x-show*='trading'],
.mega-menu[x-show*='academy'] {
    min-width: 820px;
}

.mega-menu[x-show*='about'] {
    min-width: 720px;
}

.mega-grid {
    display: grid;
    gap: 2.5rem;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Custom Academy Grid */
.mega-grid-academy {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 3rem;
}

.mega-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mega-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.mega-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-item {
    display: flex;
    align-items: start;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
    color: inherit;
}

.mega-item:hover {
    background: #F2F2F7;
}

.btn-primary {
    background: var(--brand-gradient, linear-gradient(to right, #FF00CC, #A020F0));
    color: #FFFFFF !important;
    height: 36px;
    padding: 0 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
    border: none;
}

.btn-primary:hover {
    background: #FF00CC;
    box-shadow: 0 0 15px rgba(255, 0, 204, 0.4);
    transform: translateY(-1px);
}

.nav-right-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .nav-right-desktop {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }
}

.login-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: #FFFFFF !important;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: opacity 0.2s;
}

.login-btn:hover {
    opacity: 0.8;
}

.nav-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.5rem;
}

.mega-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F2F2F7;
    border-radius: 10px;
}

.mega-icon svg {
    width: 22px;
    height: 22px;
}

.mega-text h6 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1C1C1E;
    margin-bottom: 3px;
}

.mega-text p {
    font-size: 0.8125rem;
    color: #8E8E93;
    line-height: 1.4;
}

.mega-promo {
    background: #F9F9FB;
    border-radius: 16px;
    padding: 1.5rem;
    width: 320px;
}

.promo-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.promo-card img {
    width: 100%;
    border-radius: 12px;
}

.promo-info h6 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1C1C1E;
}

.promo-info p {
    font-size: 0.8125rem;
    color: #8E8E93;
    line-height: 1.5;
}

/* Academy Specific Details Up-scaled */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
}

.academy-card-wide {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem;
    border-radius: 12px;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.academy-card-wide:hover {
    background: #F2F2F7;
}

.academy-card-wide img {
    width: 80px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
}

.academy-text h6 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.academy-text p {
    font-size: 0.8125rem;
    color: #8E8E93;
    margin: 0;
}

.more-lessons {
    display: inline-block;
    margin-top: 2rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #1C1C1E;
    text-decoration: none;
}

/* Transitions */
.enter-transition {
    transition: all 0.25s ease-out;
    opacity: 0;
    transform: translateY(10px);
}

.leave-transition {
    transition: all 0.15s ease-in;
    opacity: 0;
    transform: translateY(5px);
}

/* Utils */
.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #FFFFFF;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

/* Show only on desktop (≥ 1024px) */
.desktop-only {
    display: flex;
}

/* Show only on mobile (< 1024px) */
.mobile-only {
    display: none !important;
}

/* ============================================
   HAMBURGER BUTTON
   ============================================ */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animated states via Alpine.js :class bindings */
.rotate-45 {
    transform: rotate(45deg) translateY(7px);
}

.-rotate-45 {
    transform: rotate(-45deg) translateY(-7px);
}

.translate-y {
    transform: rotate(45deg) translateY(7px);
}

.-translate-y {
    transform: rotate(-45deg) translateY(-7px);
}

.opacity-0 {
    opacity: 0;
}

.scale-0 {
    transform: scaleX(0);
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
    position: fixed;
    top: 48px;
    /* below top banner */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   MOBILE DRAWER — Official NMCA Design
   ============================================ */
.mobile-drawer {
    position: fixed;
    top: 48px;
    /* start BELOW the top announcement banner */
    left: 0;
    width: 100%;
    height: calc(100vh - 48px);
    background: transparent;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hidden by default — no slide on outer container */
    visibility: hidden;
    pointer-events: none;
}

.mobile-drawer.open {
    visibility: visible;
    pointer-events: all;
}

/* Drawer Header — dark bar matching navbar, NO animation */
.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 68px;
    background: #000000;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    /* No transform — header appears instantly */
    position: relative;
    z-index: 1;
}

.mobile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #FFFFFF;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Drawer Body — white background, ONLY this animates */
.mobile-drawer-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    /* Slide-in animation for the white content only */
    transform: translateY(-12px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.05s,
        opacity 0.25s ease 0.05s;
}

.mobile-drawer.open .mobile-drawer-body {
    transform: translateY(0);
    opacity: 1;
}

.mobile-drawer-body::-webkit-scrollbar {
    width: 4px;
}

.mobile-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Mobile Nav list */
.mobile-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mobile-nav-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1rem;
    height: 56px;
    background: transparent;
    border: none;
    color: #18181B;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.mobile-nav-btn:hover,
.mobile-nav-btn:active {
    background: rgba(0, 0, 0, 0.04);
}

.mobile-chevron {
    flex-shrink: 0;
    color: #52525C;
    transition: transform 0.25s ease;
}

.mobile-chevron.rotated {
    transform: rotate(180deg);
    color: #52525C;
}

/* Mobile Submenu — light gray bg */
.mobile-submenu {
    background: #F9FAFB;
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.mobile-submenu-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #71717A;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 1.25rem 0.25rem;
}

.mobile-sub-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: #18181B;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s;
    min-height: 48px;
}

.mobile-sub-link:hover,
.mobile-sub-link:active {
    background: rgba(0, 0, 0, 0.04);
}

.mobile-sub-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Icon box — white rounded square with blue SVG, same as desktop mega-menu */
.mobile-sub-icon-box {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: rgba(7, 129, 254, 0.10);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-sub-icon-box svg {
    width: 18px;
    height: 18px;
}

/* Two-line text block: title + descriptor */
.mobile-sub-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
}

.mobile-sub-text span {
    color: #18181B;
    font-size: 0.875rem;
    font-weight: 600;
}

.mobile-sub-text small {
    color: #71717A;
    font-size: 0.75rem;
    font-weight: 400;
}

/* Thumbnail for Academy items — small rounded image */
.mobile-sub-thumb {
    width: 52px;
    height: 36px;
    min-width: 52px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}


/* CTA Row — at bottom of drawer */
.mobile-cta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

.mobile-cta-row .btn-primary {
    flex: 1.5;
    justify-content: center;
    height: 48px;
    font-size: 0.9375rem;
    font-weight: 700;
    border-radius: 10px;
    background: #007AFF;
    /* Apple/Premium Blue */
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-cta-row .btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.mobile-login-btn {
    flex: 1;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #E5E5E7;
    border-radius: 10px;
    color: #1C1C1E;
    font-weight: 700;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.2s;
    background: #FFFFFF;
}

.mobile-login-btn:active {
    background: #F2F2F7;
    transform: scale(0.98);
}

/* ============================================
   BREAKPOINTS
   ============================================ */

/* Tablet and below: hide desktop nav, show hamburger */
@media (max-width: 1023px) {
    .nav-container-full {
        padding: 0 1.25rem;
    }

    .nav-links {
        display: none !important;
    }

    .mega-menu {
        display: none !important;
    }

    .header-icons {
        display: none;
    }

    .nav-divider {
        display: none;
    }

    .nav-right-desktop {
        display: none !important;
    }

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


    .mobile-only {
        display: flex !important;
    }

    .nav-left {
        gap: 0;
    }

    .top-banner {
        font-size: 0.75rem;
        padding: 0 1rem;
    }

    .banner-content {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    /* On very small phones, shrink banner to fit */
    .banner-title {
        font-size: 0.75rem;
        max-width: calc(100vw - 180px);
    }
    .banner-text {
        font-size: 0.75rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .mobile-drawer {
        max-width: 100%;
    }

    .top-banner .banner-text span:last-child {
        display: none;
    }

    .nav-container-full {
        padding: 0 0.875rem;
    }

    /* Hide banner title on tiny screens — keep badge + CTA link readable */
    .top-banner .banner-title {
        display: none;
    }
}