/* === 1. STRUCTURE GLOBALE (900px) === */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #000000;
    color: #a8dadc;
}

.layout {
    display: flex;
    flex-direction: column;
    max-width: 900px; 
    margin: 0 auto;
    min-height: 100vh;
    background: #01272b;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* === 2. HEADER & BANNIÈRE === */
.header-bottom {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    height: 120px;
    overflow-y: hidden;
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    background-color: #01272b;
    background-image: url('/data/player/bann/fond7.png');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: cover;
    box-sizing: border-box;
}

.header-bottom img {
    height: 100px;
    width: auto;
    cursor: pointer;
    flex: 0 0 auto;
    margin-right: 15px;
}

/* MODIFICATION : TEXTE DU BOUTON AUDIO SUR 2 LIGNES */
.audio-tile .text {
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: normal;      /* Autorise le retour à la ligne */
    text-align: center;
    display: block;
    max-width: 100px;         /* Force le texte à basculer si besoin */
}

/* === 3. LISTE DES VILLAGES === */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.titre-categorie {
    font-size: 1.1em;
    font-weight: bold;
    padding: 15px;
    background: #01393d;
    text-align: center;
    border-bottom: 1px solid #05a2ab;
}

.liste {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
}

#recherche {
    display: block;
    width: 60%;
    max-width: 500px;
    margin: 0 auto 20px auto;
    padding: 15px 12px;
    border-radius: 8px;
    border: 1px solid #05a2ab;
    font-size: 1rem;
    line-height: 1.4;
    background: #000;
    color: white;
    text-align: center;
    height: auto; 
}

.item {
    width: 100%;           
    padding: 15px;
    margin-bottom: 15px;
    background: #013439;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
    /* --- AJOUTS POUR LE CÔTE À CÔTE --- */
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.item:hover {
    background: #037c84;
    border-color: #05a2ab;
}

/* Version Ordinateur (Côte à côte) */
.item {
    width: 100%;           
    padding: 15px;
    margin-bottom: 15px;
    background: #013439;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.item img.miniature {
    display: block;
    width: 300px;       
    height: auto;
    border-radius: 6px;
    margin: 0;
    flex-shrink: 0;
}

.item-texte {
    flex: 1;
    min-width: 250px;
    text-align: left;
    color: #ffffff; /* Titre bien blanc */
    font-weight: bold;
    font-size: 1.1rem;
}

/* LE SOUS-TEXTE (Ordinateur) */
.sous-texte {
    display: block;
    font-weight: normal; /* ENLÈVE LE GRAS */
    font-size: 0.85rem;   /* PLUS PETIT */
    color: #a8dadc;     /* Teinte plus douce */
    margin-top: 5px;
    opacity: 0.8;       /* Plus discret */
}

/* Version Téléphone (Portrait) */
@media (max-width: 600px) {
    .item {
        flex-direction: column;
        text-align: center;
        gap: 8px; /* Réduit un peu l'espace global */
    }
    
    .item img.miniature {
        width: 220px;
        margin: 0 auto;
    }
    
    .item-texte {
        text-align: center;
    }

    /* LE TITRE (Village) */
    .item-texte div:first-child {
        font-size: 1rem !important;
        font-weight: bold;
        margin-bottom: 2px;
    }

    /* LE SOUS-TEXTE (CP, Distance, Année) */
    .sous-texte {
        font-weight: normal !important; 
        font-size: 0.65rem !important; /* Un peu plus grand que 0.5 pour rester lisible */
        display: block;
        margin-top: 2px;
        opacity: 0.7; /* Plus discret */
    }

/* === 4. LA FENÊTRE MODALE (VIDEO) - VERSION STABILISÉE === */
.modal {
    display: none;
    position: fixed;
    z-index: 30000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    /* Transparence du fond et flou */
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 900px;
    max-height: 95vh; /* Empêche de dépasser de l'écran */
    /* Transparence de la fenêtre */
    background: rgba(1, 39, 43, 0.85);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #05a2ab;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.9);
}

.video-wrapper {
    flex: 1; /* Prend tout l'espace disponible */
    min-height: 0; /* Important pour que la vidéo puisse rétrécir */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-wrapper video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Garde le ratio 16/9 sans tronquer */
    display: block;
}

/* Nettoyage du player (Masque volume et téléchargement natif) */
video::-webkit-media-controls-volume-slider,
video::-webkit-media-controls-mute-button,
video::-internal-media-controls-download-button { 
    display: none !important; 
}

/* LA BARRE D'OUTILS - STRUCTURE FLEXIBLE */
.modal-toolbar {
    flex-shrink: 0; /* Ne doit jamais être écrasée ou cachée */
    background: rgba(1, 39, 43, 0.5);
    padding: 15px;
    display: flex;
    flex-direction: column; /* Titre au-dessus, boutons en-dessous */
    gap: 15px;
    border-top: 1px solid rgba(5, 162, 171, 0.4);
}

.modal-info {
    width: 100%;
    text-align: center; /* Titre toujours centré */
}

.modal-info #videoTitle {
    font-weight: bold;
    color: #fff;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px #000;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap; /* Passage à la ligne si pas de place */
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* VOLUME DANS LA MODALE */
.volume-control-modal {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(5, 162, 171, 0.3);
}

.volume-control-modal span {
    font-size: 0.9rem;
    color: #05a2ab;
    min-width: 70px;
    font-weight: bold;
}

.btn-vol {
    width: 35px;
    height: 35px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
}

/* CASE COMMENTAIRE */
.label-comment-modal {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(5, 162, 171, 0.3);
}

.btn-close-modal {
    background: #cc0000;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    min-width: 120px;
}

/* === 5. FOOTER === */
footer {
    text-align: center;
    padding: 30px;
    background: #01272b;
    border-top: 1px solid #05a2ab;
}

