/* Mobile Menu Enhanced Styles */

/* Hide mobile elements on desktop */
@media (min-width: 992px) {
    .mobile-menu-toggle,
    .mobile-header-only,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Mobile toggle button styling */
.mobile-menu-toggle {
    background: none !important;
    border: none !important;
    font-size: 1.8rem !important;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px;
    color: #001f54;
    transition: all 0.3s ease;
    z-index: 1001;
    width: 50px;
    height: 50px;
    border-radius: 5px;
}

.mobile-menu-toggle:hover {
    background: rgba(245, 166, 35, 0.1) !important;
    color: #f5a623;
}

.mobile-menu-toggle i {
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

/* Header solid state mobile toggle */
.custom-header.solid .mobile-menu-toggle {
    color: #001f54;
}

.custom-header.solid .mobile-menu-toggle:hover {
    background: rgba(245, 166, 35, 0.1) !important;
    color: #f5a623;
}

/* Mobile menu container */
.mobile-header-only {
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, #001f54 0%, #003d82 100%);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    display: none; /* Hidden by default */
}

/* Only show mobile menu on mobile devices */
@media (max-width: 991.98px) {
    .mobile-header-only {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
}

/* Ensure mobile elements are hidden on desktop */
@media (min-width: 992px) {
    .mobile-menu-toggle,
    .mobile-header-only,
    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

.mobile-header-only.open {
    right: 0;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none; /* Hidden by default */
}

/* Only show overlay on mobile devices */
@media (max-width: 991.98px) {
    .mobile-menu-overlay {
        display: block;
    }
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile menu header */
.mobile-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.mobile-logo {
    height: 40px;
    width: auto;
}

.close-button {
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f5a623;
    transform: rotate(90deg);
}

/* Mobile navigation */
.mobile-header-only nav {
    padding: 0;
}

.mobile-header-only nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-header-only nav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-header-only nav ul li:last-child {
    border-bottom: none;
}

.mobile-header-only nav ul li a {
    display: block;
    padding: 18px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-header-only nav ul li a:hover {
    background: rgba(245, 166, 35, 0.2);
    color: #f5a623;
    padding-left: 30px;
}

.mobile-header-only nav ul li a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #f5a623;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.mobile-header-only nav ul li a:hover:before {
    transform: scaleY(1);
}

/* Mobile language switcher enhanced */
.mobile-lang-switcher {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
}

.mobile-lang-switcher .nav-item.dropdown {
    position: relative;
}

.mobile-lang-switcher .nav-link.dropdown-toggle {
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 0;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    transition: color 0.3s ease;
}

.mobile-lang-switcher .nav-link.dropdown-toggle:hover,
.mobile-lang-switcher .nav-link.dropdown-toggle:focus {
    color: #f5a623 !important;
}

.mobile-lang-switcher .nav-link.dropdown-toggle i {
    margin-right: 10px;
    font-size: 18px;
}

.mobile-lang-switcher .dropdown-menu {
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    margin-top: 8px;
    padding: 8px 0;
}

.mobile-lang-switcher .dropdown-item {
    color: #333;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    display: block;
    width: 100%;
    background-color: transparent;
    border: 0;
    transition: all 0.3s ease;
}

.mobile-lang-switcher .dropdown-item:hover,
.mobile-lang-switcher .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #f5a623;
}

/* Responsive improvements */
@media (max-width: 576px) {
    .mobile-header-only {
        width: 280px;
    }
    
    .mobile-header-only nav ul li a {
        font-size: 15px;
        padding: 16px 18px;
    }
    
    .mobile-menu-toggle {
        font-size: 1.6rem !important;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .mobile-header-only {
        width: 260px;
    }
}

/* Animation for mobile toggle icon */
.mobile-menu-toggle.active i {
    transform: rotate(90deg);
}

/* Smooth scrolling for mobile */
@media (max-width: 991px) {
    html {
        scroll-behavior: smooth;
    }
}

/* Fix for iOS Safari */
@supports (-webkit-touch-callout: none) {
    .mobile-header-only {
        -webkit-overflow-scrolling: touch;
    }
}
