/* Custom styles for header */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80%;
    max-width: 300px;
    background: white;
    z-index: 50;
    padding: 1rem;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(-100%); /* Initially off-screen */
    transition: transform 0.3s ease-in-out; /* Animation for sliding */
}

.mobile-menu.active {
    transform: translateX(0); /* On-screen position */
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; /* Animation for fade */
}

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

/* Google Translate Custom Styles */
.translate_tool {
    position: relative;
    display: inline-block;
}

.translate_tool .goog-te-gadget {
    white-space: nowrap !important;
    font-size: 14px !important;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block !important;
    vertical-align: middle !important;
}

.translate_tool .goog-te-gadget .goog-te-combo {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    font-size: 14px !important;
    color: #1a202c !important;
    cursor: pointer !important;
}

.translate_tool .goog-te-gadget .goog-te-combo option {
    font-size: 14px !important;
    color: #1a202c !important;
}

.translate_tool .goog-te-banner-frame {
    display: none !important;
}

.translate_tool .goog-te-menu-value {
    padding-right: 0 !important;
}

.translate_tool .goog-te-menu-value img {
    display: none !important;
}

.translate_tool .goog-te-menu-value span:first-child {
    display: none !important;
}

.translate_tool .goog-te-menu-value span:last-child {
    display: none !important;
}

/* Desktop styles */
@media (min-width: 768px) {
    .desktop-menu {
        display: flex;
    }
    
    .mobile-menu-trigger {
        display: none;
    }

    .mobile-menu {
        display: none !important;
    }

    .menu-overlay {
        display: none !important;
    }

    /* Submenu container styles */
    .submenu-container {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
        max-height: 80vh;
        overflow-y: auto;
        background: #f3f4f6;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        z-index: 50;
        display: none;
    }

    .group:hover .submenu-container {
        display: block;
    }

    /* Submenu scrollbar styles */
    .submenu-container::-webkit-scrollbar {
        width: 6px;
    }

    .submenu-container::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .submenu-container::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }

    .submenu-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* Mobile styles */
@media (max-width: 767px) {
    .desktop-menu {
        display: none;
    }
    
    .mobile-menu-trigger {
        display: block;
    }
    
    /* .mobile-menu {
        display: block !important; 
    } */ /* This remains commented out. Visibility is handled by JS toggling Tailwind's hidden and then the .active class for animation. */
    
    /* Remove white background and reduce padding from top header on mobile */
    header.bg-white {
        background: transparent !important;
        box-shadow: none !important;
    }
    header .container.mx-auto.px-4.py-1 {
        padding-left: 0 !important;
        padding-right: 0 !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    /* Ensure blue bar is visible and separated from header */
    .bg-blue-600 {
        display: block !important;
        margin-top: 0.5rem !important;
        z-index: 30 !important;
        position: relative !important;
        min-height: 40px !important;
    }
}

/* Submenu styles */
.submenu-item {
    transition: color 0.2s ease;
    white-space: nowrap;
    color: #374151;
}

.submenu-item:hover {
    color: #2563eb;
    background-color: transparent;
}

/* Main menu hover effect */
.main-menu-item {
    transition: background-color 0.2s ease;
}

.main-menu-item:hover {
    background-color: #1e40af;
}

/* Styles for multi-level mobile menu */
.mobile-menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem; /* Tailwind equivalent p-4 */
    border-bottom-width: 1px; /* Tailwind equivalent border-b */
    text-decoration: none;
    color: inherit;
}

.mobile-menu-item i {
    margin-right: 0.75rem; /* Add spacing between icon and text */
}

.mobile-menu-item .menu-text {
    text-align: left; /* Ensure text is left-aligned */
    flex: 1; /* Allow text to take available space */
    margin-right: 1rem; /* Add space between text and arrow */
}

.mobile-menu-arrow {
    margin-left: auto; /* Push arrow to the right */
}

.mobile-menu-item:hover {
    background-color: #f3f4f6; /* Tailwind bg-gray-100 */
}

.mobile-menu-arrow {
    font-size: 1.25rem; /* Tailwind text-xl */
    color: #9ca3af; /* Tailwind text-gray-400 */
}

#subMenuView .mobile-menu-item:hover {
    background-color: #e5e7eb; /* Tailwind bg-gray-200 for submenu hover */
}

#backToMainMenu {
    background: none;
    border: none;
    padding: 0;
    color: #374151; /* Tailwind text-gray-700 */
    cursor: pointer;
}

#backToMainMenu:hover {
    color: #1f2937; /* Tailwind text-gray-800 */
}

/* Ensure the main menu list and sub menu list take full height if needed */
#mainMenuList, #subMenuList {
    max-height: calc(100vh - 100px); /* Adjust 100px based on header/footer height within menu */
    overflow-y: auto;
} 