/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none; /* Initially hidden */
    background-color: transparent;
    color: black;
    font-size: 30px;
    padding: 15px;
    border: none;
    cursor: pointer;
    position: fixed;
    right: 20px;
    z-index: 9999;
}



/* Show the toggle button for mobile */
@media (max-width: 1024px) {
    .menu-toggle {
        display: block; /* Make the toggle button visible on mobile */
    }
    .nav-bar .nav-logo {
        display: block; /* Display logo on mobile */
        margin-bottom: 10px; /* Reduce gap between logo and menu items */
    }

    /* Hide the close icon by default */
    .close-icon {
        display: none;
    }

    /* Show close icon when the menu is active */
    .menu-toggle.active .hamburger-icon {
        display: none; /* Hide hamburger icon when active */
    }

    .menu-toggle.active .close-icon {
        display: block; /* Show close icon when active */
    }






    /* Navigation Bar (Initially hidden on mobile) */
 /* Navigation Bar (Initially hidden on mobile) */
.nav-bar {
    display: none; /* Initially hidden */
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh; /* Changed from 85% to 100vh for full viewport height */
    max-height: 100vh; /* Ensure it doesn't exceed viewport */
    background-color: #00509e;
    z-index: 9998;
    padding-top: 80px;
    transition: transform 0.3s ease;
    border-radius: 50px 0 0 50px; /* Only left side rounded for better UX */
    overflow-y: auto; /* Add scrolling if content exceeds height */
}

    /* Show the navigation when the menu is active */
    .nav-bar.active {
        display: block;
        transform: translateX(0);
        border-radius: 50px 50px 50px 50px; /* Add rounded borders to the menu */
    }

    /* Add an overlay effect when the menu is open */
    .nav-bar.active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

    /* Menu links */

.nav-links {
    padding: 30px 20px; /* Reduced padding for better space utilization */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from 'normal' to proper value */
    height: auto; /* Changed from 100% to auto */
    overflow-y: auto; /* Allow scrolling within nav-links */
}


    .nav-bar a {
        color: white;
        text-decoration: none;
        padding: 15px;
        font-size: 18px;
        text-align: center;
        border-bottom: 1px solid #ddd;
        width: 100%;
    }

    /* Hover effect for links in the menu */
    .nav-bar a:hover {
        background-color: #003f73;
    }

    /* ============================================
       Tools Dropdown for Mobile - FIXED VERSION
       ============================================ */

    /* Dropdown container - full width block */
    .nav-bar .nav-dropdown {
        width: 100% !important;
        display: block !important;
        text-align: center;
        position: relative !important;
        box-sizing: border-box;
    }

    /* Dropdown button styling */
    .nav-bar .nav-dropdown-btn {
        color: white !important;
        background: transparent !important;
        border: none !important;
        font-size: 18px;
        cursor: pointer;
        padding: 15px;
        width: 100% !important;
        border-bottom: 1px solid rgba(255,255,255,0.2) !important;
        font-family: inherit;
        display: block !important;
        text-align: center;
        box-sizing: border-box;
    }

    .nav-bar .nav-dropdown-btn::after {
        content: ' ▼';
        font-size: 10px;
        transition: transform 0.3s ease;
    }

    /* Rotate arrow when open */
    .nav-bar .nav-dropdown.active .nav-dropdown-btn::after,
    .nav-bar .nav-dropdown.open .nav-dropdown-btn::after {
        content: ' ▲';
    }

    .nav-bar .nav-dropdown-btn:hover,
    .nav-bar .nav-dropdown-btn:focus {
        background-color: #003f73 !important;
    }

    /* Dropdown content - hidden by default */
    .nav-bar .nav-dropdown-content {
        position: static !important;
        display: none;
        visibility: hidden;
        opacity: 0;
        background-color: #002850 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease;
    }

    /* Show dropdown when active/open - THIS IS THE KEY FIX */
    .nav-bar .nav-dropdown.active .nav-dropdown-content,
    .nav-bar .nav-dropdown.open .nav-dropdown-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-height: 500px !important;
    }

    /* IMPORTANT: Disable hover behavior on mobile to prevent conflicts */
    .nav-bar .nav-dropdown:hover > .nav-dropdown-content {
        display: none;
        visibility: hidden;
        opacity: 0;
        max-height: 0;
    }

    /* But ALWAYS show when active/open class is present (overrides hover) */
    .nav-bar .nav-dropdown.active > .nav-dropdown-content,
    .nav-bar .nav-dropdown.open > .nav-dropdown-content {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-height: 500px !important;
    }

    /* Dropdown links - block display, full width, stacked vertically */
    .nav-bar .nav-dropdown-content a {
        color: white !important;
        background-color: #002850 !important;
        border-bottom: 1px solid #003f73 !important;
        padding: 15px 20px !important;
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        box-sizing: border-box !important;
        float: none !important;
        clear: both !important;
        white-space: normal !important;
        line-height: 1.4 !important;
    }

    .nav-bar .nav-dropdown-content a:hover,
    .nav-bar .nav-dropdown-content a:focus {
        background-color: #001f3f !important;
        color: white !important;
    }

    /* Show mobile menu when toggle button is active */
    .menu-toggle.active + .nav-bar {
        display: block;
        transform: translateX(0);
    }

    /* Mobile Styles */
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        display: none; /* Hide sidebar on mobile */
    }

    .content-footer-container {
        width: 100%;
        flex-direction: column;
    }

    .content {
        margin: 10px;
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
        padding: 20px;
    }

    .footer {
        margin-top: 10px;
        margin-left: 10px;
        margin-right: 10px;
    }
}
