/* Importation des polices Google Fonts pour un look rock/grunge professionnel */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Oswald:wght@400;700&family=Roboto+Condensed:wght@404;700&family=Open+Sans:wght@400;700&display=swap');

/* --- Généralités & Reset de base (Garde une base propre) --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif; /* Reste lisible pour le corps */
    line-height: 1.6;
    color: #c0c0c0; /* Gris clair pour le texte sur fond sombre */
    background-color: #1a1a1a; /* Fond très sombre, presque noir */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* S'assure qu'il n'y a pas de défilement horizontal global */
    /* Ajout d'une texture subtile pour le côté grunge */
    background-image: url('data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%232d2d2d" fill-opacity="0.4"%3E%3Cpath d="M3 0L0 3l3 3L6 3z"/%3E%3C/g%3E%3C/svg%3E'); /* Texture subtile de grain */
}

/* --- Header (En-tête) --- */
header {
    background-color: #0d0d0d; /* Noir plus profond */
    color: #e0e0e0; /* Blanc cassé pour le texte */
    padding: 25px 0; /* Un peu plus de padding pour donner de l'ampleur */
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5); /* Ombre plus prononcée */
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-bottom: 2px solid #555555; /* Bordure épaisse pour un look plus brut */
}

.header-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    gap: 20px; /* Plus d'espacement */
}

header h1 {
    font-family: 'Anton', sans-serif; /* Police très impactante */
    font-size: 3.8em; /* Plus grand */
    letter-spacing: 3px; /* Espacement de lettres */
    font-weight: 700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7); /* Ombre plus marquée */
    margin: 0;
    flex-shrink: 0;
    white-space: nowrap;
    text-transform: uppercase; /* Tout en majuscules */
    color: #e74c3c; /* Un rouge sombre et percutant */
}

/* --- Navigation Principale (Onglets) --- */
.main-nav {
    display: flex;
    justify-content: center; /* Assure que les boutons sont centrés */
    align-items: center;
    flex-wrap: wrap; /* Par défaut, les éléments s'enveloppent */
    gap: 15px; /* Garde l'espacement */
    margin-top: 0;
    flex-grow: 1;
}

.main-nav .tab-button {
    background-color: #2d2d2d; /* Gris foncé charbon */
    color: #e0e0e0;
    text-decoration: none;
    padding: 14px 30px; /* Plus grand */
    border: 1px solid #555555; /* Bordure visible */
    border-radius: 4px; /* Moins arrondi pour un look plus brut */
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif; /* Police condensée */
    font-size: 1.1em; /* Légèrement plus grand */
    font-weight: 700; /* Plus épais */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); /* Ombre plus intense */
    white-space: nowrap;
    text-transform: uppercase; /* Majuscules */
}

.main-nav .tab-button:hover {
    background-color: #4a4a4a; /* Gris plus clair au survol */
    transform: translateY(-4px) scale(1.02); /* Souligne le mouvement */
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
    color: #ffda6a; /* Jaune-orangé légèrement éteint */
}

.main-nav .tab-button.active {
    background-color: #e74c3c; /* Rouge percutant pour l'actif */
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.4);
    transform: translateY(-2px);
    font-weight: 700;
    pointer-events: none;
    color: #1a1a1a; /* Texte noir sur rouge actif */
    border-color: #e74c3c;
}

/* Contrôles d'authentification */
#auth-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    margin-top: 0;
    flex-shrink: 0;
}

#logged-in-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #888888; /* Gris sombre pour l'info user */
    font-size: 0.95em;
    white-space: nowrap;
}
#logged-in-user-info strong {
    color: #e0e0e0; /* Plus clair pour le nom */
    font-weight: 700;
}
#logout-button, #login-nav-button {
    background-color: #e74c3c; /* Rouge sombre */
    padding: 10px 20px;
    font-size: 0.9em;
    border: 1px solid #c0392b; /* Bordure rouge plus foncée */
    border-radius: 4px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
    color: #1a1a1a; /* Texte noir */
    font-weight: 700;
    text-transform: uppercase;
}
#login-nav-button {
    background-color: #27ae60; /* Vert sombre */
    border-color: #1e8449;
    color: #1a1a1a;
}
#logout-button:hover {
    background-color: #c0392b; /* Rouge encore plus foncé */
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}
#login-nav-button:hover {
    background-color: #1e8449;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}


/* --- Main (Contenu Principal) --- */
main {
    flex-grow: 1;
    max-width: 1200px;
    margin: 40px auto; /* Centré horizontalement */
    padding: 35px; /* Plus de padding */
    background-color: #222222; /* Fond sombre pour le contenu */
    border-radius: 8px; /* Bords légèrement arrondis */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6); /* Ombre très prononcée */
    border: 1px solid #444444; /* Bordure subtile */
    /* Ajout d'une texture interne si désiré */
    background-image: url('data:image/svg+xml,%3Csvg width="6" height="6" viewBox="0 0 6 6" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%23333333" fill-opacity="0.05"%3E%3Cpath d="M3 0L0 3l3 3L6 3z"/%3E%3C/g%3E%3C/svg%3E');
    width: 100%; /* S'assure que le main ne déborde pas */
}

/* Conteneur des onglets */
.tabs-container {
    margin-top: 25px;
}

/* Contenu des onglets (sections individuelles) */
.tab-content {
    display: none;
    padding: 35px 0;
    width: 100%; /* S'assure que le contenu de l'onglet ne déborde pas */
}

.tab-content.active {
    display: block;
}

/* Titres de section */
h2 {
    font-family: 'Oswald', sans-serif; /* Police audacieuse */
    color: #ffda6a; /* Jaune-orangé pour les titres majeurs */
    text-align: center;
    margin-bottom: 45px;
    font-size: 3em; /* Très grand */
    font-weight: 700;
    position: relative;
    padding-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
h2::after {
    content: '';
    display: block;
    width: 100px; /* Plus large */
    height: 6px; /* Plus épais */
    background-color: #e74c3c; /* Ligne rouge */
    margin: 20px auto 0; /* Centré horizontalement */
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

h3 {
    font-family: 'Roboto Condensed', sans-serif;
    color: #d0d0d0; /* Gris clair */
    font-size: 2.2em; /* Plus grand */
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed #555555; /* Bordure discrète */
    padding-bottom: 15px;
}

/* --- Formulaires de Contenu --- */
.content-form-section {
    max-width: 750px;
    margin: 50px auto 70px auto; /* Centré horizontalement */
    padding: 40px;
    background-color: #2b2b2b; /* Fond du formulaire sombre */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: left;
    border: 1px solid #444444;
    width: 100%; /* S'assure que le formulaire ne déborde pas */
    position: relative; /* Assuré que les z-index des enfants fonctionnent */
    overflow: visible; /* Assuré que le dropdown ne soit pas coupé */
}
.content-form-section h3 {
    color: #e74c3c; /* Rouge pour le titre du formulaire */
    margin-bottom: 35px;
    text-align: center;
}
.content-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #b0b0b0; /* Gris clair */
    font-size: 1.1em;
    text-transform: uppercase;
}
.content-form input[type="text"],
.content-form textarea,
.content-form input[type="url"],
.content-form input[type="date"],
.content-form input[type="time"],
.content-form input[type="email"],
.content-form input[type="password"]
{
    width: 100%;
    padding: 16px; /* Plus grand */
    margin-bottom: 25px;
    border: 1px solid #555555; /* Bordure sombre */
    border-radius: 4px;
    font-size: 1.05em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #1a1a1a; /* Fond des inputs très sombre */
    color: #e0e0e0; /* Texte clair dans les inputs */
}
.content-form input:focus,
.content-form textarea:focus {
    border-color: #ffda6a; /* Bordure jaune-orangé au focus */
    box-shadow: 0 0 0 4px rgba(255, 218, 106, 0.3); /* Ombre de focus plus prononcée */
    outline: none;
}
.content-form textarea {
    resize: vertical;
    min-height: 150px; /* Plus haut */
}
.content-form button {
    padding: 16px 35px; /* Plus grand */
    background-color: #27ae60; /* Vert foncé */
    color: #1a1a1a; /* Texte noir */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25em; /* Plus grand */
    font-weight: 700; /* Plus épais */
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: block; /* Rend le bouton block pour margin: auto */
    width: auto;
    margin: 25px auto 0; /* Centre le bouton horizontalement */
    box-shadow: 0 5px 12px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
}
.content-form button:hover {
    background-color: #1e8449; /* Vert encore plus foncé */
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(39, 174, 96, 0.4);
}
.info-text {
    font-size: 0.95em;
    color: #888;
    margin-top: 30px;
    text-align: center;
}
.error-message {
    color: #e74c3c; /* Rouge d'erreur */
    font-size: 1em;
    margin-top: 12px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}
.info-message {
    color: #ffda6a; /* Jaune-orangé pour les messages info */
    font-size: 1.1em;
    padding: 25px;
    background-color: #2b2b2b;
    border: 1px solid #444444;
    border-radius: 10px;
    margin: 35px auto; /* Centré horizontalement */
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}


/* --- Listes de Contenu (Matériel, Répétitions, Morceaux) --- */
.content-list {
    display: grid;
    /* Pour le matériel, restons sur une taille raisonnable */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    justify-content: center; /* Centre les éléments de la grille */
    margin-top: 35px;
}

.list-item {
    background-color: #2b2b2b;
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%; /* S'assure que les list-item ne débordent pas */
}
.list-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.6);
    border-color: #e74c3c;
}

.list-item h4 {
    font-family: 'Oswald', sans-serif;
    color: #e74c3c;
    margin-top: 0;
    font-size: 1.5em;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-item p {
    font-size: 0.95em;
    color: #b0b0b0;
    margin-bottom: 10px;
    flex-grow: 1;
}

.list-item a {
    display: inline-block;
    background-color: #ffda6a;
    color: #1a1a1a;
    padding: 10px 18px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: 15px;
    font-size: 0.9em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}
.list-item a:hover {
    background-color: #e6c25e;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.list-item .meta-info {
    font-size: 0.85em;
    color: #888;
    margin-top: 18px;
    text-align: right;
    border-top: 1px solid #555555;
    padding-top: 10px;
}

/* --- Styles spécifiques pour les MORCEAUX (plus petits) --- */
#songs-section .content-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* Plus de colonnes, taille min plus petite */
    gap: 15px; /* Écart réduit */
}

#songs-section .list-item {
    padding: 15px; /* Encore moins de padding */
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3); /* Ombre plus légère */
}

#songs-section .list-item h4 {
    font-size: 1.2em; /* Taille du titre plus petite */
    margin-bottom: 8px; /* Marge réduite */
}

#songs-section .list-item p {
    font-size: 0.9em; /* Taille du texte du paragraphe plus petite */
    margin-bottom: 8px; /* Marge réduite */
}

#songs-section .list-item a {
    padding: 8px 14px; /* Bouton encore plus petit */
    font-size: 0.8em; /* Texte du bouton plus petit */
    margin-top: 10px; /* Marge réduite */
}

#songs-section .list-item .meta-info {
    font-size: 0.75em; /* Info méta encore plus petite */
    margin-top: 12px;
    padding-top: 8px;
}


/* --- Styles spécifiques au Chat Public --- */
#chat-section {
    padding-top: 25px;
}

#chat-container {
    max-width: 850px;
    margin: 30px auto; /* Centré horizontalement */
    padding: 40px;
    background-color: #2b2b2b; /* Fond du chat sombre */
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    border: 1px solid #444444;
    width: 100%; /* S'assure que le conteneur du chat ne déborde pas */
}

#username-input-chat {
    width: 100%;
    padding: 14px;
    margin-bottom: 25px;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 1.05em;
    background-color: #1a1a1a;
    color: #e0e0e0;
}

#chat-window {
    height: 550px; /* Plus haut */
    border: 1px solid #555555;
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    background-color: #1a1a1a; /* Fond de la fenêtre de chat très sombre */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px; /* Plus d'espace entre les messages */
    scroll-behavior: smooth;
    width: 100%; /* S'assure que la fenêtre de chat ne déborde pas */
}
/* Scrollbar custom (Webkit) */
#chat-window::-webkit-scrollbar {
    width: 10px; /* Plus large */
}
#chat-window::-webkit-scrollbar-track {
    background: #2b2b2b; /* Couleur du fond de la scrollbar */
    border-radius: 10px;
}
#chat-window::-webkit-scrollbar-thumb {
    background: #555555; /* Couleur du "pouce" de la scrollbar */
    border-radius: 10px;
}
#chat-window::-webkit-scrollbar-thumb:hover {
    background: #777777;
}

.message {
    background-color: #3a3a3a; /* Fond des messages gris sombre */
    padding: 18px 25px; /* Plus de padding */
    border-radius: 20px; /* Moins arrondi */
    max-width: 75%; /* Plus large */
    word-wrap: break-word; /* Important pour éviter le débordement des mots longs */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    align-self: flex-start;
    position: relative;
    border: 1px solid #555555;
}
.message.my-message {
    background-color: #e74c3c; /* Rouge pour mes messages */
    color: #1a1a1a; /* Texte noir */
    align-self: flex-end;
    border-color: #c0392b;
}

/* Base couleur de l'auteur - plus neutre avant surchargement */
.message .author {
    font-weight: 700;
    font-size: 0.95em;
    color: #b0b0b0; /* Gris clair neutre par défaut */
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
}

/* Style de l'auteur pour les messages de l'utilisateur courant */
.message.my-message .author {
    color: #1a1a1a; /* Noir pour l'auteur dans mes messages */
}

/* --- Couleurs d'auteur pour le chat --- */
.message .author.color-1 { color: #ffda6a; } /* Jaune-orangé */
.message .author.color-2 { color: #2ecc71; } /* Vert émeraude */
.message .author.color-3 { color: #3498db; } /* Bleu vif */
.message .author.color-4 { color: #9b59b6; } /* Améthyste */
.message .author.color-5 { color: #e67e22; } /* Orange carotte */
.message .author.color-6 { color: #1abc9c; } /* Turquoise */
.message .author.color-7 { color: #f1c40f; } /* Jaune plat */
.message .author.color-8 { color: #c0392b; } /* Rouge brique */


.message p {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.5;
    color: #e0e0e0;
}
.message.my-message p {
    color: #1a1a1a;
}
.message .timestamp {
    font-size: 0.8em;
    color: #888;
    text-align: right;
    margin-top: 10px;
    display: block;
}
.message.my-message .timestamp {
    color: #444; /* Gris foncé pour le timestamp dans mes messages */
}

#message-input-area {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: center; /* Centre l'input et le bouton */
    margin-top: 30px;
    width: 100%; /* S'assure que la zone de saisie ne déborde pas */
}
#message-input {
    flex-grow: 1;
    padding: 16px;
    border: 1px solid #555555;
    border-radius: 6px;
    font-size: 1.05em;
    background-color: #1a1a1a;
    color: #e0e0e0;
}
#send-button {
    padding: 16px 30px;
    background-color: #27ae60; /* Vert pour le bouton d'envoi */
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.15em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 12px rgba(39, 174, 96, 0.3);
    text-transform: uppercase;
}
#send-button:hover {
    background-color: #1e8449;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(39, 174, 96, 0.4);
}
#send-button:disabled {
    background-color: #444444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Footer (Pied de page) --- */
footer {
    background-color: #0d0d0d;
    color: #888888; /* Gris sombre */
    text-align: center;
    padding: 30px; /* Plus de padding */
    margin-top: 60px; /* Plus de marge */
    font-size: 0.95em;
    box-shadow: 0 -6px 15px rgba(0, 0, 0, 0.5);
    border-top: 2px solid #555555; /* Bordure épaisse */
}

/* --- Styles pour le sondage de présence --- */
.attendance-poll {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #555555; /* Bordure plus épaisse */
}

.attendance-poll h5 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.3em;
    color: #e74c3c; /* Rouge pour le titre du sondage */
    margin-bottom: 25px;
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
}

.poll-buttons {
    display: flex;
    justify-content: center; /* Centre les boutons du sondage */
    gap: 25px; /* Plus d'espace */
    margin-bottom: 30px;
}

.vote-button {
    padding: 14px 30px;
    border: 1px solid #555555;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    flex-grow: 1;
    max-width: 220px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    color: #1a1a1a;
}

.vote-button.present {
    background-color: #27ae60;
}

.vote-button.absent {
    background-color: #e74c3c;
}

.vote-button:hover:not(.voted) {
    transform: translateY(-3px) scale(1.02);
    opacity: 0.95;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.vote-button.voted {
    opacity: 0.7;
    cursor: default;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
    background-color: #555555; /* Gris neutre quand voté */
    color: #e0e0e0;
}
.vote-button.voted.present {
    background-color: #1e8449; /* Vert plus foncé une fois voté */
    color: #e0e0e0;
}
.vote-button.voted.absent {
    background-color: #c0392b; /* Rouge plus foncé une fois voté */
    color: #e0e0e0;
}


.poll-results {
    background-color: #1a1a1a; /* Fond des résultats sombre */
    border: 1px solid #444444;
    border-radius: 8px;
    padding: 25px;
    text-align: left;
    margin-top: 25px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
}

.poll-results p {
    margin-bottom: 12px;
    font-size: 1em;
    color: #b0b0b0;
}
.poll-results p:last-child {
    margin-bottom: 0;
}

.poll-results .present-list {
    color: #2ecc71; /* Vert clair */
    font-weight: 700;
}

.poll-results .absent-list {
    color: #e74c3c; /* Rouge clair */
    font-weight: 700;
}

/* --- Bouton "Voir plus" --- */
.load-more-button {
    display: block;
    width: fit-content;
    margin: 50px auto; /* Centré horizontalement */
    padding: 16px 40px;
    background-color: #ffda6a; /* Jaune-orangé */
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.2em;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(255, 218, 106, 0.3);
    text-transform: uppercase;
}

.load-more-button:hover {
    background-color: #e6c25e;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(255, 218, 106, 0.4);
}

.load-more-button:disabled {
    background-color: #444444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* --- Styles pour les notifications in-app --- */
#in-app-notification-container {
    display: none; /* Caché par défaut, géré par JS */
    background-color: #e74c3c; /* Rouge par défaut, changé par JS */
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    margin: 10px auto; /* Centré horizontalement */
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative; /* Pour le positionnement relatif */
    z-index: 999; /* S'assure qu'il est au-dessus des autres contenus */
}

/* --- Responsive Design (Adaptation Mobile) --- */
@media (max-width: 992px) {
    header h1 {
        font-size: 3em;
    }
    .main-nav {
        gap: 12px;
    }
    .main-nav .tab-button {
        padding: 12px 25px;
        font-size: 1em;
    }
    main {
        padding: 25px;
        margin: 30px auto;
    }
    h2 {
        font-size: 2.5em;
        margin-bottom: 35px;
    }
    h2::after {
        width: 60px;
        height: 4px;
    }
    h3 {
        font-size: 1.8em;
        margin-bottom: 25px;
    }
    .content-form button {
        padding: 10px 20px;
        font-size: 1em;
    }
    .list-item {
        padding: 20px;
        width: 100%;
    }
    .list-item h4 {
        font-size: 1.5em;
    }
    /* Responsive pour les morceaux */
    #songs-section .content-list {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }
    #songs-section .list-item {
        padding: 12px;
    }
    #songs-section .list-item h4 {
        font-size: 1.1em;
    }
    #songs-section .list-item p {
        font-size: 0.8em;
    }
    #songs-section .list-item a {
        padding: 7px 12px;
        font-size: 0.75em;
    }

    #chat-container {
        padding: 15px;
        margin: 20px auto;
    }
    #chat-window {
        height: 280px;
        padding: 15px;
        gap: 12px;
    }
}

/* MEDIA QUERY POUR LES TÉLÉPHONES (ÉCRANS < 768px) */
@media (max-width: 768px) {
    header {
        padding: 10px 0;
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 0 10px;
    }

    header h1 {
        font-size: 2em;
        letter-spacing: 1.5px;
    }

    #auth-controls {
        gap: 6px;
        font-size: 0.8em;
    }

    #logged-in-user-info {
        font-size: 0.8em;
        gap: 4px;
    }

    #logout-button, #login-nav-button {
        padding: 6px 12px;
        font-size: 0.75em;
    }

    .main-nav {
        flex-wrap: wrap; /* IMPORTANT: Permet aux onglets de s'envelopper sur plusieurs lignes */
        overflow-x: hidden; /* Supprime le défilement horizontal de la nav */
        justify-content: center; /* Centre les boutons si enveloppés */
        padding: 0 5px 8px; /* Ajuste le padding */
        gap: 6px;
        width: 100%;
        margin-top: 10px;
        order: 3;
        /* Supprime les styles de scrollbar puisque overflow-x est hidden */
        -ms-overflow-style: none;
        scrollbar-width: none;
        -webkit-overflow-scrolling: auto; /* Revert pour éviter les problèmes avec hidden */
    }
    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav .tab-button {
        flex-shrink: 0;
        flex-basis: auto; /* Permet aux boutons de prendre la taille nécessaire ou de s'envelopper */
        max-width: calc(50% - 10px); /* Tente 2 boutons par ligne sur des écrans étroits */
        padding: 8px 12px;
        font-size: 0.85em;
        border-radius: 4px;
        white-space: nowrap;
        text-align: center; /* Centre le texte dans les boutons */
    }

    main {
        padding: 10px;
        margin: 10px auto;
        width: calc(100% - 20px); /* Ajuste la largeur du main pour éviter tout débordement */
        max-width: 768px; /* S'assure que main ne s'étire pas au-delà de la MQ */
    }
    h2 {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    h2::after {
        width: 60px;
        height: 4px;
    }
    h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    .content-form button {
        padding: 10px 20px;
        font-size: 1em;
    }
    .list-item {
        padding: 12px;
        width: 100%; /* S'assure que les list-item remplissent leur colonne */
    }
    .list-item h4 {
        font-size: 1.1em;
    }
    /* Responsive pour les morceaux sur écrans plus petits */
    #songs-section .content-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
    }
    #songs-section .list-item {
        padding: 8px;
    }
    #songs-section .list-item h4 {
        font-size: 0.9em;
    }
    #songs-section .list-item p {
        font-size: 0.7em;
        margin-bottom: 5px;
    }
    #songs-section .list-item a {
        padding: 5px 8px;
        font-size: 0.65em;
    }

    #chat-container {
        padding: 10px; /* Très compact sur les téléphones */
        margin: 15px auto;
        width: calc(100% - 20px); /* Ajuste la largeur du conteneur pour éviter tout débordement */
        max-width: 768px; /* S'assure que le conteneur du chat ne s'étire pas */
    }
    #chat-window {
        height: 160px; /* Hauteur encore plus réduite pour laisser de la place */
        padding: 10px;
        gap: 8px;
    }
    .message {
        padding: 8px 12px;
        font-size: 0.8em;
        max-width: calc(100% - 20px); /* Ajuste max-width pour tenir compte du padding */
    }
    .message p {
        font-size: 0.8em;
    }
    .message .author {
        font-size: 0.8em;
        margin-bottom: 4px;
    }
    .message .timestamp {
        font-size: 0.7em;
        margin-top: 5px;
    }
    #message-input-area {
        gap: 8px;
        margin-top: 15px;
    }
    #message-input {
        padding: 6px;
        font-size: 0.8em;
    }
    #send-button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .vote-button {
        font-size: 0.75em;
        padding: 6px 12px;
    }
}

/* MEDIA QUERY POUR TRÈS PETITS ÉCRANS (< 480px) */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
        letter-spacing: 1px;
    }
    #logged-in-user-info {
        font-size: 0.65em;
    }
    #logout-button, #login-nav-button {
        font-size: 0.6em;
        padding: 5px 10px;
    }
    .main-nav .tab-button {
        font-size: 0.75em;
        padding: 6px 10px;
        max-width: calc(100% - 12px); /* Un bouton par ligne si trop petit pour 2 */
    }
    .content-list {
        grid-template-columns: 1fr; /* Une seule colonne par défaut pour les très petits écrans */
    }
    .list-item {
        max-width: 100%;
        margin: 0 auto;
    }
    /* Morceaux sur très petits écrans, potentiellement 2 colonnes si possible */
    #songs-section .content-list {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 6px;
    }
    #chat-window {
        height: 130px; /* Hauteur minimale du chat */
        padding: 8px;
    }
    .message {
        padding: 6px 10px;
        font-size: 0.75em;
    }
    .message p {
        font-size: 0.75em;
    }
    #message-input {
        padding: 6px;
        font-size: 0.8em;
    }
    #send-button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .vote-button {
        font-size: 0.75em;
        padding: 6px 12px;
    }
}
