/* Nested Dropdown Styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-top: 0;
    display: none;
    min-width: 200px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
    z-index: 1001;
}

.dropdown-submenu .submenu.show {
    display: block;
}

.dropdown-submenu .dropdown-item {
    position: relative;
    padding: 0.5rem 1rem;
    color: #212529;
    text-decoration: none;
    background-color: transparent;
    border: 0;
    border-radius: 0;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.dropdown-submenu .dropdown-item:hover {
    color: #1e2125;
    background-color: #e9ecef;
}

.submenu-toggle {
    font-weight: bold;
    font-size: 1.2em;
    margin-left: 8px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    color: #212529;
    padding: 0;
    min-width: auto;
    text-decoration: none;
    flex-shrink: 0;
}

.submenu-toggle:hover {
    color: #1e2125;
    background: none;
    text-decoration: none;
}

.submenu-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* Desktop hover effect for submenu */
@media (min-width: 992px) {
    .dropdown-submenu:hover .submenu {
        display: block;
    }
    
    .submenu-toggle {
        pointer-events: none;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 991.98px) {
    .dropdown-submenu .submenu {
        position: static;
        left: auto;
        top: auto;
        margin-top: 0;
        margin-left: 1rem;
        border: none;
        box-shadow: none;
        background: transparent;
    }
    
    .dropdown-submenu .submenu .dropdown-item {
        padding-left: 2rem;
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.4;
        padding-right: 1rem;
        white-space: normal;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .dropdown-submenu .dropdown-item {
        word-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        line-height: 1.4;
        padding-right: 2rem;
        white-space: normal;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .dropdown-submenu .dropdown-item .menu-text {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: calc(100% - 40px);
        display: inline-block;
        flex: 1;
        min-width: 0;
    }
    
    .submenu-toggle {
        pointer-events: auto;
        font-size: 1.5em;
        margin-left: 12px;
        color: #6c757d;
    }
    
    .submenu-toggle:hover {
        color: #495057;
    }
    
    /* Prevent parent menu from closing on mobile */
    .dropdown-submenu .dropdown-item:focus,
    .dropdown-submenu .dropdown-item:active {
        background-color: transparent;
    }
} 