/* ========= OVERRIDE ULTIME DES TABLES ========= */

/* 1. ÉCRASER LES VARIABLES BOOTSTRAP */
:root, [data-bs-theme] {
    --bs-table-bg: transparent !important;
    --bs-table-color: #e0e0ff !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-bg-state: transparent !important;
    --bs-table-bg-type: transparent !important;
    --bs-table-border-color: rgba(110, 231, 255, 0.3) !important;
}

/* 2. RÈGLE SPÉCIFIQUE POUR ÉCRASER BOOTSTRAP */
html > body .table > :not(caption) > * > *,
body .table > :not(caption) > * > *,
.table > :not(caption) > * > * {
    background-color: transparent !important;
    color: #e0e0ff !important;
    box-shadow: none !important;
    border-bottom-color: rgba(110, 231, 255, 0.3) !important;
}

/* 3. CELLULES ET EN-TÊTES */
html > body .table td,
html > body .table th,
html > body table td,
html > body table th,
.table td, .table th,
table td, table th {
    background-color: transparent !important;
    color: #e0e0ff !important;
    border-color: rgba(110, 231, 255, 0.3) !important;
}

/* 4. EN-TÊTES DE TABLE */
html > body .table thead th,
html > body table thead th,
.table thead th,
table thead th {
    background: rgba(110, 231, 255, 0.15) !important;
    color: #6ee7ff !important;
    font-weight: 600 !important;
    border-bottom: 2px solid rgba(110, 231, 255, 0.4) !important;
}

/* 5. APPLIQUER AUX TABLES */
html > body .table,
html > body table,
.table, table {
    --bs-table-bg: transparent !important;
    --bs-table-color: #e0e0ff !important;
    background-color: transparent !important;
    color: #e0e0ff !important;
}

/* ========= THÈME COSMIQUE - OVERRIDE PROPRE ========= */

/* Variables */
:root {
    --cosmic-bg: #0a0a0f;
    --cosmic-navbar: #1e1432;
    --cosmic-card: #1c162f;
    --cosmic-text: #e0e0ff;
    --cosmic-accent: #7b68ee;
}

/* Body */
html > body {
    background-color: var(--cosmic-bg) !important;
    color: var(--cosmic-text) !important;
    min-height: 100vh;
}

/* Navbar */
body .navbar,
body nav.navbar,
body .navbar.navbar-expand-lg {
    background: linear-gradient(135deg, var(--cosmic-navbar), #2d1b4d) !important;
    border-bottom: 2px solid var(--cosmic-accent) !important;
    box-shadow: 0 5px 30px rgba(123, 104, 238, 0.4) !important;
}

/* Cards */
body .card,
body .card-body,
body [class*="card"] {
    background: linear-gradient(135deg, var(--cosmic-card), #292043) !important;
    border: 1px solid var(--cosmic-accent) !important;
    color: var(--cosmic-text) !important;
    border-radius: 12px !important;
}

/* Bootstrap overrides */
body .bg-white,
body .bg-light {
    background-color: var(--cosmic-card) !important;
    color: var(--cosmic-text) !important;
}

body .text-dark,
body .text-muted,
body .text-black {
    color: var(--cosmic-text) !important;
}

/* Links */
body a:not(.btn) {
    color: #9d8aff !important;
}

body a:not(.btn):hover {
    color: var(--cosmic-accent) !important;
}

/* Primary buttons */
body .btn-primary {
    background: linear-gradient(135deg, var(--cosmic-accent), #6a5acd) !important;
    border-color: var(--cosmic-accent) !important;
}

/* Forms */
body .form-control,
body .form-select {
    background-color: #151025 !important;
    border-color: var(--cosmic-accent) !important;
    color: var(--cosmic-text) !important;
}

/* ========= OVERRIDE FINAL POUR LES BOUTONS ========= */
.btn-primary:hover {
    background: linear-gradient(135deg, #8a7bf0, #7b68ee) !important;
    border-color: #8a7bf0 !important;
}

/* ========= CORRECTION TITRES ACTUALITÉS ========= */
.news .card-title,
.news h2, .news h3, .news h4,
#news .card-title,
#news h2, #news h3, #news h4 {
    color: #ffffff !important;
}

/* Titres dans les cartes d'actualités */
.card .card-title,
.card h2, .card h3, .card h4,
.card-body .card-title,
.card-body h2, .card-body h3, .card-body h4 {
    color: #ffffff !important;
}