/* ==========================================
   MOBILE HAMBURGER MENU - Landing Page
   Modern, animated mobile navigation
   ========================================== */

/* ===== HAMBURGER BUTTON ===== */
.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    position: relative;
}

.hamburger-line {
    width: 32px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: center;
}

/* Hamburger Animation - Active State */
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
}

/* ===== MOBILE BREAKPOINT ===== */
@media (max-width: 768px) {
    /* Remove fixed positioning from navbar */
    .navbar {
        position: relative !important;
        top: auto !important;
    }

    /* Show hamburger on mobile */
    .hamburger {
        display: flex;
    }

    /* Navigation Container */
    .nav-container {
        padding: 1rem 1.5rem;
        position: relative;
    }

    /* Navigation Links - Mobile Menu */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        gap: 0;
        padding: 2rem 0;
        padding-top: 5rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        overflow-y: auto;
        z-index: 999;
    }

    /* Active state - slide in from right */
    .nav-links.active {
        right: 0;
    }

    /* Navigation Link Items */
    .nav-links a {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.05rem;
        border-bottom: 1px solid rgba(45, 90, 160, 0.1);
        transition: all 0.3s ease;
        display: block;
    }

    .nav-links a:hover,
    .nav-links a:focus {
        background: rgba(45, 90, 160, 0.08);
        padding-left: 2.5rem;
        color: var(--primary-color);
    }

    /* Login Button in Mobile Menu */
    .btn-nav-login {
        margin: 1.5rem 2rem 0 2rem;
        width: calc(100% - 4rem);
        text-align: center;
        padding: 0.875rem 1.5rem !important;
        display: block !important;
        border: none;
    }

    .btn-nav-login:hover {
        transform: none; /* Remove desktop hover effect */
        padding-left: 1.5rem !important;
    }

    /* Overlay for background when menu is open */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0);
        pointer-events: none;
        transition: background 0.3s ease;
        z-index: 998;
    }

    body.menu-open::before {
        background: rgba(0, 0, 0, 0.3);
        pointer-events: auto;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    /* Adjust hero section since navbar is no longer fixed */
    .hero {
        padding-top: 80px !important;
    }
}

/* ===== SMALL MOBILE (480px and below) ===== */
@media (max-width: 480px) {
    .nav-links {
        width: 100%;
        right: -100%;
    }

    .nav-links.active {
        right: 0;
    }

    .hamburger {
        width: 28px;
        height: 28px;
    }

    .hamburger-line {
        width: 28px;
        height: 2.5px;
    }

    .nav-container {
        padding: 0.875rem 1rem;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* ===== TABLET LANDSCAPE ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .btn-nav-login {
        padding: 0.45rem 1.25rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (max-width: 768px) {
    /* Focus states for keyboard navigation */
    .hamburger:focus {
        outline: 3px solid rgba(45, 90, 160, 0.5);
        outline-offset: 4px;
        border-radius: 4px;
    }

    .nav-links a:focus {
        outline: 3px solid rgba(45, 90, 160, 0.5);
        outline-offset: -3px;
    }

    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .hamburger-line {
            background-color: #000;
            height: 4px;
        }

        .nav-links {
            background: #fff;
            border-left: 3px solid var(--primary-color);
        }

        .nav-links a {
            border-bottom: 2px solid rgba(0, 0, 0, 0.2);
        }
    }

    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        .nav-links,
        .hamburger-line,
        .nav-links a {
            transition: none !important;
        }
    }
}

/* ===== ANIMATION ENHANCEMENTS ===== */
@media (max-width: 768px) {
    /* Stagger animation for menu items */
    .nav-links.active a {
        animation: slideInRight 0.4s ease forwards;
        opacity: 0;
    }

    .nav-links.active a:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-links.active a:nth-child(2) {
        animation-delay: 0.15s;
    }

    .nav-links.active a:nth-child(3) {
        animation-delay: 0.2s;
    }

    .nav-links.active a:nth-child(4) {
        animation-delay: 0.25s;
    }

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

    /* Pulse effect on hamburger when first loaded */
    .hamburger {
        animation: pulse-once 1s ease 0.5s;
    }

    @keyframes pulse-once {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.1);
        }
    }
}

/* ===== SMOOTH SCROLLING FIX ===== */
@media (max-width: 768px) {
    /* Smooth scroll to sections when clicking nav links */
    html {
        scroll-behavior: smooth;
    }

    /* No scroll offset needed since navbar is not fixed */
    #features,
    #about,
    #contact {
        scroll-margin-top: 20px;
    }
}

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .hamburger {
        width: 44px;
        height: 44px;
        padding: 6px;
    }

    .nav-links a {
        padding: 1.25rem 2rem;
        min-height: 56px;
        display: flex;
        align-items: center;
    }

    .btn-nav-login {
        min-height: 56px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* Prevent accidental clicks during animation */
    .nav-links:not(.active) a {
        pointer-events: none;
    }

    .nav-links.active a {
        pointer-events: auto;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 768px) and (orientation: landscape) {
    .nav-links {
        top: 0;
        height: 100vh;
        padding: 1rem 0;
        padding-top: 4rem;
    }

    .nav-links a {
        padding: 0.75rem 2rem;
    }

    .btn-nav-login {
        margin: 1rem 2rem 0 2rem;
    }
}

/* ===== DARK MODE SUPPORT (Future-ready) ===== */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .nav-links {
        background: rgba(30, 41, 59, 0.98);
    }

    .nav-links a {
        color: rgba(255, 255, 255, 0.9);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .nav-links a:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .hamburger-line {
        background-color: var(--primary-light);
    }
}
