/* === Corps de page === */
body {
    background-color: #1e1e1e;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

/* === Conteneur principal === */
.container, body {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

/* === Titres === */
h1 {
    text-align: center;
    color: #9b59b6;
}

/* === Boutons === */
button {
    background-color: #444;
    color: #e0e0e0;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s, transform 0.1s;
}
button:hover:not(:disabled) { background-color: #6c5ce7; transform: translateY(-2px);}
button:disabled { background-color: #555; cursor: not-allowed; }

/* === Status === */
#status {
    display: inline-block;
    margin-left: 10px;
    font-weight: bold;
}

/* === Textarea dictée === */
textarea#transcript {
    width: 100%;
    height: 200px;
    background-color: #1e1e1e;
    color: #f5f5f5;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    font-size: 1rem;
    resize: vertical;
}
textarea#transcript::-webkit-scrollbar { width: 10px; }
textarea#transcript::-webkit-scrollbar-track { background: #2c2c2c; border-radius: 8px; }
textarea#transcript::-webkit-scrollbar-thumb { background: #6c5ce7; border-radius: 8px; }
textarea#transcript::-webkit-scrollbar-thumb:hover { background: #9b59b6; }

/* === Filtres === */
.filters {
    margin: 15px 0;
}
.filters label { margin-right: 15px; }

/* === Tableau === */
table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.9rem;
}
table th, table td {
    padding: 8px;
    border: 1px solid #444;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
table td:hover { overflow: visible; white-space: normal; position: relative; z-index: 10; background-color: #2c2c2c; }

/* === Modale === */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}
.modal-content {
    background-color: #2c2c2c;
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    width: 80%;
    max-width: 700px;
    color: #e0e0e0;
}
.close {
    color: #e0e0e0;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}
.close:hover { color: #9b59b6; }

/* === Audio modale === */
#modalAudio {
    width: 100%;
    margin-top: 10px;
}

/* === Responsive === */
@media(max-width: 600px){
    button { padding: 8px 16px; font-size: 0.9rem; }
    textarea#transcript { height: 150px; }
    .modal-content { width: 95%; margin-top: 20%; }
    .controls button {
        font-size: 0.8rem;
        padding: 6px 4px;
    }
}
#modalText {
    white-space: pre-wrap; /* garde les sauts de ligne et passe à la ligne automatiquement */
    word-break: break-word; /* coupe si la phrase est trop longue */
}
.copyBtn.copied {
    background-color: #4caf50;
    color: white;
}

/* === Barre de contrôle boutons === */
.controls {
    display: flex;
    flex-wrap: nowrap;          /* une seule ligne */
    justify-content: space-between; /* répartir les boutons sur toute la largeur */
    align-items: center;
    gap: 5px;
    width: 100%;
}

/* Boutons dans la barre */
.controls button {
    flex: 1 1 auto;             /* chaque bouton prend une part égale */
    white-space: nowrap;         /* texte sur une seule ligne */
    overflow: hidden;            /* couper le texte si trop long */
    text-overflow: ellipsis;     /* ajout "..." si le texte est trop long */
    padding: 8px 5px;            /* réduire un peu le padding horizontal */
    font-size: 0.9rem;           /* taille un peu plus petite pour tout tenir */
    min-width: 0;                /* important pour que flex-shrink fonctionne */
}


/* Texte à l'intérieur du bouton (pour animation/état) */
.controls button span.btnText {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bouton Admin aligné avec les autres */
#adminBtn {
    background-color: #6c5ce7;
    color: #fff;
    font-weight: bold;
}

/* Modal admin */
#adminModal .modal-content input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

#adminModal .modal-content button {
    margin-top: 5px;
}

#userList div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 5px 10px;
    background-color: #2c2c2c;
    border-radius: 6px;
}

#userList button {
    background-color: #e74c3c;
    color: #fff;
    padding: 4px 8px;
    font-size: 0.9rem;
}

#userList button:hover { background-color: #c0392b; }
