:root {
    --bg-color: #050a12;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-color: #e6f1ff;
    --accent-color: #00d2ff;
    --accent-dark: #0077ff;
    --danger-color: #ff4b2b;
    --success-color: #00f260;
}

body, html {
    margin: 0; padding: 0;
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(circle at center, #0a192f 0%, #050a12 100%);
    color: var(--text-color);
    height: 100vh; overflow: hidden;
    display: flex; flex-direction: column;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* =========================================
   STYLE DE LA FENETRE MODALE (LOGIN)
   ========================================= */

/* Le fond sombre qui couvre tout l'écran */
.modal {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;              /* Active le centrage Flexbox */
    justify-content: center;    /* Centre horizontalement */
    align-items: center;        /* Centre verticalement */
    z-index: 1000;
    padding: 20px;              /* Marge de sécurité pour ne pas toucher les bords du tel */
    box-sizing: border-box;
}

/* La carte de connexion elle-même */
.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    
    /* Le secret du Responsive : */
    width: 100%;           /* Essaie de prendre toute la place... */
    max-width: 380px;      /* ...mais s'arrête à 380px max */
    
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Le Logo dans la modale */
.logo-large img.login-logo-img {
    height: 100px;          
    width: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.5));
}

.logo-large h1 { display: none; }

/* Les champs de saisie (Inputs) */
input {
    display: block; 
    width: 100%; 
    padding: 12px; 
    margin: 5px 0; /* Marges réduites pour gagner de la place */
    border: 1px solid var(--glass-border); 
    border-radius: 8px;
    background: rgba(0,0,0,0.3); 
    color: white; 
    outline: none; 
    transition: 0.3s;
    box-sizing: border-box;
}

input:focus { 
    border-color: var(--accent-color); 
    box-shadow: 0 0 10px rgba(0,210,255,0.3); 
}

/* --- OPTIMISATION SPECIALE PAYSAGE (Téléphone couché) --- */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content {
        flex-direction: row;  /* On met Logo à gauche / Champs à droite */
        align-items: center;
        max-width: 600px;     /* On autorise une boîte plus large */
        padding: 1rem;
    }

    .logo-large img.login-logo-img {
        height: 60px;         /* Logo tout petit */
        margin-right: 20px;
    }
    
    .input-group {
        flex: 1;              /* Les champs prennent toute la place restante */
    }
}

/* Header */
header {
    margin: 10px; padding: 15px 25px;
    display: flex; justify-content: space-between; align-items: center;
}
.brand-name { font-weight: 800; font-size: 1.4rem; letter-spacing: 1px; }
.thin { font-weight: 200; color: var(--accent-color); }
.status-badge {
    background: var(--danger-color); color: white; padding: 2px 8px;
    border-radius: 4px; font-size: 0.7rem; margin-left: 10px;
    animation: pulse 2s infinite; vertical-align: middle;
}

/* Grid & Cards */
#participants-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; padding: 20px;
    align-content: center;
}
.participant-card {
    padding: 30px; display: flex; flex-direction: column; align-items: center;
    position: relative; overflow: hidden; transition: 0.4s;
    min-height: 250px; justify-content: space-between;
}
.participant-card:hover { transform: translateY(-5px); border-color: var(--accent-color); }

.avatar {
    width: 100px; height: 100px; border-radius: 50%;
    background: linear-gradient(45deg, var(--accent-dark), var(--accent-color));
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 800; color: white;
    margin-bottom: 15px; position: relative; z-index: 2;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.name { font-weight: 600; font-size: 1.2rem; letter-spacing: 0.5px; margin-bottom: 10px;}

.live-indicator {
    position: absolute; 
    top: 15px; 
    right: 15px;
    background: var(--danger-color); 
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    padding: 4px 8px; 
    border-radius: 4px; 
    opacity: 0; 
    transition: opacity 0.3s;
    z-index: 100; /* FORCE LE BADGE AU PREMIER PLAN */
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); /* Ombre pour lisibilité */
    pointer-events: none; /* Pour pouvoir cliquer au travers si besoin */
}
/* Afficher ON AIR quand le micro est ouvert (via classe JS à venir) */
.speaking .live-indicator { opacity: 1; }

/* VU Meter Horizontal (Style Table de mixage) */
.audio-visualizer {
    width: 100%; height: 8px; background: rgba(0,0,0,0.5);
    border-radius: 4px; overflow: hidden; margin-top: auto;
}
.bar-level {
    height: 100%; width: 0%; 
    background: linear-gradient(90deg, #00f260, #00d2ff, #ff4b2b);
    border-radius: 4px; transition: width 0.05s ease-out; /* Très rapide pour la réactivité */
}

/* Buttons */
button { font-family: 'Montserrat', sans-serif; font-weight: 600; cursor: pointer; border: none; border-radius: 6px;}
.btn-glow { background: var(--accent-color); color: #000; box-shadow: 0 0 15px rgba(0,210,255,0.4); transition: 0.3s; width: 100%; padding: 12px;}
.btn-glow:hover { transform: scale(1.02); background: #fff; }

.control-btn { padding: 10px 25px; color: white; }
.btn-secondary { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.btn-glow-red { background: rgba(220, 53, 69, 0.2); border: 1px solid var(--danger-color); color: var(--danger-color); }
.btn-glow-red:hover { background: var(--danger-color); color: white; box-shadow: 0 0 15px rgba(220, 53, 69, 0.4); }

/* Switch Style */
.switch { position: relative; display: inline-block; width: 50px; height: 26px; margin-left: 10px;}
.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: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(24px); }
.label-text { font-size: 0.8rem; opacity: 0.8; }

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Utilitaires */
.hidden { display: none !important; }

/* --- RESPONSIVE MOBILE (À coller à la fin de style.css) --- */
@media (max-width: 768px) {

    /* 1. La Carte devient un rectangle horizontal compact */
    .participant-card {
        aspect-ratio: auto;           /* On annule le format carré */
        min-height: 70px;             /* Hauteur fixe plus petite */
        flex-direction: row;          /* Avatar à gauche, Nom à droite */
        justify-content: flex-start;  /* Tout aligné à gauche */
        padding: 0 15px;              /* Marges latérales */
        gap: 15px;                    /* Espace entre avatar et nom */
        position: relative;           /* Référence pour les éléments absolus */
        align-items: center;          /* Centrage vertical des éléments */
    }

    /* 2. L'Avatar rétrécit */
    .avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0;             /* Plus de marge en bas */
        flex-shrink: 0;               /* Empêche l'avatar de s'écraser */
        box-shadow: none;             /* On allège le design */
    }

    /* 3. Le Nom s'aligne et prend la place */
    .name {
        font-size: 1rem;
        text-align: left;
        margin-bottom: 0;
        white-space: nowrap;          /* Pas de retour à la ligne */
        overflow: hidden;             /* Coupe si trop long */
        text-overflow: ellipsis;      /* Ajoute "..." */
        max-width: 50%;               /* Laisse de la place pour le ON AIR */
        z-index: 5;
    }

    /* 4. LE SECRET DU BADGE "ON AIR" */
    /* On casse le lien avec l'avatar pour qu'il se positionne sur la CARTE */
    .avatar-container {
        position: static;             /* L'astuce est ici ! */
        display: flex;                /* Garde l'avatar propre */
        align-items: center;
    }

    /* Positionnement du badge tout à droite */
    .participant-card .live-indicator {
        top: 50%;                     /* Milieu vertical */
        right: 15px;                  /* Collé à droite */
        transform: translateY(-50%);  /* Centrage parfait */
        font-size: 0.6rem;
        padding: 4px 8px;
        opacity: 0;                   /* Caché par défaut */
        z-index: 100;                 /* AU-DESSUS DE TOUT */
    }
    
    /* Affichage quand on parle */
    .speaking .live-indicator {
        opacity: 1;
    }

    /* 5. Le Vumètre (Barre fine tout en bas) */
    .audio-visualizer {
        position: absolute;           /* Sort du flux normal */
        bottom: 0;                    /* Collé tout en bas */
        left: 0;
        width: 100%;                  /* Toute la largeur */
        height: 4px;                  /* Très fin pour ne pas gêner */
        margin-top: 0;
        border-radius: 0 0 8px 8px;   /* Arrondi uniquement en bas */
        z-index: 10;
    }

    /* 6. Ajustement de la grille et du Header */
    #participants-grid {
        grid-template-columns: 1fr;   /* Une seule colonne */
        gap: 10px;
        padding-bottom: 80px;         /* Espace pour scroller */
    }

    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .brand-name { font-size: 1.2rem; }
}
/* =========================================
   A COLLER A LA FIN DE STYLE.CSS
   ========================================= */

/* --- 1. STYLE DU LOGO (PAGE D'ACCUEIL) --- */
.logo-large img.login-logo-img {
    height: 120px;          /* Taille idéale pour le logo */
    width: auto;            /* Garde les proportions */
    display: block;         /* Permet de centrer l'image */
    margin: 0 auto 20px;    /* Centré horizontalement + marge en bas */
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.5)); /* Lueur bleue "Studio" */
}

/* On cache le texte du titre pour ne laisser que l'image */
.logo-large h1 {
    display: none;
}

/* --- 2. RESPONSIVE MOBILE (MODE LISTE PROPRE) --- */
@media (max-width: 768px) {

    /* La Carte devient un rectangle horizontal compact */
    .participant-card {
        aspect-ratio: auto;           /* On annule le format carré */
        min-height: 70px;             /* Hauteur fixe plus petite */
        flex-direction: row;          /* Avatar à gauche, Nom à droite */
        justify-content: flex-start;  /* Tout aligné à gauche */
        padding: 0 15px;              /* Marges latérales */
        gap: 15px;                    /* Espace entre avatar et nom */
        position: relative;           /* Référence pour les éléments absolus */
        align-items: center;          /* Centrage vertical des éléments */
    }

    /* L'Avatar rétrécit pour tenir sur l'écran */
    .avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0;             /* Plus de marge en bas */
        flex-shrink: 0;               /* Empêche l'avatar de s'écraser */
        box-shadow: none;
    }

    /* Le Nom s'aligne et prend la place */
    .name {
        font-size: 1rem;
        text-align: left;
        margin-bottom: 0;
        white-space: nowrap;          /* Pas de retour à la ligne */
        overflow: hidden;             /* Coupe si trop long */
        text-overflow: ellipsis;      /* Ajoute "..." */
        max-width: 55%;               /* Laisse de la place pour le ON AIR */
        z-index: 5;
    }

    /* LE SECRET DU BADGE "ON AIR" */
    /* On casse le lien avec l'avatar pour qu'il se positionne sur la CARTE */
    .avatar-container {
        position: static;             /* L'astuce est ici ! */
        display: flex;
        align-items: center;
    }

    /* Positionnement du badge tout à droite */
    .participant-card .live-indicator {
        top: 50%;                     /* Milieu vertical */
        right: 15px;                  /* Collé à droite */
        transform: translateY(-50%);  /* Centrage parfait */
        font-size: 0.6rem;
        padding: 4px 8px;
        z-index: 100;                 /* AU-DESSUS DE TOUT */
    }

    /* Le Vumètre (Barre fine tout en bas) */
    .audio-visualizer {
        position: absolute;           /* Sort du flux normal */
        bottom: 0;                    /* Collé tout en bas */
        left: 0;
        width: 100%;                  /* Toute la largeur */
        height: 4px;                  /* Très fin pour ne pas gêner */
        margin-top: 0;
        border-radius: 0 0 8px 8px;   /* Arrondi uniquement en bas */
        z-index: 10;
    }

    /* Ajustement de la grille et du Header */
    #participants-grid {
        grid-template-columns: 1fr;   /* Une seule colonne */
        gap: 10px;
        padding-bottom: 80px;         /* Espace pour scroller */
    }

    header {
        flex-direction: column;
        gap: 15px;
    }
}
