.mobile-nav {
    width: 100%;
    background-color: #444;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease-out;
}

.mobile-nav h2{
    color: #ddd;
    text-align: center;
}

.mobile-nav-header{
    padding: 15px 0;
    background-color: #333;
    position: sticky;
    z-index: 3;
    top: 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    flex-direction: column;
}

.nav-menu li a {
    display: block;
    padding: 15px 20px; /* Adjust padding for touch targets */
    color: white; /* Link text color */
    text-decoration: none; /* Remove underline */
    background-color: rgb(68, 68, 68); /* Link background color */
}

/* Dropdown styling */
.mobile-dropdown {
    padding: 0;
    margin: 0;
    max-height: 0; /* Start with the dropdown hidden */
    overflow: hidden; /* Hide overflow */
    transition: max-height 0.2s ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-dropdown li a{
    background-color: #333;
    padding-left: 50px; /* Indent sub links */
}

.dropdown-toggle.active{
    background-color: #3a3a3a;
}

.dropdown-toggle{
    background-color: #444;
    transition: background-color 0.2s ease-in-out;
}

/* Display dropdown when open */
.nav-menu .open > .mobile-dropdown {
    max-height: 500px; /* Adjust based on content size */
    overflow: hidden; /* Keep overflow hidden */
    transition: max-height 0.2s ease-in;
}

.mobile-nav.open {
    max-height: 90vh; /* Adjust based on content size */
    overflow-y: auto; /* Allow scrolling if content exceeds max height */
}



/* Responsive Styles */
@media screen and (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .nav-menu {
        flex-direction: column;
    }
}