/* ═══════════════════════════════════════════════════════
   PREMIUM MOBILE MENU — New dedicated .mobile-drawer
   Uses a completely separate element outside .navbar
   so backdrop-filter clipping doesn't apply.
   ═══════════════════════════════════════════════════════ */

/* Desktop (769px+): hide mobile-only elements */
@media (min-width: 769px) {
    .nav-toggle {
        display: none !important;
    }

    .mobile-drawer {
        display: none !important;
    }

    .mobile-overlay {
        display: none !important;
    }

    body .mobile-drawer {
        display: none !important;
    }

    body .mobile-overlay {
        display: none !important;
    }
}


/* ── Keyframes ──────────────────────────────────────── */
@keyframes drawerSlideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes drawerItemIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    40% {
        transform: translate(-14px, 12px) scale(1.08);
    }

    70% {
        transform: translate(10px, -8px) scale(0.94);
    }
}

@keyframes certPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 217, 255, .5);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 217, 255, 0);
    }
}

@keyframes registerShimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

/* ══════════════════════════════════════════════════════
   MOBILE BREAKPOINT
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Lock scroll */
    body.menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* Show hamburger */
    .nav-toggle {
        display: flex !important;
        flex-direction: column !important;
        gap: 5px !important;
        background: none !important;
        border: none !important;
        cursor: pointer !important;
        padding: 8px !important;
        position: relative !important;
        z-index: 100 !important;
    }

    .nav-toggle span {
        display: block !important;
        width: 24px !important;
        height: 2px !important;
        background: rgba(255, 255, 255, .9) !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
    }

    /* Hamburger → X when active */
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
        background: #00d9ff !important;
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px) !important;
        background: #00d9ff !important;
    }

    /* ── BACKDROP OVERLAY ─────────────────────────── */
    .mobile-overlay {
        display: block !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0, 0, 0, .65) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 1000 !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity .3s ease !important;
    }

    .mobile-overlay.active {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* ── MOBILE DRAWER ────────────────────────────── */
    .mobile-drawer {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(300px, 84vw) !important;
        height: 100dvh !important;
        z-index: 1001 !important;

        /* Premium dark glassmorphism */
        background:
            radial-gradient(ellipse 110% 55% at 110% 0%, rgba(0, 217, 255, .15), transparent 58%),
            radial-gradient(ellipse 80% 70% at 0% 100%, rgba(168, 85, 247, .13), transparent 58%),
            linear-gradient(175deg, #0c1020 0%, #060910 100%) !important;
        border-left: 1px solid rgba(255, 255, 255, .07) !important;
        box-shadow: -20px 0 80px rgba(0, 0, 0, .75),
            inset 1px 0 0 rgba(255, 255, 255, .04) !important;
        border-radius: 24px 0 0 24px !important;
        overflow: hidden !important;

        /* Hidden by default */
        transform: translateX(100%) !important;
        transition: transform .38s cubic-bezier(.4, 0, .2, 1) !important;
        pointer-events: none !important;
    }

    /* Ambient glowing orbs */
    .mobile-drawer::before {
        content: '' !important;
        position: absolute !important;
        top: -60px !important;
        right: -60px !important;
        width: 240px !important;
        height: 240px !important;
        background: radial-gradient(circle, rgba(0, 217, 255, .18), transparent 70%) !important;
        border-radius: 50% !important;
        pointer-events: none !important;
        animation: orbFloat 14s ease-in-out infinite !important;
    }

    .mobile-drawer::after {
        content: '' !important;
        position: absolute !important;
        bottom: 100px !important;
        left: -70px !important;
        width: 200px !important;
        height: 200px !important;
        background: radial-gradient(circle, rgba(168, 85, 247, .15), transparent 70%) !important;
        border-radius: 50% !important;
        pointer-events: none !important;
        animation: orbFloat 18s ease-in-out infinite reverse !important;
    }

    /* Active = slide in */
    .mobile-drawer.active {
        transform: translateX(0) !important;
        pointer-events: auto !important;
        animation: drawerSlideIn .38s cubic-bezier(.4, 0, .2, 1) !important;
    }

    /* ── DRAWER CLOSE BUTTON ──────────────────────── */
    .drawer-close-btn {
        position: absolute !important;
        top: 20px !important;
        right: 20px !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 50% !important;
        width: 38px !important;
        height: 38px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #fff !important;
        cursor: pointer !important;
        z-index: 10 !important;
        transition: all 0.3s ease !important;
    }

    .drawer-close-btn:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        transform: rotate(90deg) !important;
    }

    /* ── LINKS SECTION ────────────────────────────── */
    .mobile-drawer-links {
        display: flex !important;
        flex-direction: column !important;
        padding-top: 72px !important;
        /* space for fixed X button */
        flex: 1 !important;
        overflow-y: auto !important;
        position: relative !important;
        z-index: 2 !important;
    }

    .mobile-nav-link {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 15px 24px !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        font-family: 'Outfit', 'Inter', sans-serif !important;
        color: rgba(200, 214, 230, 0.85) !important;
        text-decoration: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, .04) !important;
        position: relative !important;
        transition: color .2s, background .2s !important;
        overflow: hidden !important;
    }

    .mobile-nav-link .mobile-nav-icon {
        font-size: 1.1rem !important;
        width: 24px !important;
        text-align: center !important;
        flex-shrink: 0 !important;
    }

    .mobile-nav-link:hover,
    .mobile-nav-link:active {
        color: #fff !important;
        background: rgba(0, 217, 255, .06) !important;
    }

    /* Colour left accent bar per link */
    .mobile-nav-link::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 3px !important;
        border-radius: 0 3px 3px 0 !important;
        background: linear-gradient(180deg, #00d9ff, #00ff88) !important;
        transform: scaleY(0) !important;
        transform-origin: center !important;
        transition: transform .22s cubic-bezier(.4, 0, .2, 1) !important;
    }

    .mobile-nav-link:nth-child(2)::before {
        background: linear-gradient(180deg, #00ff88, #00b85a) !important;
    }

    .mobile-nav-link:nth-child(3)::before {
        background: linear-gradient(180deg, #a855f7, #7c3aed) !important;
    }

    .mobile-nav-link:nth-child(4)::before {
        background: linear-gradient(180deg, #f59e0b, #d97706) !important;
    }

    .mobile-nav-link:nth-child(5)::before {
        background: linear-gradient(180deg, #ef4444, #b91c1c) !important;
    }

    .mobile-nav-link:hover::before {
        transform: scaleY(1) !important;
    }

    /* Stagger animations when drawer opens */
    .mobile-drawer.active .mobile-nav-link:nth-child(1) {
        animation: drawerItemIn .3s ease .10s both !important;
    }

    .mobile-drawer.active .mobile-nav-link:nth-child(2) {
        animation: drawerItemIn .3s ease .17s both !important;
    }

    .mobile-drawer.active .mobile-nav-link:nth-child(3) {
        animation: drawerItemIn .3s ease .24s both !important;
    }

    .mobile-drawer.active .mobile-nav-link:nth-child(4) {
        animation: drawerItemIn .3s ease .31s both !important;
    }

    .mobile-drawer.active .mobile-nav-link:nth-child(5) {
        animation: drawerItemIn .3s ease .38s both !important;
    }

    /* ── BOTTOM ACTIONS ───────────────────────────── */
    .mobile-drawer-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 12px 20px 36px !important;
        background: linear-gradient(to top, #060910 80%, transparent) !important;
        position: relative !important;
        z-index: 2 !important;
        flex-shrink: 0 !important;
    }

    .mobile-drawer.active .mobile-drawer-actions {
        animation: drawerItemIn .35s ease .42s both !important;
    }

    /* Verify Certificate */
    .mobile-cert-btn {
        display: block !important;
        text-align: center !important;
        padding: 9px 16px !important;
        border-radius: 50px !important;
        font-size: 0.78rem !important;
        font-weight: 700 !important;
        font-family: 'Outfit', 'Inter', sans-serif !important;
        color: #00d9ff !important;
        background: rgba(0, 217, 255, .07) !important;
        border: 1px solid rgba(0, 217, 255, .35) !important;
        box-shadow: 0 0 16px rgba(0, 217, 255, .12) !important;
        letter-spacing: 0.5px !important;
        text-decoration: none !important;
        animation: certPulse 3s ease-in-out infinite !important;
        transition: background .2s, box-shadow .2s !important;
    }

    .mobile-cert-btn:hover {
        background: rgba(0, 217, 255, .15) !important;
        box-shadow: 0 0 30px rgba(0, 217, 255, .3) !important;
    }

    /* Login */
    .mobile-login-btn {
        display: block !important;
        text-align: center !important;
        padding: 11px 16px !important;
        border-radius: 12px !important;
        font-size: 0.92rem !important;
        font-weight: 600 !important;
        color: rgba(148, 163, 184, .9) !important;
        background: rgba(255, 255, 255, .04) !important;
        border: 1px solid rgba(255, 255, 255, .14) !important;
        text-decoration: none !important;
        transition: background .2s, color .2s !important;
    }

    .mobile-login-btn:hover {
        color: #fff !important;
        background: rgba(255, 255, 255, .08) !important;
    }

    /* Register */
    .mobile-register-btn {
        display: block !important;
        text-align: center !important;
        padding: 13px 20px !important;
        border-radius: 14px !important;
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        font-family: 'Outfit', 'Inter', sans-serif !important;
        background: linear-gradient(135deg, #00d9ff, #00ff88, #00d9ff) !important;
        background-size: 200% auto !important;
        color: #04080f !important;
        border: none !important;
        box-shadow: 0 0 32px rgba(0, 217, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .25) !important;
        text-decoration: none !important;
        animation: registerShimmer 2.5s linear infinite !important;
        transition: box-shadow .2s, transform .2s !important;
    }

    .mobile-register-btn:hover {
        box-shadow: 0 0 50px rgba(0, 217, 255, .5) !important;
        transform: translateY(-2px) !important;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    .mobile-drawer {
        width: 92vw !important;
        border-radius: 18px 0 0 18px !important;
    }

    .mobile-nav-link {
        padding: 13px 20px !important;
        font-size: 0.95rem !important;
    }
}