/* ===== Mobile Navigation Fixes ===== */

/* Hide mobile menu auth actions on desktop */
.nav-links .nav-auth-actions {
    display: none !important;
}

/* Hamburger Menu Button - Improved Styling */
.mobile-menu-toggle {
    display: none !important;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 8px;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mobile-menu-toggle:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

/* Active (X) state */
.mobile-menu-toggle.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

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

/* Mobile Navigation Overlay */
@media (max-width: 768px) {
    /* Show hamburger menu on mobile */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Mobile menu container - compact dropdown style */
    .nav-links {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 280px;
        max-height: calc(100vh - 90px);
        background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 1.5rem;
        gap: 0;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        box-shadow: -5px 5px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.2);
        border-radius: 16px 0 0 16px;
        overflow-y: auto;
        margin-right: 1rem;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    /* Navigation links styling */
    .nav-links > a {
        color: rgba(255, 255, 255, 0.9);
        font-size: 1rem;
        padding: 0.75rem 1rem;
        border-radius: 10px;
        margin-bottom: 0.4rem;
        transition: all 0.3s ease;
        border: 1px solid transparent;
        text-align: left;
        width: 100%;
        display: block;
    }
    
    /* Add extra space after the last navigation link */
    .nav-links > a:last-of-type {
        margin-bottom: 1rem;
    }
    
    .nav-links > a:hover,
    .nav-links > a.active {
        background: rgba(139, 92, 246, 0.15);
        border-color: rgba(139, 92, 246, 0.3);
        color: white;
        transform: translateX(5px);
    }
    
    /* Move auth actions into mobile menu */
    .navbar > .nav-auth-actions {
        display: none !important;
    }
    
    /* Show auth actions inside nav-links on mobile */
    .nav-links .nav-auth-actions {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding: 1.25rem 0 0 !important;
        border-top: 1px solid rgba(139, 92, 246, 0.2);
    }
    
    .nav-links .nav-auth-actions a,
    .nav-links .nav-auth-actions .nav-cta {
        width: 100% !important;
        justify-content: flex-start !important;
        border-radius: 10px !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.65rem !important;
        background: rgba(139, 92, 246, 0.1) !important;
        border: 1px solid rgba(139, 92, 246, 0.2) !important;
        color: white !important;
        transition: all 0.3s ease;
    }
    
    .nav-links .nav-auth-actions a:hover {
        background: rgba(139, 92, 246, 0.2) !important;
        border-color: rgba(139, 92, 246, 0.4) !important;
        transform: translateX(5px);
    }
    
    .nav-links .nav-auth-actions .nav-cta {
        background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
        border-color: transparent !important;
    }
    
    .nav-links .nav-auth-actions .nav-cta:hover {
        background: linear-gradient(135deg, #9333ea 0%, #7c3aed 100%) !important;
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    }
    
    .nav-links .nav-auth-actions a i {
        font-size: 1rem;
    }
    
    .nav-links .nav-auth-actions a span {
        font-weight: 600;
        font-size: 0.95rem;
    }
    
    /* Hide text labels in desktop auth actions */
    .navbar > .nav-auth-actions a span {
        display: none !important;
    }
    
    .navbar > .nav-auth-actions .nav-cta span {
        display: inline !important;
    }
    
    /* Backdrop overlay - lighter for dropdown style */
    .nav-links.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    /* Header adjustments for mobile */
    .header {
        padding: 0.75rem 0;
    }
    
    .navbar {
        grid-template-columns: 1fr auto;
        gap: 1rem;
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 1.5rem;
        grid-column: 1;
    }
    
    .mobile-menu-toggle {
        grid-column: 2;
        justify-self: end;
    }
    
    /* Hide nav-links and nav-auth-actions from navbar on mobile */
    .navbar > .nav-links,
    .navbar > .nav-auth-actions {
        display: none;
    }
}

/* Tablet adjustments */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-links {
        gap: 1.5rem;
    }
    
    .nav-links a {
        font-size: 0.95rem;
    }
}

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

/* Smooth scrolling for mobile menu links */
.nav-links a {
    scroll-behavior: smooth;
}
