/* Mobile Header and Menu Fixes */

@media (max-width: 768px) {
    /* Header fixes */
    #main-header {
        padding: 15px 0;
        height: 70px;
        display: flex;
        align-items: center;
    }
    
    .header-container {
        width: 100%;
        justify-content: space-between;
        padding: 0 15px;
    }
    
    /* Logo adjustments */
    .logo {
        display: flex;
        align-items: center;
    }
    
    .logo img {
        height: 32px;
        margin-right: 8px;
    }
    
    .logo h1 {
        font-size: 22px;
        margin: 0;
    }
    
    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background-color: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        color: #4f46e5;
        font-size: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-left: 10px;
        z-index: 1001;
    }
    
    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:focus {
        background-color: #4f46e5;
        color: white;
    }
    
    /* Mobile navigation container */
    .nav-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background-color: white;
        padding: 80px 20px 30px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-container.active {
        transform: translateX(0);
    }
    
    /* Overlay for mobile menu */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Navigation list */
    .nav-list {
        flex-direction: column;
        width: 100%;
        margin-bottom: 30px;
    }
    
    .nav-item {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .nav-link {
        padding: 15px 0;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 16px;
        font-weight: 500;
    }
    
    .nav-link i {
        transition: transform 0.3s ease;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        padding: 0 0 10px 15px;
        margin: 0;
        border-radius: 0;
        border-left: 2px solid #e5e7eb;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    
    .nav-item.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-title {
        font-size: 15px;
        margin-top: 10px;
    }
    
    .dropdown-item {
        padding: 10px;
        font-size: 14px;
    }
    
    /* Two-column dropdown fix */
    .two-column-dropdown {
        display: block;
        min-width: auto;
    }
    
    .dropdown-column {
        margin-bottom: 15px;
        min-width: auto;
    }
    
    /* Header actions */
    .header-actions {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
    }
    
    .header-action-btn {
        width: 100%;
        margin: 5px 0;
        padding: 12px;
        text-align: center;
        font-size: 15px;
    }
    
    /* Language selector */
    .language-selector {
        margin: 20px 0 0;
        width: 100%;
    }
    
    .language-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 12px;
    }
    
    .language-dropdown {
        width: 100%;
        left: 0;
        right: auto;
    }
    
    /* Fix for iOS Safari */
    @supports (-webkit-touch-callout: none) {
        .nav-container {
            height: -webkit-fill-available;
        }
    }
}

/* Improved mobile menu animations */
@media (max-width: 768px) {
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    .nav-item.active > .dropdown-menu {
        animation: fadeIn 0.3s forwards;
    }
    
    .nav-item.active > .nav-link i {
        transform: rotate(180deg);
    }
}
