/* ==========================================================================
   RTN DESIGN SYSTEM (CORE) — VERSION FIVEM OPTIMIZED
   ==========================================================================
   Ceci est la "Bible Graphique" pour toutes les interfaces RTN.
   
   RÈGLES D'OR POUR FIVEM (CEF) :
   1. JAMAIS de `backdrop-filter: blur()`. Cela cause des écrans noirs.
   2. Utiliser des `background: rgba(...)` pour la transparence.
   3. Utiliser `outline` pour les lueurs externes larges, pas `box-shadow`.
   4. Police unique : 'Inter'.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* --- 1. TYPOGRAPHIE --- */
    --font-stack: 'Inter', sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 24px;

    /* --- 2. PALETTE DE COULEURS (Monochrome & Accents) --- */
    /* Textes */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.40);
    --text-muted: #6b7280;
    
    /* Fonds (Opacités calibrées pour FiveM) */
    --bg-core: rgba(5, 5, 5, 0.45);        /* Fond principal (Tablette, Panel) */
    --bg-surface: rgba(255, 255, 255, 0.03); /* Carte, Section */
    --bg-element: rgba(0, 0, 0, 0.3);      /* Input, Item list */
    --bg-header: rgba(0, 0, 0, 0.4);       /* En-têtes */
    --bg-hover: rgba(255, 255, 255, 0.08); /* État survolé */

    /* Bordures */
    --border-light: 1px solid rgba(255, 255, 255, 0.12);
    --border-strong: 1px solid rgba(255, 255, 255, 0.25);
    --border-focus: 1px solid rgba(255, 255, 255, 0.5);

    /* Couleurs Fonctionnelles (Subtiles) */
    --color-accent: #ffffff;
    --color-success: #2ecc71; /* Vert HUD */
    --color-warning: #f1c40f; /* Jaune HUD */
    --color-danger: #ff4757;  /* Rouge HUD */
    --color-info: #3498db;    /* Bleu HUD */

    /* --- 3. FORMES & ESPACES --- */
    --radius-xs: 2px;  /* Le standard "Sharp" RTN */
    --radius-sm: 4px;  /* Pour les gros conteneurs */
    --radius-pill: 50px;
    
    --gap-xs: 5px;
    --gap-sm: 10px;
    --gap-md: 20px;

    /* --- 4. EFFETS --- */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
    --transition: all 0.2s ease-in-out;
}

/* ==========================================================================
   RESET & BASE (FIVEM READY)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-stack);
    color: var(--text-primary);
    background: transparent !important; /* Crucial pour FiveM */
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* Utilitaires pour cacher proprement */
.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   COMPOSANTS UI (LES BRIQUES DE BASE)
   ========================================================================== */

/* --- 1. PANNEAUX & CARTES (Containers) --- */
.rtn-panel {
    background: var(--bg-core);
    border: var(--border-light);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* PAS DE BACKDROP-FILTER ICI */
}

.rtn-card {
    background: var(--bg-surface);
    border: 1px solid transparent;
    border-radius: var(--radius-xs);
    padding: 15px;
    transition: var(--transition);
}

.rtn-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

/* --- 2. TYPOGRAPHIE (En-têtes) --- */
.rtn-header {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px; /* Signature RTN */
    color: var(--text-primary);
    border-bottom: var(--border-light);
    padding: 15px 20px;
    background: var(--bg-header);
    display: flex; align-items: center; gap: 10px;
}

.rtn-subheader {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* --- 3. BOUTONS (Buttons) --- */
/* Style par défaut : Solide Blanc */
.rtn-btn {
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.rtn-btn-primary {
    background: var(--color-accent);
    color: #000000;
}
.rtn-btn-primary:hover {
    background: #dddddd;
    transform: translateY(-1px);
}

/* Style Secondaire : Transparent avec Bordure */
.rtn-btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-secondary);
}
.rtn-btn-outline:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Style Danger : Rouge */
.rtn-btn-danger {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--color-danger);
}
.rtn-btn-danger:hover {
    background: var(--color-danger);
    color: #fff;
}

/* Petit bouton carré (pour icônes) */
.rtn-btn-icon {
    width: 32px; height: 32px;
    padding: 0;
    border-radius: var(--radius-xs);
    background: var(--bg-element);
    color: var(--text-secondary);
}

/* --- 4. FORMULAIRES (Inputs) --- */
.rtn-input-group {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 15px;
}

.rtn-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rtn-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-element);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-family: var(--font-stack);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.rtn-input:focus {
    border-color: var(--border-focus);
    background: rgba(0, 0, 0, 0.5);
}

.rtn-input::placeholder {
    color: var(--text-tertiary);
}

/* Search Bar Spécifique (Avec icône) */
.rtn-search {
    position: relative;
    width: 100%;
}
.rtn-search i {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-secondary); font-size: 14px;
}
.rtn-search input {
    padding-left: 35px; /* Place pour l'icône */
}

/* --- 5. LISTES & ITEMS --- */
.rtn-list {
    display: flex; flex-direction: column; gap: 5px;
    overflow-y: auto;
}

.rtn-list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 15px;
    background: var(--bg-surface);
    border-radius: var(--radius-xs);
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.rtn-list-item:hover {
    background: var(--bg-hover);
}

.rtn-list-item.active {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--color-accent);
}

/* --- 6. SCROLLBAR (Style Fin) --- */
::-webkit-scrollbar {
    width: 4px; /* Très fin */
    height: 4px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   UTILITAIRES SPÉCIAUX (MAPS & HUD)
   ========================================================================== */

/* Vignette pour Map (Anti-Glitch FiveM)
   Utilise un radial-gradient au lieu de box-shadow inset */
.rtn-vignette-frame {
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xs);
    background: radial-gradient(circle, rgba(0,0,0,0) 40%, rgba(0,0,0,0.9) 100%);
    overflow: hidden;
}

/* Cache pour masquer ce qui dépasse (Technique du Donut) */
.rtn-overflow-mask {
    outline: 100vw solid #000000;
    pointer-events: none;
}

/* Badges (Statuts) */
.rtn-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
}
.rtn-badge.blue { background: var(--color-info); color: #fff; }
.rtn-badge.green { background: var(--color-success); color: #000; }
.rtn-badge.yellow { background: var(--color-warning); color: #000; }