/* ========================================
   OVERRIDE CSS POUR FORCER LA LISIBILITÉ
   Corrige les problèmes de style.css et multi-projets.css
   ======================================== */

/* OVERRIDE POUR TOUS LES ÉLÉMENTS AVEC color: white PROBLÉMATIQUES */

/* Override des boutons avec color: white sur fond potentiellement blanc */
.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-edit,
.btn-delete {
    color: white !important;
    /* Assure que ces boutons ont toujours un fond coloré */
}

/* S'assurer que tous les autres éléments avec color: white ont un fond sombre */
.header .btn,
.nav-btn,
.menu-btn {
    background: #2d3748 !important;
    color: white !important;
}

/* Override spécifique pour les éléments problématiques de style.css */
.container {
    background: transparent !important;
    color: #2d3748 !important;
}

.main-content {
    background: white !important;
    color: #2d3748 !important;
}

/* Corrections pour les éléments qui pourraient avoir color: white sans fond approprié */
.text-white:not(.btn):not(.alert):not(.sidebar) {
    color: #2d3748 !important;
}

/* Override pour les éléments de navigation */
.navbar,
.nav {
    background: #2d3748 !important;
}

.navbar a,
.nav a {
    color: #e2e8f0 !important;
}

.navbar a:hover,
.nav a:hover {
    color: white !important;
    background: #4a5568 !important;
}

/* Override pour les éléments de formulaire qui pourraient être invisibles */
input,
select,
textarea {
    background: white !important;
    color: #2d3748 !important;
    border: 2px solid #e2e8f0 !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3182ce !important;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1) !important;
}

/* Override pour les labels */
label {
    color: #2d3748 !important;
    font-weight: 600 !important;
}

/* CORRECTION SPÉCIFIQUE POUR STAT-CONTENT - VERSION RENFORCÉE */
.stat-content {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a202c !important;
    padding: 0.5rem !important;
    border-radius: 0.375rem !important;
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
}

.stat-content *,
.stat-content h1,
.stat-content h2,
.stat-content h3,
.stat-content h4,
.stat-content h5,
.stat-content h6 {
    color: #1a202c !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

.stat-content p,
.stat-content span,
.stat-content div {
    color: #2d3748 !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

/* Override pour les tableaux */
table,
.table {
    background: white !important;
    color: #2d3748 !important;
}

table th,
.table th {
    background: #f7fafc !important;
    color: #2d3748 !important;
}

table td,
.table td {
    color: #4a5568 !important;
}

/* Override pour les cards/panels */
.panel,
.card,
.widget {
    background: white !important;
    color: #2d3748 !important;
    border: 1px solid #e2e8f0 !important;
}

/* Override pour les alertes */
.alert {
    color: #2d3748 !important;
}

.alert-success {
    background: #f0fff4 !important;
    color: #1a365d !important;
    border-color: #38a169 !important;
}

.alert-warning {
    background: #fffbeb !important;
    color: #744210 !important;
    border-color: #d69e2e !important;
}

.alert-danger,
.alert-error {
    background: #fed7d7 !important;
    color: #742a2a !important;
    border-color: #e53e3e !important;
}

.alert-info {
    background: #ebf8ff !important;
    color: #1e3a8a !important;
    border-color: #3182ce !important;
}

/* Override pour les badges et status */
.badge {
    padding: 0.25rem 0.75rem !important;
    border-radius: 1rem !important;
    font-weight: 600 !important;
}

.badge-primary {
    background: #3182ce !important;
    color: white !important;
}

.badge-success {
    background: #38a169 !important;
    color: white !important;
}

.badge-warning {
    background: #d69e2e !important;
    color: white !important;
}

.badge-danger {
    background: #e53e3e !important;
    color: white !important;
}

.badge-secondary {
    background: #718096 !important;
    color: white !important;
}

/* Override pour les liens */
a:not(.btn) {
    color: #3182ce !important;
}

a:not(.btn):hover {
    color: #2c5aa0 !important;
}

/* Override pour les titres */
h1, h2, h3, h4, h5, h6 {
    color: #2d3748 !important;
}

/* Override pour les listes */
ul, ol, li {
    color: #4a5568 !important;
}

/* Override pour le texte général */
p, span, div {
    color: inherit !important;
}

/* Forcer un contraste minimum pour tous les éléments texte */
.text-content,
.content-text,
.description,
.comment {
    color: #4a5568 !important;
    line-height: 1.6 !important;
}

/* Override pour les menus dropdown */
.dropdown-menu {
    background: white !important;
    color: #2d3748 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.dropdown-menu a {
    color: #4a5568 !important;
    padding: 0.5rem 1rem !important;
}

.dropdown-menu a:hover {
    background: #f7fafc !important;
    color: #2d3748 !important;
}

/* Override pour la pagination */
.pagination a,
.pagination span {
    background: white !important;
    color: #3182ce !important;
    border: 1px solid #e2e8f0 !important;
}

.pagination a:hover {
    background: #f7fafc !important;
}

.pagination .current,
.pagination .active {
    background: #3182ce !important;
    color: white !important;
}

/* Override pour les modales */
.modal-content {
    background: white !important;
    color: #2d3748 !important;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

.modal-footer {
    border-top: 1px solid #e2e8f0 !important;
}

/* Override pour les onglets */
.tabs {
    border-bottom: 1px solid #e2e8f0 !important;
}

.tab {
    color: #718096 !important;
    padding: 1rem !important;
    border-bottom: 2px solid transparent !important;
}

.tab.active {
    color: #3182ce !important;
    border-bottom-color: #3182ce !important;
}

/* Override pour les breadcrumbs */
.breadcrumb {
    background: #f7fafc !important;
    color: #4a5568 !important;
}

.breadcrumb a {
    color: #3182ce !important;
}

/* CORRECTION SPÉCIALE POUR LES ÉLÉMENTS PROBLÉMATIQUES SPÉCIFIQUES */

/* Si un élément a une classe spécifique qui cause des problèmes */
.white-text {
    color: #2d3748 !important;
}

.light-text {
    color: #4a5568 !important;
}

/* Correction pour les éléments inline qui héritent mal */
strong, b {
    color: inherit !important;
    font-weight: 700 !important;
}

em, i {
    color: inherit !important;
    font-style: italic !important;
}

/* Correction pour les codes et pré-formatés */
code {
    background: #f7fafc !important;
    color: #2d3748 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.25rem !important;
}

pre {
    background: #f7fafc !important;
    color: #2d3748 !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e2e8f0 !important;
}

/* IMPORTANT: Force pour tous les éléments qui ne devraient jamais être invisibles */
*:not(.invisible):not(.hidden) {
    /* Assure qu'aucun élément important n'est invisible par accident */
    opacity: 1 !important;
}

/* Force minimale pour la lisibilité */
body * {
    min-height: 0 !important;
}

/* Debug: bordure rouge pour éléments potentiellement problématiques */
.debug-visibility {
    border: 1px solid red !important;
    background: yellow !important;
    color: black !important;
    opacity: 1 !important;
}
