/* Custom CSS for System Setup nested menu styling */

/* Nested dropdown accordion behavior */
.nav-group .nav-group .nav-group-items {
    display: none;
    opacity: 0;
    max-height: 0;
    overflow: hidden; /* clip contents while collapsing/expanding to avoid overlap */
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

/* Show nav-group-items when parent nav-group has 'show' class */
.nav-group .nav-group.show > .nav-group-items {
    display: block;
    opacity: 1;
    max-height: 1000px;
    overflow: hidden; /* keep hidden during animation to prevent bleed over next items */
}

/* Ensure 2nd-level labels stack above collapsing siblings during animation */
.sidebar-nav .nav-group > .nav-group-toggle { position: relative; z-index: 2; }
.sidebar-nav .nav-group .nav-group-items { position: relative; z-index: 1; }

/* Prevent default highlighting on nav-group-toggle elements */
.nav-group-toggle {
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
}

/* Remove focus states that cause unwanted highlighting */
.nav-group-toggle:focus,
.nav-group-toggle:active {
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Only apply hover styles on actual hover */
.nav-group-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff;
}

/* Nested dropdown menu styles */
.nav-group .nav-group {
    margin-left: 0;
}

/* Second level nav-group styling (Chat, Call) */
.nav-group .nav-group .nav-link {
    padding-left: 3rem;
    font-size: 0.875rem;
    background-color: transparent !important;
}

/* Third level nav-items styling (Bot memories, Chat History, etc.) */
.nav-group .nav-group .nav-group-items .nav-link {
    padding-left: 4rem;
    font-size: 0.8125rem;
    background-color: transparent !important;
}

/* Only highlight third level items on hover */
.nav-group .nav-group .nav-group-items .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff;
}

/* Active state only for currently selected page */
.nav-group .nav-group .nav-group-items .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #fff;
}

/* Ensure proper icon alignment in nested menus */
.nav-group .nav-group .nav-icon {
    width: 1rem;
    margin-right: 0.5rem;
}
