/* Sidebar mobile improvements */
@media (max-width: 991.98px) {
    .sidebar {
        width: 200px !important;
        left: -200px !important;
        top: 56px !important;
        height: calc(100vh - 56px);
        z-index: 1050;
    }
    .sidebar.show {
        left: 0 !important;
    }
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100vw;
        height: calc(100vh - 56px);
        background: rgba(0,0,0,0.4);
        z-index: 1049;
        transition: opacity 0.3s;
    }
    .sidebar-overlay.hide {
        display: none;
    }
}
@media (max-width: 575.98px) {
    .sidebar {
        width: 90vw !important;
        min-width: 0 !important;
        max-width: 300px !important;
    }
}
/* Mobile navbar dropdown menu fix */
@media (max-width: 991.98px) {
    #mobileNavbar, #mobileNavbar .navbar-nav {
        background-color: #222 !important;
    }
    #mobileNavbar .nav-link {
        color: #fff !important;
    }
    #mobileNavbar .nav-link:hover, #mobileNavbar .nav-link:focus {
        background-color: #444 !important;
        color: #fff !important;
    }
}
/* Dropdown menu fix for visibility */
@media (max-width: 991.98px) {
    .dropdown-menu {
        background-color: #222 !important;
        color: #fff !important;
    }
    .dropdown-menu .dropdown-item {
        color: #fff !important;
    }
    .dropdown-menu .dropdown-item:hover, .dropdown-menu .dropdown-item:focus {
        background-color: #444 !important;
        color: #fff !important;
    }
}

/* Also apply for desktop if needed */
.dropdown-menu {
    background-color: #222 !important;
    color: #fff !important;
}
.dropdown-menu .dropdown-item {
    color: #fff !important;
}
.dropdown-menu .dropdown-item:hover, .dropdown-menu .dropdown-item:focus {
    background-color: #444 !important;
    color: #fff !important;
}
/* Sidebar Styles */
.sidebar {
    min-height: calc(100vh - 56px);
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.sidebar-section-toggle {
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.sidebar-section-toggle:hover {
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
}

.sidebar-section-toggle[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar-section-toggle .fa-chevron-down {
    transition: transform 0.3s ease;
}

.nav-link {
    border-radius: 5px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(33, 37, 41, 0.05);
    transform: translateX(2px);
}

.nav-link.active {
    background-color: #0d6efd;
    color: white !important;
}

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

/* Collapse animation */
.collapse {
    transition: height 0.3s ease;
}

/* Mobile sidebar */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 56px !important;
        left: 0;
        z-index: 1040;
        width: 100% !important;
        height: calc(100vh - 56px);
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-enabled {
        margin-left: 0 !important;
        padding-top: 56px !important;
    }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}