/* /static/css/theme.css */
html.dark-mode body {
    background: #181a1b !important;
    color: #ececec !important;
}
html.dark-mode body .navbar,
html.dark-mode body .dropdown-menu,
html.dark-mode body .offcanvas,
html.dark-mode body .card,
html.dark-mode body .modal-content {
    background: #222426 !important;
    color: #ececec !important;
}

html.dark-mode body .dropdown-item,
html.dark-mode body .form-control,
html.dark-mode body .form-select,
html.dark-mode body textarea {
    background: #222426 !important;
    color: #ececec !important;
    border-color: #343a40 !important;
}

html.dark-mode body .table,
html.dark-mode body table,
html.dark-mode body .dataTable {
    background: #23272b !important;
    color: #ececec !important;
}

html.dark-mode body .btn-primary,
html.dark-mode body .btn-secondary,
html.dark-mode body .btn-danger {
    background: #3b4045;
    color: #ffc107;
    border-color: #222;
}

html.dark-mode body a,
html.dark-mode body .nav-link,
html.dark-mode body .navbar-brand {
    color: #ffc107 !important;
}

html.dark-mode body .form-check-input:checked {
    background-color: #ffc107;
    border-color: #ffc107;
}

html.dark-mode body .dropdown-divider {
    border-top: 1px solid #343a40;
}

/* Pour éviter que d'autres éléments de DataTables ou modals déraillent : */
html.dark-mode body .dataTables_wrapper,
html.dark-mode body .modal-content {
    background: #23272b !important;
    color: #ececec !important;
}

/* Optionnel : ombrage plus doux sur les éléments */
html.dark-mode body .card,
html.dark-mode body .modal-content,
html.dark-mode body .dropdown-menu {
    box-shadow: 0 2px 16px rgba(0,0,0,0.16);
}

/* Corrige les bandes de .table-striped en mode sombre */
html.dark-mode body .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #232426 !important; /* couleur plus claire pour l'alternance */
    color: #ececec !important;            /* texte clair, force l'override */
}
html.dark-mode body .table-striped > tbody > tr:nth-of-type(even) {
    background-color: #1a1a1a !important; /* fond plus foncé */
    color: #ececec !important;
}

/* Pour les cas où un <td> met sa propre couleur (rare, mais ça arrive) */
html.dark-mode body .table td,
html.dark-mode body .table th {
    color: #ececec !important;
}

/* Pour les liens dans les tables (garde le jaune du dark mode) */
html.dark-mode body .table a {
    color: #ffc107 !important;
}

html.dark-mode body .table-striped tbody tr:hover {
    background-color: #31343a !important;
    color: #fff !important;
}

/* TRANSITIONS DÉSACTIVÉES PENDANT LE CHARGEMENT - réactivées après */
.transitions-enabled html,
.transitions-enabled body {
    transition: background-color 0.2s, color 0.2s;
}

.transitions-enabled html.dark-mode body,
.transitions-enabled html.dark-mode body * {
    transition: background-color 0.2s, color 0.2s;
}

/* Other effects */

html.theme-blur body {
    filter: blur(4px);
    transition: filter 0.4s;
}

html.dark-mode body .card,
html.dark-mode body .list-group-item,
html.dark-mode body .card-body {
    background: #232426 !important;
    color: #ececec !important;
}

html.dark-mode body .list-group-item strong {
    color: #ffc107 !important; /* pour le label */
}

.select2-container .select2-selection {
    background-color: #181c20 !important;
    color: #fff !important;
    border-color: #353a40 !important;
    min-height: 38px;
    border-radius: 0.5rem;
    font-size: 1rem;
}
.select2-results__option {
    background-color: #181c20;
    color: #fff;
}
.select2-results__option--highlighted[aria-selected] {
    background-color: #353a40;
    color: #fff;
}

.select2-container .select2-selection--single {
    background-color: #181c20 !important;
    color: #fff !important;
    border-color: #353a40 !important;
}

/* Texte dans le select fermé */
.select2-container .select2-selection__rendered {
    color: #fff !important;
}

/* Texte dans la dropdown (ouverts) */
.select2-container .select2-results__option {
    background-color: #181c20 !important;
    color: #fff !important;
}
.select2-container .select2-results__option--highlighted[aria-selected] {
    background-color: #353a40 !important;
    color: #fff !important;
}

.select2-container .select2-dropdown .select2-search .select2-search__field {
    background-color: #353a40 !important;
    color: #fff !important;
}
.select2-container .select2-dropdown .select2-search {
    background-color: #181c20 !important;
    color: #fff !important;
}
