/* =========================================================================
 * 1 . VARIABLES ET RÉGLAGES GLOBAUX                             *
 * ========================================================================= */
:root {
    --bg: #050608;
    --panel: #121418;
    --accent: #00e5ff;
    --tg-active: #ff9500;
    --green: #30d158;
    --red: #ff3b30;
    --border: rgba(255,255,255,0.08);
    --card-bg: rgba(26, 29, 35, 0.9);
    --text-gray: #9ea3a7;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    background: var(--bg);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

/* --- CONFIGURATION DES THÈMES GLOBALE --- */
:root {
    --bg: #050505;
    --panel: #161618;
    --accent: #00e5ff;
    --text-main: #ffffff;
    --msg-bg: #161b22;
    --text-gray: #9ea3a7;
    --border: rgba(255,255,255,0.1);
    --red: #ff3b30;
    --green: #30d158;
}

body.theme-dark       { --bg: #050505; --panel: #161618; --accent: #00e5ff; --text-main: #ffffff; --msg-bg: #161b22; }
body.theme-light      { --bg: #f0f2f5; --panel: #ffffff; --accent: #007bff; --header-bg: #ffffff; --text-main: #1c1e21; --msg-bg: #e4e6eb; --text-gray: #65676b; --border: rgba(0,0,0,0.1); }
body.theme-matrix     { --bg: #000000; --panel: #050505; --accent: #00ff41; --text-main: #00ff41; --msg-bg: #0a0a0a; --text-gray: #008f11; }
body.theme-cyberpunk  { --bg: #000505; --panel: #10002b; --accent: #f72585; --text-main: #4cc9f0; --msg-bg: #3a0ca3; }
body.theme-midnight   { --bg: #020617; --panel: #0f172a; --accent: #38bdf8; --text-main: #f8fafc; --msg-bg: #1e293b; }
body.theme-amber      { --bg: #0f0a00; --panel: #1a1400; --accent: #ffbf00; --text-main: #ffd700; --msg-bg: #291f00; --text-gray: #806000; }
body.theme-ruby       { --bg: #1a0101; --panel: #2b0202; --accent: #e63946; --text-main: #f1faee; --msg-bg: #457b9d; }
body.theme-vaporwave  { --bg: #1a0633; --panel: #240b4d; --accent: #ff00ff; --text-main: #39ff14; --msg-bg: #4b0082; }
body.theme-deepsea    { --bg: #000b1a; --panel: #001633; --accent: #00d4ff; --text-main: #e0f7fa; --msg-bg: #002b5c; }
body.theme-mars       { --bg: #1a0a05; --panel: #2b120a; --accent: #ff5722; --text-main: #ffccbc; --msg-bg: #3e2723; }
body.theme-steampunk  { --bg: #1a120b; --panel: #2b1f14; --accent: #cd7f32; --text-main: #d4af37; --msg-bg: #3e2c1c; }
body.theme-toxic      { --bg: #0a0f00; --panel: #141a00; --accent: #adff2f; --text-main: #ccff00; --msg-bg: #1d2600; }
body.theme-dracula    { --bg: #282a36; --panel: #44475a; --accent: #bd93f9; --text-main: #f8f8f2; --msg-bg: #6272a4; }
body.theme-nord       { --bg: #2e3440; --panel: #3b4252; --accent: #88c0d0; --text-main: #eceff4; --msg-bg: #434c5e; }
body.theme-forest     { --bg: #0b1a0e; --panel: #16261b; --accent: #4ade80; --text-main: #dcfce7; --msg-bg: #064e3b; }
body.theme-blood      { --bg: #000000; --panel: #1a0000; --accent: #ff0000; --text-main: #ff0000; --msg-bg: #330000; }
body.theme-ice        { --bg: #f0f9ff; --panel: #e0f2fe; --accent: #0ea5e9; --text-main: #0369a1; --msg-bg: #bae6fd; --text-gray: #64748b; }
body.theme-solarized-dark { --bg: #002b36; --panel: #073642; --accent: #268bd2; --text-main: #839496; --msg-bg: #586e75; }
body.theme-military   { --bg: #1a1c1a; --panel: #2d302d; --accent: #a3b18a; --text-main: #dad7cd; --msg-bg: #3a5a40; }
body.theme-retro      { --bg: #2b2d42; --panel: #8d99ae; --accent: #ef233c; --text-main: #edf2f4; --msg-bg: #d90429; }

body, html { background: var(--bg); color: var(--text-main); transition: all 0.3s ease; }

/* Fix pour Google Translate */
body { top: 0px !important; }

/* =========================================================================
 * 2 . HEADER ET NAVIGATION                                      *
 * ========================================================================= */
header {
    height: 70px;
    background: #000;
    border-bottom: 2px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 100;
}

.logo { font-family: 'Orbitron'; font-size: 1.2rem; color: var(--accent); }
.net-stats { font-family: 'Orbitron'; font-size: 0.75rem; display: flex; gap: 20px; }

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-container select {
    background: transparent;
    border: none;
    color: var(--accent);
    padding: 5px;
    font-family: 'Orbitron';
    cursor: pointer;
    font-size: 0.8rem;
    outline: none;
}

.map-link, .home-link, .nav-link, .stats-link {
    color: var(--accent);
    font-size: 1.2rem;
    text-decoration: none;
    transition: 0.3s;
    display: flex;
    align-items: center;
}

.map-link:hover, .home-link:hover, .nav-link:hover, .stats-link:hover {
    color: #fff;
    transform: scale(1.1);
    text-shadow: 0 0 10px var(--accent);
}

/* =========================================================================
 * 3 . LAYOUT GÉNÉRAL                                            *
 * ========================================================================= */
main {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 12px;
    padding: 12px;
    height: calc(100vh - 70px);
    box-sizing: border-box;
}

.col {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-h {
    padding: 15px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--border);
    font-family: 'Orbitron';
    color: var(--accent);
    font-size: 0.85rem;
}

/* =========================================================================
 * 4 . ANNUAIRE RÉSEAU (SIDEBAR GAUCHE)                          *
 * ========================================================================= */
#tg-directory {
flex: 1;
overflow-y: auto;
padding: 10px;
}

.directory-controls {
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}

#region-select {
width: 100%; background: #111; color: var(--accent); border: 1px solid var(--accent);
padding: 8px; font-family: 'Orbitron'; font-size: 0.75rem; border-radius: 4px; outline: none;
}

/* Section Favoris */
.fav-section { border-bottom: 2px solid var(--accent); background: rgba(0, 229, 255, 0.05); margin-bottom: 10px; }
.fav-title { padding: 8px 12px; font-size: 0.7rem; font-family: 'Orbitron'; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.fav-star {
    font-size: 0.7rem;
    margin-right: 6px;
}

.fav-star.active { color: #ffcc00 !important; text-shadow: 0 0 10px #ffcc00; }

/* NIVEAU 1 : RÉGION (CONTINENT) */
.region-group { margin-bottom: 5px; border-radius: 8px; background: rgba(255,255,255,0.02); overflow: hidden; }
.region-header {
    padding: 12px 15px; background: rgba(0, 229, 255, 0.08); cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    font-family: 'Orbitron'; font-size: 0.8rem; color: var(--accent);
}
.region-content { display: none; padding: 5px; background: rgba(0,0,0,0.2); }
.region-group.open .region-content { display: block; }
.region-group.open .region-header .arrow { transform: rotate(180deg); }

/* NIVEAU 2 : PAYS */
.country-nested-group { margin-bottom: 2px; border-radius: 4px; overflow: hidden; }
.country-nested-header {
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #aaa;
}
.country-nested-header:hover { color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.country-nested-content { display: none; padding: 5px 0 5px 20px; background: rgba(0,0,0,0.1); }
.country-nested-group.open .country-nested-content { display: block; }
.country-nested-group.open .fa-chevron-right { transform: rotate(90deg); }
.country-nested-group.open .arrow { transform: rotate(90deg); }

/* Indicateurs d'activité sur les dossiers */
.region-header.has-activity, .country-nested-header.has-activity { color: var(--accent); }
.region-header.is-talking, .country-nested-header.is-talking { color: var(--red); }

/* Éléments TG individuels */
.tg-dir-item {
    padding: 6px 10px; /* Plus fin */
    margin-bottom: 3px;
    background: rgba(255,255,255,0.02);
    border-radius: 4px;
    border-left: 2px solid #333; /* Bordure plus discrète */
    transition: all 0.2s ease;
}

.tg-dir-item:hover {
    background: rgba(255,255,255,0.05);
}

.tg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem; /* Texte plus petit */
    margin-bottom: 2px;
}

.tg-head b {
    color: var(--accent);
    letter-spacing: 0.5px;
}

.tg-desc {
    font-size: 0.65rem; /* Description très fine */
    color: var(--text-gray);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.tg-dir-item.has-people { border-left-color: var(--accent); background: rgba(0, 229, 255, 0.03); }
.tg-dir-item.is-active-tx { border-left-color: var(--red); background: rgba(255, 59, 48, 0.05); }


.directory-footer {
    padding: 15px; background: rgba(0, 229, 255, 0.05); border-top: 1px solid var(--border);
    font-size: 0.75rem; color: var(--text-gray); line-height: 1.4; display: flex; gap: 10px; align-items: flex-start;
}
.directory-footer i { color: var(--accent); margin-top: 2px; }

/* =========================================================================
 * 5 . GRILLE D'ACTIVITÉ (ZONE DROITE)                           *
 * ========================================================================= */
#activity-grid {
display: grid;
grid-template-columns: repeat(auto-fill, 320px); /* CHAQUE CARTE FERA 320px EXACTEMENT */
gap: 15px;
padding: 15px;
overflow-y: auto;
align-content: start;
}

.grid-category-title {
    grid-column: 1 / -1;
    height: 40px;
    display: flex;
    align-items: center;
    background: rgba(0, 229, 255, 0.1);
    color: var(--accent);
    padding: 0 15px;
    font-family: 'Orbitron';
    font-size: 0.85rem;
    border-left: 4px solid var(--accent);
    margin-top: 10px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-sizing: border-box;
}

.grid-category-title:first-child { margin-top: 5px; }

.tg-user-list.notranslate {
    unicode-bidi: isolate;
}

.tg-card {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card-header { padding: 10px; background: rgba(0,0,0,0.3); display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.card-tg-num { font-family: 'Orbitron'; color: var(--tg-active); font-weight: bold; }

.tg-card.active {
    border-color: var(--red);
    box-shadow: 0 0 15px rgba(255, 59, 48, 0.3);
}

.tg-user-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start; /* AJOUTE CETTE LIGNE : Empêche l'étirement */
}

.station-capsule {
    display: flex;
    align-items: center;
    width: 280px;               /* TOUTES LES BULLES FONT 280px */
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Roboto Mono';
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    box-sizing: border-box;
}

.station-capsule.is-talking {
    border-color: var(--red);
    background: rgba(255,59,48,0.15);
    color: var(--red);
    animation: p-red 1.5s infinite;
}

.capsule-time {
    margin-left: auto;          /* Pousse le temps à droite de la bulle de 280px */
    width: 55px;                /* Place fixe pour le chrono (ex: "125m") */
    text-align: right;
    font-size: 0.65rem;
    opacity: 0.4;
}

@keyframes p-red { 50% { box-shadow: 0 0 10px var(--red); } }
.flag-img { width: 18px; height: auto; vertical-align: middle; }

/* =========================================================================
 * 6 . MASQUAGE WIDGET GOOGLE TRANSLATE                          *
 * ========================================================================= */
/* --- MASQUAGE RADICAL GOOGLE (TON CODE) --- */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
#goog-gt-tt.skiptranslate,
.skiptranslate {
    display: none !important;
    visibility: hidden !important;
}

/* Empêche le décalage du haut de page */
body { top: 0px !important; }



/* =========================================================================
 * 7 . SCROLLBARS ET UTILITAIRES                                 *
 * ========================================================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.is-talking { color: var(--red) !important; font-weight: bold; }

/* =========================================================================
 * 8 . OPTIMISATION SMARTPHONE (RESPONSIVE)                      *
 * ========================================================================= */
@media (max-width: 900px) {
    body, html { overflow-y: auto; height: auto; }
    header { height: auto; flex-direction: column; padding: 10px; gap: 10px; }
    .net-stats { width: 100%; justify-content: center; font-size: 0.6rem; }
    .nav-controls { width: 100%; justify-content: center; flex-wrap: wrap; }
    main { grid-template-columns: 1fr; height: auto; display: flex; flex-direction: column; }
    .col { width: 100%; height: auto; }
    #activity-grid { justify-content: center; grid-template-columns: 1fr; }
    .station-capsule { width: 100%; }
}

.fav-filter-btn {
    cursor: pointer;
    transition: 0.3s;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.fav-filter-btn:hover {
    color: var(--accent);
}

.fav-filter-btn.active {
    color: #ffcc00 !important;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}
