/* Navbar dropdown submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -6px;
    margin-left: 0;
    border-radius: 0 6px 6px 6px;
    display: none;
    min-width: 120px;
    padding: 0.2rem 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Dropdown item styling */
.dropdown-item {
    padding: 0.2rem 1rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease-in-out;
}

/* Dropdown header styling */
.dropdown-header {
    padding: 0.5rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Only show submenu when hovering over the specific dropdown-submenu */
.dropdown-menu .dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

/* Add right arrow for dropdown toggles */
.dropdown-submenu > .dropdown-toggle::after {
    display: inline-block;
    margin-left: 1rem;
    vertical-align: middle;
    content: "";
    border-top: 0.3em solid transparent;
    border-right: 0;
    border-bottom: 0.3em solid transparent;
    border-left: 0.3em solid;
    float: right;
    margin-top: 0.25em;
    margin-right: 0px;
    transition: transform 0.2s ease-in-out;
}

/* Hover effect for dropdown items */
.dropdown-item:hover, .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #16181b;
    text-decoration: none;
}

/* Active/focus states */
.dropdown-item:active, .dropdown-item.active {
    background-color: #e9ecef;
    color: #16181b;
}

/* Adjust dropdown menu position */
.dropdown-menu {
    margin: 0;
}

/* Only show direct child dropdown menus on hover */
.dropdown > .dropdown-menu {
    display: none  ;
}

.dropdown:hover > .dropdown-menu {
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 991.98px) {
    .dropdown-submenu > .dropdown-menu {
        position: static;
        margin: 0 0 0 1rem;
        border-left: 1px solid rgba(0, 0, 0, 0.15);
        border-radius: 0;
    }
    
    .dropdown-submenu > .dropdown-toggle::after {
        transform: rotate(0deg);
        transition: transform 0.2s ease-in-out;
    }
    
    .dropdown-submenu.show > .dropdown-toggle::after {
        transform: rotate(180deg);
    }
    
    .dropdown-submenu.show > .dropdown-menu,
    .dropdown.show > .dropdown-menu {
        display: block;
    }
}
