/**
 * FIX SIDEBAR SCROLL - ERP
 * Correction du défilement bloqué dans la sidebar
 */

/* Force le scroll sur le conteneur principal de la sidebar */
.app-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 250px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 100vh !important;
    z-index: 1003 !important;
}

/* Conteneur scrollbar */
#scrollbar {
    position: relative !important;
    height: 100% !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
}

/* Fix pour les éléments SimpleBar qui pourraient bloquer */
#scrollbar .simplebar-wrapper,
#scrollbar .simplebar-mask,
#scrollbar .simplebar-offset,
#scrollbar .simplebar-content-wrapper {
    overflow: visible !important;
    overflow-y: auto !important;
    max-height: none !important;
}

#scrollbar .simplebar-content {
    overflow: visible !important;
}

/* S'assurer que le conteneur de navigation peut défiler */
#scrollbar .container-fluid {
    overflow: visible !important;
    height: auto !important;
}

/* Menu navbar */
#navbar-nav {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Personnalisation de la scrollbar */
#scrollbar::-webkit-scrollbar {
    width: 8px;
}

#scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Firefox */
#scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
}

/* GPU Acceleration pour fluidité */
#scrollbar {
    will-change: scroll-position;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Responsive - Mobile */
@media (max-width: 767.98px) {
    .app-menu {
        overflow-y: auto !important;
    }
    
    #scrollbar {
        max-height: calc(100vh - 60px) !important;
    }
}

/* Fix pour le scroll qui se bloque parfois */
.navbar-menu {
    overflow: visible !important;
}

.navbar-menu #scrollbar {
    position: relative !important;
    height: auto !important;
    min-height: 100% !important;
}

/* Items de menu */
.nav-item,
.menu-dropdown {
    overflow: visible !important;
}

