/* --- DASHBOARD SCIENTIFIQUE HIGH-TECH --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg-dark: #0f172a;
    /* Fond principal (Slate 900) */
    --bg-card: #1e293b;
    /* Fond des cartes (Slate 800) */
    --text-main: #f8fafc;
    /* Blanc cassé (Slate 50) */
    --text-muted: #94a3b8;
    /* Gris clair (Slate 400) */
    --accent-blue: #38bdf8;
    /* Bleu ciel électrique */
    --accent-green: #4ade80;
    /* Vert signal */
    --accent-purple: #c084fc;
    /* Violet (Historique) */
    --border-color: #334155;
    /* Bordures subtiles */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* --- Typographie --- */
h2,
h5,
.nav-link {
    font-weight: 600;
    letter-spacing: -0.02em;
}

.card-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

h4,
.fw-bold {
    font-family: 'JetBrains Mono', monospace;
    /* Chiffres techniques */
}

/* --- Cartes & Conteneurs --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-blue);
}

/* --- Onglets (Tabs) --- */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s;
}

.nav-tabs .nav-link:hover {
    color: var(--accent-blue);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
}

/* --- Contrôles de Formulaire (Inputs, Selects) --- */
.form-control,
.form-select,
.input-group-text {
    background-color: #0f172a !important;
    /* Fond très sombre */
    border: 1px solid var(--border-color) !important;
    color: #ffffff !important;
    /* Texte Blanc pur FORCE */
}

/* Couleur du texte fantôme (placeholder) */
.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1;
}

/* Fix pour l'autocomplétion Chrome (qui met un fond jaune moche) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
}

.form-control:focus,
.form-select:focus {
    background-color: #1a2436;
    border-color: var(--accent-blue);
    color: var(--text-main);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.input-group-text {
    background-color: var(--bg-card);
    color: var(--text-muted);
}

/* --- Boutons --- */
.btn-primary {
    background-color: var(--accent-blue);
    border: none;
    color: #0f172a;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:active {
    background-color: #0ea5e9;
    color: #fff;
}

.btn-outline-secondary {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background-color: var(--bg-card);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* --- Couleurs Spécifiques (Chiffres) --- */
.text-primary {
    color: var(--accent-blue) !important;
}

.text-info {
    color: #67e8f9 !important;
}

/* Cyan */
.text-success {
    color: var(--accent-green) !important;
}

.text-danger {
    color: #f87171 !important;
}

/* Rouge doux */
.text-secondary {
    color: #cbd5e1 !important;
}

/* Gris clair */

/* --- Logos (Inversion auto si nécessaire) --- */
img[src*="inverse"] {
    /* Si le le logo est sombre, on peut l'inverser, mais ici "inverse" laisse penser qu'il est déjà blanc */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

/* --- Graphiques --- */
canvas {
    background-color: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px;
}

/* --- Animation Icône Sismo --- */
.sismo-anim {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: sismoDraw 2.5s ease-in-out infinite;
}

@keyframes sismoDraw {
    0% {
        stroke-dashoffset: 50;
        opacity: 0;
    }

    15% {
        opacity: 1;
        stroke-dashoffset: 50;
    }

    85% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

}

/* --- Fix Calendrier (Icone sombre sur fond noir) --- */
/* Compatibilité Firefox / Safari : Force le mode sombre natif */
input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    /* On force une icône blanche SVG explicite car l'inversion échoue parfois */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="white" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>') !important;
    cursor: pointer;
    opacity: 1 !important;
    filter: none !important;
}