﻿
/* Responsive tweaks */
@media (max-width: 767.98px) {
    .backLink {
      
    }
}

/*--------------------
    Sidebar Menu
--------------------*/
.sidebar-menu {
    background-color: #fff;
    border-radius: 0.5rem;
    position: -webkit-sticky; /* for Safari */
    position: sticky;
    top: 1rem; /* distance from top of viewport */
    z-index: 100; /* keep above content */
    max-height: calc(100vh - 2rem); /* prevent overflow beyond screen */
    overflow-y: auto; /* scroll internally if content taller than screen */
}

    /* Optional: add subtle styling to show it's independent */
    .sidebar-menu::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-menu::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.1);
        border-radius: 10px;
    }

    /* Default link */
    .sidebar-menu .nav-link {
        color: #3B398C;
        transition: all 0.2s ease;
        text-decoration: none;
        cursor: pointer;
        border-radius: 0.375rem;
        padding: 0.4rem 0.75rem;
        margin: 2px 0;
    }

        /* Hover and focus: light blue-grey background */
        .sidebar-menu .nav-link:hover,
        .sidebar-menu .nav-link:focus {
            background-color: #EBEBF3 !important; /* soft grey-blue */
            color: #3B398C !important;
        }

        /* Active link */
        .sidebar-menu .nav-link.active {
            background-color: #3B398C; /* slightly deeper tone for active state */
            color: #fff;
            font-weight: 600;
        }

    /* Section headings */
    .sidebar-menu h6 {
        color: #3B398C;
        font-weight: bold;
        font-size: 1.1rem;
        margin-top: 1rem;
    }

    /* Divider line */
    .sidebar-menu hr {
        border-color: #DADAE8;
        opacity: 0.6;
    }

.sidebar-nav .section-links {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav .menu-section.closed .section-links {
    max-height: 0;
}

.sidebar-nav .menu-section.open .section-links {
    max-height: 500px; /* enough to show all links */
}

.section-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #3B398C;
}

    .section-header::after {
        content: "▾"; /* down arrow */
        font-size: 25px;
        transition: transform 0.3s ease;
    }

.menu-section.closed .section-header::after {
    transform: rotate(-90deg);
}

/* Optional caret rotation */
.sidebar-nav .caret {
    transition: transform 0.3s ease;
    font-size: 25px;
}

    .sidebar-nav .caret.open {
        transform: rotate(90deg);
        font-size: 25px;
    }

.sub-menu .list-group-item.active {
    background-color: #198754;
    border-color: #198754;
    color: white;
}
.sub-menu .nav-link {
padding-left: 1.5rem; /* extra indent */
margin: 2px 0;
}

.sub-menu .nav-link.active {
    background-color: #E1E1F2; /* same as main active */
    color: #2A287A;
    font-weight: 600;
}


.menu-section.closed .section-links {
    display: none;
}

.menu-section.open .section-links {
    display: block;
}

/*-----------------
    Mobile Menu
--------------------*/

/* Show hamburger icon */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Default: sidebar visible */
.sidebar-wrapper {
    display: block;
}

/* Hide sidebar on small screens by default */
@media (max-width: 767.98px) {
    .sidebar-wrapper {
        display: none;
    }

    /* When active, show it as an overlay */
    .sidebar-wrapper.active {
        display: block;
    }
}
