/* Sidebar Enhancements */

/* Smooth transitions for sidebar */
.sidebar {
    transition: all 0.3s ease-in-out;
    background: linear-gradient(180deg, #343a40 0%, #495057 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* ── Sidebar vertical scroll ──────────────────────────────────────────────
   The theme (app.min.css) already positions .app-sidebar as:
     position:fixed; top:3.75rem; bottom:0;
   so its height is bounded by the viewport.

   Problem: the theme sets .app-sidebar .menu { min-height:100% } which lets
   the menu grow beyond its container, so overflow never fires.

   Fix: override min-height on .menu to 0, make .app-sidebar-content the
   scrollable layer (it already has flex:1 from the theme).
   ──────────────────────────────────────────────────────────────────────── */

/* Allow the content wrapper to shrink so overflow can activate */
.app-sidebar .app-sidebar-content {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;          /* lets flex child shrink below its content size */
    -webkit-overflow-scrolling: touch;
}

/* Remove the theme's min-height:100% which prevents overflow from triggering */
.app-sidebar .menu {
    min-height: 0;
    padding-bottom: 1.5rem; /* breathing room at the bottom of the list */
}

/* Scrollbar styling */
.app-sidebar .app-sidebar-content::-webkit-scrollbar {
    width: 4px;
}
.app-sidebar .app-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}
.app-sidebar .app-sidebar-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}
.app-sidebar .app-sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.35);
}
/* Firefox */
.app-sidebar .app-sidebar-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.18) transparent;
}

/* Collapsed state */
.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-link span {
    opacity: 0;
    visibility: hidden;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Active state enhancements */
.sidebar .nav-link.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white !important;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transform: scale(1.05);
}

.sidebar .nav-link.active i {
    color: white;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: white;
    border-radius: 2px;
}

/* Hover effects */
.sidebar .nav-link {
    color: #adb5bd;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar .nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
    color: #6c757d;
    transition: color 0.3s ease;
}

.sidebar .nav-link:hover i {
    color: #007bff;
}

/* Submenu styling */
.nav-content {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin: 5px 0;
}

.nav-content .nav-link {
    padding-left: 30px;
    font-size: 0.9em;
}

/* Toggle button styling */
.toggle-sidebar-btn {
    transition: transform 0.3s ease;
}

.toggle-sidebar-btn:hover {
    transform: scale(1.1);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
    }
}

/* Keyboard navigation focus */
.sidebar .nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}