/* ============================================
   theme.css
   VARIABLES GLOBALES & DESIGN TOKENS
   ============================================ */
:root {
    /* --- PALETTE DE COULEURS --- */

    /* Fond - Thème sombre */
    --bg-primary: #0a0e1a;
    --bg-secondary: #121827;
    --bg-tertiary: #1a2332;

    /* Surfaces */
    --surface: #1e293b;
    --surface-light: #2a3649;
    --surface-hover: #324159;

    /* Accent principal - Bleu moderne */
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --accent-light: #60a5fa;

    /* Couleurs sémantiques */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);

    /* Texte */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Bordures & Ombres */
    --border: rgba(148, 163, 184, 0.1);
    --border-light: rgba(148, 163, 184, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);

    /* Rayons de bordure */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-light) var(--bg-secondary);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1520 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
   ============================================ */

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Scrollbar fine pour les modales et zones compactes */
.modal__body,
.switch-modal__list,
.team-modal__list {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-light) transparent;
}

.modal__body::-webkit-scrollbar,
.switch-modal__list::-webkit-scrollbar,
.team-modal__list::-webkit-scrollbar {
    width: 6px;
}

.modal__body::-webkit-scrollbar-track,
.switch-modal__list::-webkit-scrollbar-track,
.team-modal__list::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

.modal__body::-webkit-scrollbar-thumb,
.switch-modal__list::-webkit-scrollbar-thumb,
.team-modal__list::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

.modal__body::-webkit-scrollbar-thumb:hover,
.switch-modal__list::-webkit-scrollbar-thumb:hover,
.team-modal__list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}


/* ============================================
   LOADER GLOBAL (ISOLÉ)
   ============================================ */
.app-loader {
    position: fixed;
    inset: 0;
    /* Force le plein écran absolu */
    background: linear-gradient(135deg, var(--bg-primary) 0%, #0f1520 100%);
    z-index: 99999;

    /* Centrage Flexbox */
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 0;
    padding: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* On utilise un nom unique pour éviter les conflits avec buttons.css */
.fidelis-loader-circle {
    /* On force le positionnement pour contrer d'éventuels styles globaux */
    position: relative !important;
    display: block;

    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;

    border: 4px solid var(--surface-light);
    border-radius: 50%;
    border-top-color: var(--accent-primary);

    /* Animation unique */
    animation: fidelisSpin 1s linear infinite;
}

@keyframes fidelisSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}



/* ==========================================================================
   GLOBAL INPUT STYLES
   ========================================================================== */

/* Force les inputs date en mode sombre pour avoir l'icône et les textes blancs */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

/* Style de l'icône calendrier */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.8;
    filter: none;
    /* Pas d'inversion nécessaire car color-scheme: dark donne déjà du blanc */
    transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}