/* ==========================================
   Mobile Menu Styles - Enhanced & Responsive
   ========================================== */

/* Mobile Menu Button (Hamburger Icon) */
.menu-link {
    display: none; /* Hidden on desktop */
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

    .menu-link i {
        font-size: 20px;
        color: #333;
        transition: all 0.3s ease;
    }

    /* Change icon to X when menu is active */
    .menu-link.active i:before {
        content: "\f00d"; /* Font Awesome X icon */
    }

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100vh;
}

/* Hide mobile menu header on desktop */
.mobile-menu-header {
    display: none;
}

/* Hide any existing mmenu close buttons that might conflict */
#menu .mm-close,
#menu .close,
.main-nav > .close,
.main-nav > a.close {
    display: none !important;
}

/* ==========================================
   Mobile Responsive Styles
   ========================================== */

@media (max-width: 991px) {
    /* Show hamburger button on mobile */
    .menu-link {
        display: flex;
    }

    /* Mobile Navigation Panel */
    .main-nav {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important; /* Off-screen by default */
        left: auto !important; /* Explicitly unset left */
        max-width: 85%;
        height: 100vh !important; /* Full viewport height */
        min-height: 100vh !important; /* Ensure minimum full height */
        max-height: 100vh !important; /* Prevent overflow */
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
        z-index: 10000;
        overflow-y: hidden !important; /* Hide overflow on parent */
        overflow-x: hidden;
        padding: 0 !important; /* Remove padding, we'll add it to children */
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        margin: 0 !important; /* Remove any margins */
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important; /* Align content to top */
    }

        /* Slide in when active */
        .main-nav.active {
            right: 0 !important;
            left: auto !important; /* Explicitly unset left */
            height: 100vh !important; /* Maintain full height when active */
            max-height: 100vh !important; /* Prevent overflow */
            background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
        }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    /* Mobile Menu Header */
    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px; /* Reduced from 20px */
        background: linear-gradient(135deg, #8DC6D8 0%, #76b0c6 100%);
        border-bottom: 3px solid rgba(255, 255, 255, 0.2);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        flex-shrink: 0; /* Don't shrink */
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .mobile-menu-logo {
        display: flex;
        align-items: center;
        gap: 10px; /* Reduced from 12px */
        flex: 1;
    }

        .mobile-menu-logo img {
            width: 45px; /* Reduced from 50px */
            height: 45px; /* Reduced from 50px */
            object-fit: contain;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
        }

    .mobile-menu-brand {
        display: flex;
        flex-direction: column;
        gap: 1px; /* Reduced from 2px */
    }

    .brand-name {
        font-size: 16px; /* Reduced from 18px */
        font-weight: 700;
        color: #ffffff;
        letter-spacing: -0.5px;
        line-height: 1.1; /* Tighter line height */
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

        .brand-name em {
            font-style: normal;
            font-weight: 800;
        }

    .brand-tagline {
        font-size: 10px; /* Reduced from 11px */
        font-weight: 500;
        color: rgba(255, 255, 255, 0.9);
        letter-spacing: 0.3px; /* Reduced from 0.5px */
        text-transform: uppercase;
    }

    .mobile-menu-close {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        width: 36px; /* Reduced from 40px */
        height: 36px; /* Reduced from 40px */
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        flex-shrink: 0;
    }

        .mobile-menu-close i {
            font-size: 16px; /* Reduced from 18px */
            color: #ffffff;
            transition: transform 0.3s ease;
        }

        .mobile-menu-close:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.5);
            transform: scale(1.05);
        }

            .mobile-menu-close:hover i {
                transform: rotate(90deg);
            }

        .mobile-menu-close:active {
            transform: scale(0.95);
        }

    /* Mobile Menu Items */
    .main-menu {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        flex: 1 1 auto; /* Allow menu to grow and fill available space */
        min-height: 0 !important; /* Allow flexbox to work properly */
        padding-top: 5px; /* Reduced top spacing */
        padding-bottom: 5px; /* Reduced bottom spacing */
        overflow-y: auto; /* Allow scrolling within menu if needed */
        margin: 0; /* Remove any margins */
        background: transparent !important; /* Transparent to show parent background */
        justify-content: space-evenly; /* Distribute items evenly */
    }

        .main-menu > li {
            display: block;
            width: 100%;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            flex-shrink: 0; /* Prevent items from shrinking */
        }

            .main-menu > li > a {
                display: block;
                padding: 12px 25px; /* Reduced padding for more compact layout */
                color: #333;
                font-size: 15px; /* Slightly smaller font */
                font-weight: 500;
                position: relative;
                transition: all 0.3s ease;
            }

                /* Left accent bar on hover */
                .main-menu > li > a::before {
                    content: '';
                    position: absolute;
                    left: 0;
                    top: 0;
                    bottom: 0;
                    width: 0;
                    background: linear-gradient(180deg, #8DC6D8, #65a3d9);
                    transition: width 0.3s ease;
                }

                .main-menu > li > a:hover {
                    background: rgba(141, 198, 216, 0.1);
                    padding-left: 30px; /* Reduced hover padding */
                }

                    .main-menu > li > a:hover::before {
                        width: 4px;
                    }

            /* Active menu item */
            .main-menu > li.active > a {
                background: rgba(141, 198, 216, 0.15);
                color: #8DC6D8;
                font-weight: 600;
            }

                .main-menu > li.active > a::before {
                    width: 4px;
                }

        /* Submenu Styles */
        .main-menu .sub-menu {
            display: none;
            background: rgba(0, 0, 0, 0.02);
            border-left: 3px solid #8DC6D8;
            margin-left: 10px; /* Reduced margin */
        }

        .main-menu > li.active .sub-menu {
            display: block;
            animation: slideDown 0.3s ease;
        }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .main-menu .sub-menu li {
        display: block;
    }

        .main-menu .sub-menu li a {
            display: block;
            padding: 10px 25px; /* Reduced submenu padding */
            color: #666;
            font-size: 13px; /* Smaller submenu font */
            transition: all 0.3s ease;
        }

            .main-menu .sub-menu li a:hover {
                background: rgba(141, 198, 216, 0.1);
                color: #8DC6D8;
                padding-left: 35px; /* Reduced hover padding */
            }

    /* Submenu arrow indicator */
    .main-menu > li.has-submenu > a::after {
        content: '\f107'; /* Font Awesome down arrow */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        position: absolute;
        right: 15px; /* Adjusted position */
        transition: transform 0.3s ease;
        font-size: 12px; /* Smaller arrow */
    }

    .main-menu > li.has-submenu.active > a::after {
        transform: rotate(180deg);
    }

    /* Add spacer to fill remaining space */
    .main-menu::after {
        content: '';
        flex: 0 0 auto; /* Don't grow the spacer */
        min-height: 5px; /* Minimal spacing */
        background: transparent;
    }

    /* Language selector in mobile menu */
    .nav-language-selector {
        border-left: none;
        padding-left: 0;
        margin-left: 0;
        margin-top: 0 !important; /* Remove auto margin */
        padding-top: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        flex-shrink: 0; /* Don't shrink */
        background: rgba(141, 198, 216, 0.05); /* Light background to distinguish it */
    }

        .nav-language-selector::before {
            display: none;
        }

    .language-selector {
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 10px; /* Reduced from 15px */
    }

    /* Make language dropdown more compact */
    .nav-language-selector .language-dropdown-toggle {
        padding: 8px 15px; /* Compact padding */
        font-size: 14px; /* Smaller font */
    }

    .nav-language-selector .flag-icon img {
        width: 18px; /* Smaller flag */
        height: 18px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .main-nav {
        width: 100%;
        max-width: 100%;
        height: 100vh !important; /* Maintain full height on small devices */
        min-height: 100vh !important;
    }

    .menu-link {
        width: 36px;
        height: 36px;
    }

        .menu-link i {
            font-size: 18px;
        }

    /* Even more compact on small screens */
    .mobile-menu-header {
        padding: 12px;
    }

    .mobile-menu-logo img {
        width: 40px;
        height: 40px;
    }

    .brand-name {
        font-size: 15px;
    }

    .brand-tagline {
        font-size: 9px;
    }

    .main-menu > li > a {
        padding: 10px 20px; /* Further reduced */
        font-size: 14px; /* Smaller font */
    }

    .main-menu .sub-menu li a {
        padding: 8px 20px; /* Further reduced */
        font-size: 12px; /* Smaller font */
    }

    .language-selector {
        padding: 8px;
    }

    .nav-language-selector .language-dropdown-toggle {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .main-nav {
        width: 350px;
        height: 100vh !important; /* Maintain full height on tablets */
        min-height: 100vh !important;
    }
}

/* Custom scrollbar for mobile menu */
.main-nav::-webkit-scrollbar {
    width: 0px; /* Changed from 6px to 0px to hide scrollbar */
    display: none; /* Explicitly hide scrollbar */
}

.main-nav::-webkit-scrollbar-track {
    background: transparent; /* Changed to transparent */
}

.main-nav::-webkit-scrollbar-thumb {
    background: transparent; /* Changed to transparent */
 border-radius: 3px;
}

    .main-nav::-webkit-scrollbar-thumb:hover {
        background: transparent; /* Changed to transparent */
    }

/* Hide scrollbar for Firefox */
.main-nav {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Also hide scrollbar for main-menu */
.main-menu::-webkit-scrollbar {
    width: 0px;
    display: none;
}

.main-menu {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
