/* sidebar.css */

.sidebar-indicator {
    position: fixed;
    top: 30%; /* Position at 30% from the top */
    left: 0;
    width: 40px; /* Small width for the icon */
    height: 40px; /* Small height for the icon */
    background-color: rgba(0, 0, 0, 0.7); /* Dark background for the icon */
    border-radius: 0 5px 5px 0; /* Rounded right corners */
    z-index: 990; /* Smaller than main nav */
    transition: all 0.3s ease-in-out; /* Smooth transition for width and position */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff; /* Icon color */
    font-size: 20px; /* Icon size */
    overflow: hidden; /* Hide content when collapsed */
}

.sidebar-indicator.expanded {
    width: 100%; /* Expand to full width */
    height: calc(100% - 60px); /* Adjust height to account for navbar */
    top: 60px; /* Start below the navbar */
    left: 0; /* Move to left when expanded */
    border-radius: 0; /* No border-radius when expanded */
    background-color: rgba(0, 0, 0, 0.9); /* Darker background when expanded */
    z-index: 9998; /* Higher z-index when expanded */
}

.sidebar-icon {
    display: block; /* Show icon when collapsed */
}

.sidebar-indicator.expanded .sidebar-icon {
    display: none; /* Hide icon when expanded */
}

.sidebar-menu-container {
    display: none; /* Hidden by default */
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling for long menus */
    color: #fff;
    position: relative; /* Needed for absolute positioning of close button */
}

.sidebar-indicator.expanded .sidebar-menu-container {
    display: block; /* Show when expanded */
}

/* Styles for the expanded menu */
.sidebar-menu-container .nav-pills .nav-link {
    color: #fff;
    margin-bottom: 10px;
    text-align: left;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.sidebar-menu-container .nav-pills .nav-link.active,
.sidebar-menu-container .nav-pills .nav-link:hover {
    background-color: #007bff; /* Bootstrap primary blue */
    color: #fff;
}

.sidebar-close-btn {
    position: absolute;
    top: 10px; /* Adjust as needed */
    right: 5%; /* Position from the right */
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000; /* Ensure it's above other content in the menu */
    background: none;
    border: none;
    padding: 0;
}

/* New class for main content when sidebar is active and collapsed */
@media (max-width: 575.98px) {
    .main-content-with-sidebar {
        margin-left: 40px; /* Make space for the collapsed sidebar */
    }
}

/* Media query to hide the sidebar on larger screens and show the original tabs */
@media (min-width: 576px) {
    .sidebar-indicator {
        display: none; /* Hide sidebar on screens >= sm */
    }
    .main-content-with-sidebar {
        margin-left: 0; /* Remove margin on larger screens */
    }
}