/* Enhanced Header Styles for Better Responsiveness */

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gradient-text {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: all 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active::after {
    width: 100%;
}

/* Mobile Menu Enhancements - CRITICAL FIXES */
#mobile-menu {
    transition: all 0.3s ease-out;
    max-height: calc(100vh - 96px); /* Account for header height */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Use hidden class instead of display none */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    /* Remove display: none - let Tailwind's hidden class handle it */
}

/* When mobile menu is shown */
#mobile-menu:not(.hidden) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Mobile menu scrollbar styling */
#mobile-menu::-webkit-scrollbar {
    width: 4px;
}

#mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

#mobile-menu::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.3);
    border-radius: 2px;
}

/* Mobile Menu Button Enhancements */
#mobile-menu-button {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Ensure proper touch target */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobile-menu-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

#mobile-menu-button:hover::before {
    width: 100%;
    height: 100%;
}

/* Icon transitions for mobile menu button */
#mobile-menu-button i {
    transition: all 0.3s ease;
}

/* Navigation Scroll Effect */
nav {
    transition: transform 0.3s ease;
}

/* Responsive Enhancements */
@media (max-width: 1023px) {
    /* Ensure mobile menu is properly positioned */
    #mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 40;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        /* Let Tailwind's hidden class handle display */
    }
    
    #mobile-menu:not(.hidden) {
        display: block !important;
    }
    
    /* Improve mobile menu button touch target */
    #mobile-menu-button {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Ensure mobile menu links are clickable */
    #mobile-menu a {
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Better touch feedback */
    #mobile-menu a:active {
        background-color: rgba(59, 130, 246, 0.1);
    }
}

@media (max-width: 768px) {
    /* Adjust header height for mobile */
    nav .max-w-7xl .flex {
        height: 80px;
    }
    
    /* Smaller logo on mobile */
    nav .w-16.h-16 {
        width: 48px;
        height: 48px;
    }
    
    nav .text-2xl {
        font-size: 1.25rem;
    }
    
    /* Better mobile menu spacing */
    #mobile-menu .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #mobile-menu .py-6 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    /* Ensure mobile menu is visible when not hidden */
    #mobile-menu:not(.hidden) {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

@media (max-width: 480px) {
    /* Extra small device adjustments */
    nav .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    nav .text-2xl {
        font-size: 1.125rem;
    }
    
    nav .text-xs {
        font-size: 0.625rem;
    }
    
    /* Ensure mobile menu works on very small screens */
    #mobile-menu {
        max-height: calc(100vh - 80px);
    }
}

/* Animation Classes */
.animate-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
body:not(.loaded) {
    overflow: hidden;
}

/* Focus States for Accessibility */
#mobile-menu-button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

#mobile-menu a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    nav {
        border-bottom: 2px solid #000;
    }
    
    #mobile-menu {
        border-top: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    nav,
    #mobile-menu,
    #mobile-menu-button,
    .nav-link {
        transition: none;
    }
    
    #mobile-menu {
        animation: none;
    }
}

/* Debug styles - remove in production */
.mobile-menu-debug {
    border: 2px solid red !important;
}

.mobile-menu-debug * {
    border: 1px solid blue !important;
} 