/* ==========================================================================
   🛠️ 1. CONFIGURATION, IMPORTS ET VARIABLES (Charte Graphique Focal)
   ========================================================================== */
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

/* Déclarations des polices locales (RGPD Compliant) */
@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/ubuntu-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu';
    font-style: italic;
    font-weight: 400;
    src: url('/fonts/ubuntu-italic.woff2') format('woff2');
}

@font-face {
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 700;
    src: url('/fonts/ubuntu-bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Exo';
    font-style: normal;
    font-weight: 600;
    src: url('/fonts/exo-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Exo';
    font-style: normal;
    font-weight: 800;
    src: url('/fonts/exo-800.woff2') format('woff2');
}

:root {
    --almeris-dark: #2e0a37;
    /* Fond principal */
    --almeris-medium: #521262;
    /* Sidebar & Cartes */
    --almeris-light: #761a8d;
    /* Survol des boutons */
    --almeris-bright: #9a22b8;
    /* Accents primaires */

    --text-pure: #ffffff;
    --text-muted: #e6e6e6;
    --border-subtle: rgba(255, 255, 255, 0.1);

    /* Couleur générique pour les actions destructrices/erreurs */
    --color-danger: #e62117;

    --sidebar-width: 240px;
}

/* ==========================================================================
   🧱 2. SQUELETTE ET BASES GLOBALES (Layout en Flexbox pour Sidebar)
   ========================================================================== */
body {
    font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--almeris-dark);
    color: var(--text-muted);
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
}

/* Zone de contenu principale décalée à droite de la Sidebar */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    min-width: 0;
}

/* Remplacement de l'ancien .container par .content-wrapper pour l'alignement */
.content-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Exo', sans-serif;
    font-weight: 800;
    color: var(--text-pure);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 5px;
}

.hidden {
    display: none !important;
}

/* Scrollbars */
.viewer-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.viewer-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.viewer-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--almeris-bright);
    border-radius: 3px;
}

/* ==========================================================================
   🎛️ 3. COMPOSANTS INTERFACES LATÉRAUX (Sidebar Verticale)
   ========================================================================== */

/* Conteneur vertical de la Sidebar */
#navbar-placeholder {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--almeris-medium);
    border-right: 1px solid var(--border-subtle);
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 30px 15px;
    box-sizing: border-box;
    gap: 8px;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

/* Scrollbars */
#navbar-placeholder::-webkit-scrollbar,
.viewer-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

#navbar-placeholder::-webkit-scrollbar-track,
.viewer-list::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#navbar-placeholder::-webkit-scrollbar-thumb,
.viewer-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--almeris-bright);
    border-radius: 3px;
}

/* Titre de l'application ancré en haut de la Sidebar */
.sidebar-brand {
    display: block;
    /* ⚡ Permet au lien de prendre toute la largeur */
    text-decoration: none;
    /* ⚡ Retire le soulignement du lien */
    font-family: 'Exo', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--text-pure);
    text-align: center;
    margin-top: 30px;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 2px solid var(--almeris-bright);
    padding-bottom: 24px;
}

/* Boutons verticaux de navigation */
.nav-link {
    font-family: 'Exo', sans-serif;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-pure);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Titres des catégories du menu (Tiroirs cliquables) */
.nav-category-header {
    font-family: 'Exo', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
    padding: 8px 10px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
    /* Empêche la sélection du texte au double-clic */
}

.nav-category-header:hover {
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.05);
}

.nav-category-header.open {
    color: var(--text-pure);
    margin-bottom: 4px;
}

.nav-category-header .chevron-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* Rotation de l'icône quand le tiroir est ouvert */
.nav-category-header.open .chevron-icon {
    transform: rotate(180deg);
}

/* Conteneur masqué des liens */
.nav-category-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* Ouverture fluide */
.nav-category-content.open {
    max-height: 500px;
    /* Valeur suffisamment grande pour révéler tous les liens */
    transition: max-height 0.4s ease-in;
}

/* Bouton de déconnexion (Simplifié) */
#logout-btn {
    margin-top: 10px;
    border: 1px solid rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.02);
}

#logout-btn:hover {
    background: rgba(255, 77, 77, 0.1);
    border-color: #ff0055;
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.15);
}

/* Éléments de structure restants inchangés */
.stats-bar {
    background: var(--almeris-medium);
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-pure);
    border-left: 5px solid var(--almeris-bright);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   🧩 COMPOSANTS PARTAGÉS RESTAURÉS (Recherche, Boutons, Badges)
   ========================================================================== */

/* Saisie de recherche générique */
.search-box {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--almeris-medium);
    border-radius: 8px;
    color: var(--text-pure);
    font-size: 1rem;
    font-family: 'Ubuntu', sans-serif;
    box-sizing: border-box;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--almeris-bright);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(154, 34, 184, 0.3);
}

/* Bouton Toggle d'override matériel "ON AIR" */
.onair-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: 'Exo', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onair-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.onair-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #666666;
    transition: all 0.3s ease;
    display: inline-block;
}

.onair-btn.active {
    border-color: rgba(255, 0, 0, 0.4);
    background: rgba(255, 0, 0, 0.1);
    color: var(--text-pure);
}

.onair-btn.active .onair-indicator {
    background: #ff0055;
    box-shadow: 0 0 12px #ff0055;
    animation: pulseOnAir 1.5s infinite;
}

/* Couleurs des badges et icônes réseaux unifiés */
.platform-icon {
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    color: #ffffff !important;
}

.platform-badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Tag de présence temporelle relative */
.last-seen-tag {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    margin-left: 6px;
}

/* ==========================================================================
   🏠 4. MODULE : ACCUEIL HUB DE LA CONSOLE (/index.html)
   ========================================================================== */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.hub-card {
    background: var(--almeris-medium);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hub-card:hover {
    transform: translateY(-4px);
    border-color: var(--almeris-bright);
    box-shadow: 0 8px 25px rgba(154, 34, 184, 0.15);
}

.hub-card h2 {
    margin: 0 0 10px 0;
    color: var(--text-pure);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-card p {
    margin: 0 0 20px 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.hub-btn {
    align-self: flex-start;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--almeris-light);
    border-radius: 6px;
    font-weight: 600;
    color: var(--text-pure);
    transition: background 0.2s;
}

.hub-card:hover .hub-btn {
    background: var(--almeris-bright);
    border-color: var(--almeris-bright);
}

/* ==========================================================================
   💬 5. MODULE : CHAT COMBINÉ ET FUSIONNÉ (/chat)
   ========================================================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 65vh;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid var(--almeris-medium);
    border-radius: 8px;
    margin-top: 20px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
}

.message-item {
    margin-bottom: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    border-left: 3px solid transparent;
}

.msg-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.msg-author {
    font-weight: 700;
}

.msg-text {
    color: var(--text-pure);
    word-break: break-word;
}

/* ==========================================================================
   🎬 9. STYLES EXCLUSIFS ET COMPACITÉ POUR LES DOCKS OBS STUDIO (?obs=true)
   ========================================================================== */

body.obs-mode {
    display: block;
    /* Désactive la Sidebar Flexbox pour maximiser l'espace OBS */
    padding: 10px !important;
    /* Marges ultra-réduites pour les petits docks */
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* On retire totalement les marges du body pour le Chat */
body.obs-mode.page-chat {
    padding: 0 !important;
}

/* ⚡ EFFACEMENT PHYSIQUE ET STRICT DE LA SIDEBAR SUR OBS */
body.obs-mode #navbar-placeholder,
body.obs-mode .nav-menu {
    display: none !important;
}

/* Redimensionnement fluide de la zone principale */
body.obs-mode .main-content {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: 100%;
}

body.obs-mode .content-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Optimisation de la barre d'état sous OBS */
body.obs-mode .stats-bar {
    padding: 8px 12px;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

body.obs-mode .platform-icon {
    font-size: 0.9rem;
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

body.obs-mode .platform-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
}

/* ==========================================================================
   🌀 10. ANIMATIONS ET KEYFRAMES SÉCURISÉES
   ========================================================================== */
@keyframes pulseOnAir {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

@keyframes highlightPop {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   🔐 11. MODULE : AUTHENTIFICATION (/login)
   ========================================================================== */
/* ==========================================================================
   🔐 11. MODULE : AUTHENTIFICATION (/login)
   ========================================================================== */
.login-body {
    display: flex;
    flex-direction: column;
    /* ⚡ Aligne le header et le contenu verticalement */
    min-height: 100vh;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: radial-gradient(circle at center, var(--almeris-medium) 0%, var(--almeris-dark) 100%);
}

.login-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.login-card {
    background: rgba(46, 10, 55, 0.6);
    border: 1px solid var(--border-subtle);
    border-top: 4px solid var(--almeris-bright);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    animation: loginFadeIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-card h2 {
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.login-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-family: 'Exo', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-pure);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-pure);
    font-family: 'Ubuntu', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.login-input:focus {
    outline: none;
    border-color: var(--almeris-bright);
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 8px rgba(154, 34, 184, 0.4);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--almeris-bright);
    border: 1px solid var(--almeris-bright);
    border-radius: 6px;
    color: var(--text-pure);
    font-family: 'Exo', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #af2fd0;
    border-color: #af2fd0;
    box-shadow: 0 0 15px rgba(154, 34, 184, 0.5);
}

.submit-btn:disabled {
    background: #555 !important;
    border-color: #555 !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.error-banner {
    background: rgba(230, 33, 23, 0.15);
    border: 1px solid rgba(230, 33, 23, 0.4);
    border-left: 4px solid var(--color-danger);
    padding: 10px 14px;
    border-radius: 4px;
    color: #ff4d4d;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
}

.success-banner {
    background: rgba(0, 202, 157, 0.15);
    border: 1px solid rgba(0, 202, 157, 0.4);
    border-left: 4px solid #00ffcc;
    padding: 10px 14px;
    border-radius: 4px;
    color: #00ffcc;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: none;
}

.toggle-mode-container {
    margin-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

.toggle-mode-link {
    color: var(--almeris-bright);
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.toggle-mode-link:hover {
    color: #ff0055;
    text-decoration: underline;
}

/* ⚡ Classes propres pour la case à cocher (remplace le style inline) */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
}

.login-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--almeris-bright);
    cursor: pointer;
}

.checkbox-label {
    margin: 0 !important;
    text-transform: none !important;
    font-weight: 400 !important;
    cursor: pointer;
    letter-spacing: 0 !important;
}

@keyframes loginFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   🔔 12. TOAST NOTIFICATIONS GLOBALES (AppCore)
   ========================================================================== */
.focal-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--almeris-medium);
    color: var(--text-pure);
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border-subtle);
}

.focal-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.focal-toast.toast-error {
    border-left: 5px solid #ff4d4d;
}

.focal-toast.toast-error i {
    color: #ff4d4d;
    font-size: 1.2rem;
}

.focal-toast.toast-success {
    border-left: 5px solid #00ffcc;
}

.focal-toast.toast-success i {
    color: #00ffcc;
    font-size: 1.2rem;
}

/* ==========================================================================
   ⚙️ 13. PARAMÈTRES FLOTTANTS (OBS DOCKS / WIDGETS)
   ========================================================================== */
.floating-settings-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    opacity: 0.3;
    /* Discret par défaut pour ne pas gêner sur OBS */
}

.chat-container {
    position: relative;
}

/* Nécessaire pour ancrer le bouton */

.chat-container:hover .floating-settings-btn,
.floating-settings-btn:hover {
    opacity: 1;
}

.floating-settings-btn:hover {
    background: var(--almeris-bright);
    color: var(--text-pure);
    border-color: var(--almeris-bright);
    transform: rotate(45deg);
}

.settings-panel {
    position: absolute;
    top: 55px;
    right: 15px;
    background: rgba(46, 10, 55, 0.95);
    border: 1px solid var(--almeris-bright);
    border-radius: 8px;
    padding: 15px;
    width: 250px;
    z-index: 101;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top right;
}

.settings-panel.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.settings-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #00ffcc;
}

.btn-close-settings {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

.btn-close-settings:hover {
    color: #ff4d4d;
}

.setting-row {
    margin-bottom: 15px;
}

.setting-row label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: var(--text-pure);
    font-family: 'Exo', sans-serif;
}

.setting-row input[type="range"] {
    width: 100%;
    accent-color: var(--almeris-bright);
    cursor: pointer;
}

.setting-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.setting-checkbox-row input[type="checkbox"] {
    accent-color: var(--almeris-bright);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.setting-checkbox-row label {
    margin: 0;
    cursor: pointer;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85rem;
}

/* --- MODIFICATEURS DYNAMIQUES DU CHAT --- */
.chat-messages {
    --chat-font-size: 16px;
    /* Modifié par le JS */
}

.message-item {
    font-size: var(--chat-font-size);
}

.msg-time {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.4);
    margin-right: 6px;
    font-family: 'Ubuntu', monospace;
    display: none;
    /* Masqué par défaut */
}

/* Classes de bascule gérées par le JS */
.chat-messages.show-timestamps .msg-time {
    display: inline-block;
}

/* ==========================================================================
   🔑 14. MODULE : GESTION DES INTÉGRATIONS API (/platforms)
   ========================================================================== */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.platform-manage-card {
    background: var(--almeris-medium);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.platform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.platform-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    margin: 0;
}

.status-indicator-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-connected {
    background: rgba(0, 255, 204, 0.15);
    color: #00ffcc;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.status-disconnected {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-subtle);
}

.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    border-radius: 6px;
    margin-top: 15px;
    margin-bottom: 25px;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Boutons d'action */
.platform-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    display: block;
    text-align: center;
    text-decoration: none;
    font-family: 'Exo', sans-serif;
    font-weight: 700;
    padding: 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.95rem;
}

.btn-connect {
    background: var(--almeris-bright);
    color: #fff;
}

.btn-connect:hover {
    background: #af2fd0;
    box-shadow: 0 0 12px rgba(154, 34, 184, 0.4);
}

.btn-disconnect {
    background: rgba(230, 33, 23, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(230, 33, 23, 0.3);
}

.btn-disconnect:hover {
    background: rgba(230, 33, 23, 0.2);
    border-color: var(--color-danger);
}

/* Le Switch iOS-like pour le respect du RGPD */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #00ffcc;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

input:disabled+.slider {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================================================
   👤 17. MODULE : PROFIL UTILISATEUR (/profile)
   ========================================================================== */
.avatar-upload-group {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--almeris-bright);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 2rem;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ==========================================================================
   🌐 18. ACTIONS FIXES ET SÉLECTEUR DE LANGUE (i18n)
   ========================================================================== */
.sidebar-bottom-actions {
    margin-top: auto;
    /* ⚡ Pousse tout ce bloc tout en bas de la barre latérale */
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-shrink: 0;
}

.lang-selector-container {
    padding-top: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 1px solid var(--border-subtle);
}

.lang-select {
    background: var(--almeris-dark);
    color: var(--text-pure);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Ubuntu', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.lang-select:focus {
    border-color: var(--almeris-bright);
}

/* ==========================================================================
   🚀 19. PAGE DE PRÉSENTATION PUBLIQUE (LANDING PAGE)
   ========================================================================== */
.landing-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at top, #3b0d47 0%, var(--almeris-dark) 80%);
    overflow-x: hidden;
    overflow-y: auto;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(46, 10, 55, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.landing-brand {
    text-decoration: none;
    font-family: 'Exo', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-pure);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.landing-nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.landing-hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #00ffcc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.landing-btn-primary {
    background: var(--almeris-bright);
    color: #fff;
    padding: 16px 32px;
    border-radius: 30px;
    text-decoration: none;
    font-family: 'Exo', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 8px 25px rgba(154, 34, 184, 0.4);
    transition: all 0.3s ease;
}

.landing-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(154, 34, 184, 0.6);
    background: #af2fd0;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 40px 50px 80px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-top: 3px solid #00ffcc;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.landing-feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 255, 204, 0.4);
}

.landing-feature-card i {
    font-size: 2.5rem;
    color: #00ffcc;
    margin-bottom: 20px;
    display: inline-block;
}

.landing-feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.landing-feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.landing-footer {
    text-align: center;
    padding: 30px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   📱 20. RESPONSIVE DESIGN (Mobiles & Tablettes)
   ========================================================================== */

/* Bouton Hamburger (Masqué par défaut sur Desktop) */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-pure);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 10px 0 0;
}

/* Overlay sombre derrière le menu mobile */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {

    /* 1. Affichage du bouton Hamburger */
    .mobile-menu-btn {
        display: block !important;
    }

    /* 2. Transformation de la Sidebar en menu coulissant (Off-Canvas) */
    #navbar-placeholder {
        position: fixed;
        left: -280px;
        /* Masqué hors de l'écran */
        top: 0;
        bottom: 0;
        z-index: 9999;
        transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1);
        box-shadow: none;
        width: 260px;
    }

    #navbar-placeholder.mobile-open {
        left: 0;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
    }

    /* 3. Réduction des marges pour maximiser l'espace de contenu */
    .main-content {
        padding: 15px !important;
    }

    .stats-bar {
        padding: 12px;
        font-size: 0.95rem;
        flex-wrap: wrap;
        /* Le bouton OnAir passe à la ligne si besoin */
        gap: 10px;
    }

    .content-wrapper {
        padding-bottom: 30px;
    }

    /* 4. Comportement des Grilles et Formulaires */
    .hub-grid,
    .kpi-grid,
    .platform-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hub-card,
    .platform-manage-card,
    .player-form-card,
    .login-card {
        padding: 15px;
    }

    /* 5. Ajustements Chat Combiné */
    .chat-container {
        height: calc(100vh - 160px);
        margin-top: 10px;
    }

    .chat-input-area {
        flex-wrap: wrap;
    }

    .chat-input-form {
        width: 100%;
    }

    /* 6. Ajustements Statistiques */
    .chart-container {
        height: 300px !important;
        padding: 10px;
    }
}