/*** Style global pour TOUTES les barres de défilement ***/

/* Pour WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;  /* Largeur verticale */
    height: 8px; /* Largeur horizontale */
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #7e57c2; /* Violet principal */
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: #5e35b1; /* Violet plus foncé au survol */
}

/* Pour Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: #7e57c2 #f5f5f5; /* thumb track */
}

/* Version sombre (automatique avec préférence système) */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #2d2a36;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #9575cd;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #7e57c2;
    }

    html {
        scrollbar-color: #9575cd #2d2a36;
    }
}

/* Correction pour les éléments avec overflow */
div, section, article, aside, main, nav, 
textarea, iframe, .scrollable-content {
    scrollbar-width: thin; /* Pour Firefox */
    scrollbar-color: #7e57c2 #f5f5f5; /* Pour Firefox */
}

/* Garantir que le style s'applique partout */
* {
    scrollbar-width: thin; /* Firefox */
}