/**
 * MOBILE MENU OVERLAY FIX - January 2026
 * 
 * Problem: Mobile menu invisible (white on white), hamburger inside header
 * Solution: Move hamburger outside, create full-overlay menu with blue background
 * 
 * Features:
 * - Hamburger fixed to top-right, outside header
 * - Menu overlays entire screen with blue gradient
 * - Smooth slide-in animation
 * - Collapsible (closes when clicked)
 * - White text on blue background (high contrast)
 */

/* ============================================
   MOBILE ONLY - Max Width 768px
   ============================================ */

@media (max-width: 768px) {
    
    /* 0. HIDE ENTIRE NAVBAR on mobile - looks cleaner without white bar */
    .navbar {
        display: none !important;
    }
    
    /* 1. HAMBURGER BUTTON - Fixed over hero section (no navbar) */
    .mobile-menu-toggle {
        position: fixed !important;
        top: 80px !important; /* Below header (header is ~60-70px) */
        right: 20px !important;
        z-index: 10001 !important; /* Above everything */
        background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%) !important;
        border: none !important;
        border-radius: 12px !important;
        padding: 14px !important;
        width: 56px !important;
        height: 56px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-around !important;
        align-items: center !important;
        cursor: pointer !important;
        box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4) !important;
        transition: all 0.3s ease !important;
    }

    .mobile-menu-toggle:hover {
        transform: scale(1.05) !important;
        box-shadow: 0 6px 16px rgba(14, 165, 233, 0.4) !important;
    }

    /* Hamburger lines */
    .mobile-menu-toggle span {
        width: 26px !important;
        height: 3px !important;
        background: white !important;
        border-radius: 2px !important;
        transition: all 0.3s ease !important;
        display: block !important;
    }

    /* Hamburger animation when active */
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px) !important;
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0 !important;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px) !important;
    }

    /* 2. NAVIGATION LINKS - Full screen overlay starting below header */
    .nav-links {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1.5rem !important;
        padding: 6rem 2rem 2rem 2rem !important; /* Extra top padding to clear header */
        z-index: 10000 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateX(100%) !important; /* Slide in from right */
        transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Menu visible state - slide in from right */
    .nav-links.active {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(0) !important;
    }

    /* 3. MENU LINKS STYLING */
    .nav-links a {
        color: white !important;
        font-size: 1.3rem !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        padding: 0.9rem 1.8rem !important;
        border-radius: 12px !important;
        transition: all 0.3s ease !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 280px !important;
        background: rgba(255, 255, 255, 0.15) !important;
        backdrop-filter: blur(10px) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }

    .nav-links a:hover,
    .nav-links a:active {
        background: rgba(255, 255, 255, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.4) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
    }

    /* Sign Up button special styling */
    .nav-links .btn-primary {
        background: white !important;
        color: #0ea5e9 !important;
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        padding: 1.2rem 2.5rem !important;
        margin-top: 1rem !important;
        border: 3px solid white !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    }

    .nav-links .btn-primary:hover {
        background: #f0f9ff !important;
        color: #0284c7 !important;
        transform: translateY(-4px) scale(1.05) !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important;
    }

    /* 4. PREVENT BODY SCROLL when menu is open */
    body.menu-open {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    /* 5. HIDE NAVBAR BACKGROUND when menu is open */
    .navbar {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px) !important;
    }

    body.menu-open .navbar {
        background: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }

    /* 6. STAGGERED ANIMATION for menu items - slide from right */
    .nav-links.active a:nth-child(1) { animation: slideInFromRight 0.4s ease 0.1s both; }
    .nav-links.active a:nth-child(2) { animation: slideInFromRight 0.4s ease 0.2s both; }
    .nav-links.active a:nth-child(3) { animation: slideInFromRight 0.4s ease 0.3s both; }
    .nav-links.active a:nth-child(4) { animation: slideInFromRight 0.4s ease 0.4s both; }
    .nav-links.active a:nth-child(5) { animation: slideInFromRight 0.4s ease 0.5s both; }
    .nav-links.active a:nth-child(6) { animation: slideInFromRight 0.4s ease 0.6s both; }

    @keyframes slideInFromRight {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* 7. LOGO - Keep visible in menu */
    .logo-container {
        position: relative !important;
        z-index: 9999 !important;
    }

    /* 8. ACCESSIBILITY - Focus states */
    .mobile-menu-toggle:focus {
        outline: 3px solid white !important;
        outline-offset: 3px !important;
    }

    .nav-links a:focus {
        outline: 3px solid white !important;
        outline-offset: 2px !important;
    }

}

/* ============================================
   DESKTOP - Keep normal behavior
   ============================================ */

@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .nav-links {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        position: static !important;
        flex-direction: row !important;
        background: none !important;
        height: auto !important;
    }
}
