/* Sidebar Styles */
.sidebar {
    width: 64px;
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    background-color: #cee2ff;
    transition: width 0.3s ease;
    z-index: 1;
}

.sidebar .main-menu h4 {
    padding: 10px 6px 5px;
    font-size: 10px;
    color: var(--acsl-brand);
}

.sidebar .main-menu ul,
.sidebar .menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar.expanded {
    width: 320px;
}

.collapsed .menu-item {
    margin: 10px 0;
}

.sidebar .menu-item.active {
    display: flex;
    border-radius: 0px;
    align-items: center;
    color: #4e2979;
}

.expanded .menu-item {
    margin: 0;
    padding: 7px 0;
}

.sidebar .main-menu ul li .text,
.sidebar .menu-links li .text {
    display: none;
    margin-left: 0px;
    font-size: 10px;
    color: #000;
}

.sidebar .menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    color: #4e2979;
}

.main-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-menu ul li {
    padding: 0px 0px;
    cursor: pointer;
}

.menu-item img {
    width: 24px;
    height: 24px;
}

.menu-item .nav-text {
    display: none;
}

.sidebar .menu-item .nav-text {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    visibility: hidden;
}

.sidebar.expanded .menu-links {
    left: 240px;
}

/* When the sidebar is expanded, fade in and slide the text */
.sidebar.expanded .menu-item .nav-text {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
}

/* Menu Links Styling */
.menu-links {
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    border: 1px solid var(--acsl-light-blue);
    left: 64px;
    top: 0;
    bottom: 0;
    min-height: calc(100vh - 70px);
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    background: #edf4ff;
    z-index: 1000;
    width: 250px;
}

.menu-links.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-links.active {
    display: block;
}

/* Toggle Button */
#toggle-sidebar {
    position: absolute;
    bottom: 20px;
    left: 15px;
    cursor: pointer;
}

.main-content {
    margin-left: 320px;
    transition: margin-left 0.3s ease;
}

.sidebar.expanded + .main-content {
    margin-left: 0px;
    margin-left: 250px;
}

.sidebar .menu-links {
    display: none;
    padding: 0px 5px;
}

.sidebar .menu-links.active {
    display: block;
}

.sidebar .menu-links a img {
    margin-left: 5px !important;
}

.sidebar.expanded .main-menu ul li .text,
.sidebar.expanded .menu-links li .text {
    display: inline-block;
}

.sidebar .menu-links li:hover {
    border-radius: 5px;
}

.sidebar .menu-item img {
    width: 30px;
    height: 30px;
    margin-left: 10px;
    padding: 7px;
    border-radius: 10px;
    margin-bottom: 0px;
}

.sidebar .menu-item img:hover,
.sidebar .menu-item.active img,
.sidebar .menu-links .active img {
    background-color: #fff;
    border-radius: 5px;
}
.sidebar .menu-links a img {
    border-radius: 5px !important;
    width: 24px;
    height: 24px;
    padding: 5px;
    margin-bottom: 0px;
}

.sidebar .menu-links .active {
    background-color: #d0def4;
    border-radius: 5px;
}

.menu-links a {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.menu-links li a span {
    font-size: 12px;
    color: #292929;
    margin-left: 10px;
}

.expanded a.menu-item.active,
.expanded a.menu-item:hover {
    background-color: #fff;
}

.sidebar .toggle-arrow {
    position: absolute;
    bottom: 10px;
    left: 15px;
    cursor: pointer;
}

.sidebar .menu-links .active,
.sidebar .menu-links li:hover {
    background-color: #d0def4;
    border-radius: 5px;
}

.tooltip {
    position: absolute;
    background-color: #000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    display: none;
    white-space: nowrap;
    z-index: 1000;
}

/* Ensure scrollbar is visible */
.menu-links::-webkit-scrollbar {
    width: 8px;
}

.menu-links::-webkit-scrollbar-thumb {
    background: #b5b4b4;
    border-radius: 5px;
}

.menu-links::-webkit-scrollbar-thumb:hover {
    background: #b5b4b4;
}

.resources {
    background-color: #E2EEFF !important;
    padding: 10px !important;
    font-size: 14px;
    border-bottom: 2px solid #edf4ff;
    font-weight: 600;
}

@media (max-width: 600px) {
    .menu-links {
        min-height: calc(100vh - 138px) !important;
    }
}

@media (max-width: 991px) {
    /* Sidebar Settings */
    .sidebar {
        width: 0;
        overflow: hidden;
        transition: width 0.3s ease;
    }

    /* Expand sidebar when toggled */
    .sidebar.expanded {
        width: 320px;
        top: 60px;
        z-index: 9999;
    }

    /* Hide text, only show icons */
    .sidebar .main-menu .nav-text {
        display: none !important;
    }

    /* Hide main menu by default */
    .sidebar .main-menu {
        display: none;
    }

    /* Show main menu when sidebar expands */
    .sidebar.expanded .main-menu {
        display: flex;
        background-color: var(--acsl-brand);
    }

    .sidebar.expanded .main-menu h4 {
        position: absolute;
        top: -4px;
        color: #fff;
    }

    .sidebar .menu-item img {
        background-color: #eddeff;
        margin-left: 5px;
    }

    .sidebar.expanded ul {
        display: block;
        margin: 0 10px;
    }

    .main-menu ul li {
        margin-top: 20px;
    }

    .expanded a.menu-item.active {
        background-color: unset;
    }

    /* Toggle button positioning */
    #toggle-sidebar {
        position: fixed;
        top: 90px;
        left: 0px;
        z-index: 1001;
        height: fit-content;
        border-radius: 0 40px 40px 0;
    }

    #toggle-sidebar img {
        width: 25px;
    }

    /* Menu Links (submenu) - Initially Hidden */
    .menu-links {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        width: 200px;
        background-color: #edf4ff;
        border: 1px solid #d6e6ff;
        min-height: calc(100vh - 135px);
        z-index: 999;
        transition: left 0.3s ease;
    }

    .sidebar .menu-links .active {
        background-color: #d0def4;
        border-radius: 0px;
    }

    .sidebar.expanded .menu-links {
        left: 0px;
        top: 135px;
        width: 318px;
        display: block;
        padding: 0px;
        background-color: #fff;
        margin: 0px;
    }

    .menu-links:first-of-type {
        display: block !important;
    }

    .expanded a.menu-item:hover {
        background-color: #ffffff00;
    }

    .toggle-arrow.active {
        left: 320px !important;
        transition: 0.3s ease;
        top: 75px !important;
    }

    .toggle-arrow.active img {
        margin-top: -15px;
    }

    .fordesktop {
        display: none;
    }

    .overlay {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        /* Semi-transparent black */
        display: none;
        /* Hidden by default */
        z-index: 999;
        /* Ensure it's on top */
    }

    .overlay.active {
        display: block;
        /* Show the overlay when active */
    }

    .body-content.with-overlay {
        position: relative;
        z-index: 1;
        /* Ensure the body content is on top of the overlay */
    }
}

@media (min-width: 991px) {
    .formobile {
        display: none;
    }
    .toggle-arrow.active {
        transform: rotate(180deg);
        bottom: 30px !important;
    }
}
