/* =========================================
   1. VARIABLES (LES COULEURS)
   ========================================= */
:root {
    /* --- MODE JOUR (Light) --- */
    --bg-body: #F9FAFB;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff; /* Blanc pur pour éviter les effets bizarres */

    --text-main: #111827;  /* Noir profond */
    --text-muted: #6B7280; /* Gris moyen */

    --border-color: #E5E7EB;
    --primary: #ED1B2F; /* LE ROUGE EUS OFFICIEL */

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    /* --- MODE NUIT (Dark) --- */
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0f172a; /* Sombre opaque */

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --border-color: #334155;
    --primary: #ff4d4d; /* Rouge légèrement plus clair pour le noir */

    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* =========================================
   2. BASE & TYPOGRAPHIE
   ========================================= */
body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: background 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* =========================================
   3. SIDEBAR (Le Correctif "Fucked Up")
   ========================================= */
.sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    background-color: var(--bg-sidebar) !important; /* Force la couleur de fond */
    border-right: 1px solid var(--border-color);
    padding: 30px 24px; /* Plus d'espace en haut (30px) */
    z-index: 1000;
    display: flex; flex-direction: column;
    transition: transform 0.3s ease;
}

/* Logo dans la sidebar */
.brand-logo {
    font-size: 1.4rem;
    font-weight: 800;
    text-decoration: none;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 40px; /* Espace sous le logo */
    padding-left: 0;
    color: var(--text-main);
}

/* LE FIX DU TEXTE (Noir + Rouge) */
.text-eus, .brand-text-eus {
    color: var(--text-main) !important;
}
.text-wiki, .brand-text-wiki {
    color: var(--primary) !important; /* ROUGE EUS FORCÉ */
    font-weight: 900;
    background: none !important; /* Enlève les vieux dégradés */
    -webkit-text-fill-color: initial !important;
}

/* Liens du menu */
.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 4px;
    display: flex; align-items: center; gap: 12px;
    text-decoration: none;
    transition: all 0.2s;
}
.nav-link:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}
.nav-link.active {
    background-color: rgba(237, 27, 47, 0.1); /* Fond rouge très pâle */
    color: var(--primary);
    font-weight: 700;
}

/* =========================================
   4. COMPOSANTS (Cartes & Header Mobile)
   ========================================= */

/* Mobile Header */
.mobile-header {
    background: var(--bg-sidebar) !important;
    border-bottom: 1px solid var(--border-color);
}

/* Cartes */
.card, .cute-card, .folder-card, .result-card, .info-card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow);
    border-radius: 16px;
    transition: transform 0.2s;
}
.card:hover, .cute-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary) !important;
}

/* Inputs */
input.search-input, input.form-control {
    background-color: var(--bg-body) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}
input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(237, 27, 47, 0.2) !important;
}

/* Liens génériques */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Tableaux */
table {
    width: 100%; margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px; overflow: hidden;
}
th {
    background-color: var(--bg-body) !important;
    color: var(--text-muted) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
}
td {
    background-color: var(--bg-card) !important;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
}