/* Dropdown Menu Styles for Departments */

.nav-menu {
    /* Existing styles */
    position: relative; /* Needed for absolute positioning of dropdown */
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    /* Add transition for smooth mobile display */
    transition: max-height 0.3s ease-out;
    position: absolute;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    z-index: 1001;
    padding: var(--spacing-xs) 0;
    border-radius: var(--radius-sm);
    top: 100%; /* Position below the main menu item */
    left: 0;
    margin-top: 5px; /* Small gap */
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    text-align: left;
    white-space: nowrap;
    font-weight: 400;
}

.dropdown-content a:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

/* Ensure the main menu item is styled correctly */
.dropdown > a {
    /* Inherit main menu item styling */
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

/* Mobile Menu Adjustments */
@media (max-width: 768px) {
    .dropdown-content {
        position: static; /* Dropdown content flows naturally in mobile menu */
        box-shadow: none;
        min-width: 100%;
        padding: 0;
        margin-top: 0;
        border-radius: 0;
        /* Mobile fix: initially hide, will be toggled by JS */
        display: none;
        max-height: 0;
        overflow: hidden;
    }
    
    /* The mobile menu toggle is handled by JS, which will add a class to the parent <li> */
    .dropdown.active .dropdown-content {
        display: block;
        max-height: 500px; /* Sufficiently large value for smooth transition */
    }

    .dropdown-content a {
        padding-left: var(--spacing-lg); /* Indent for clarity */
    }
}
