/* ==========================================================================
   1. STYLE HISTORIQUE (MODE WIDGET / NORMAL)
   ========================================================================== */

.lecteur-wrapper-test {
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    
    /* MODE BLOC NORMAL */
    display: block; 
    position: relative;
}

/* POCHETTE MODE NORMAL (Ratio 4:3) */
.lecteur-cover-container {
    width: 100%;
    padding-top: 75%; /* C'est ce padding qui fait la hauteur en mode normal */
    position: relative;
    background: #000;
    overflow: hidden;
    display: block;
}

.lecteur-cover-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

/* ZONE CONTRÔLES MODE NORMAL */
.icecast-lecteur-player {
    padding: 15px;
    background: #2a2a2a;
    position: relative;
    z-index: 10;
}

/* --- Styles internes (Titres, boutons...) --- */
.lecteur-track-info-container {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 15px; min-height: 2.5em; border-bottom: 1px solid #444; padding-bottom: 10px;
}
.lecteur-player-status {
    color: #ff4081; font-size: 12px; font-weight: bold; text-transform: uppercase; margin-right: 10px;
}
.lecteur-track-info-right {
    text-align: right; overflow: hidden; flex-grow: 1;
}
.lecteur-track-artist {
    display: block; font-weight: bold; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lecteur-track-title {
    display: block; color: #aaa; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}
.lecteur-player-controls {
    display: flex; align-items: center; justify-content: space-between; gap: 15px;
}
.lecteur-play-button {
    width: 45px; height: 45px; background: #ff4081; border: none; border-radius: 50%;
    color: white; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lecteur-play-button:hover { background: #f50057; transform: scale(1.05); }
.lecteur-volume-control {
    flex-grow: 1; display: flex; align-items: center; gap: 10px; color: #ccc;
}
.lecteur-volume-control input[type=range] { width: 100%; cursor: pointer; }
.lecteur-fullscreen-button {
    background: transparent; border: none; color: #ccc; font-size: 18px; cursor: pointer; padding: 10px;
}
.lecteur-fullscreen-button:hover { color: #fff; }


/* ==========================================================================
   2. MODE PLEIN ÉCRAN (MÉTHODE POSITION ABSOLUE)
   ========================================================================== */

.lecteur-wrapper-test:fullscreen,
.lecteur-wrapper-test:-webkit-full-screen,
.lecteur-wrapper-test:-moz-full-screen {
    /* On force le wrapper à prendre tout l'écran, sans scroll */
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    background: #000 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    
    /* On active le mode de positionnement "Carte" */
    position: fixed !important; 
    top: 0 !important;
    left: 0 !important;
    z-index: 99999 !important;
    display: block !important; /* Pas de flex, pas de grid */
}

/* LE CONTENEUR IMAGE EN PLEIN ÉCRAN */
.lecteur-wrapper-test:fullscreen .lecteur-cover-container,
.lecteur-wrapper-test:-webkit-full-screen .lecteur-cover-container,
.lecteur-wrapper-test:-moz-full-screen .lecteur-cover-container {
    
    /* RESET du mode normal */
    padding-top: 0 !important; 
    
    /* POSITIONNEMENT FORCÉ */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    
    /* C'est ICI l'astuce : on lui dit d'aller jusqu'à 110px du bas */
    /* Cela laisse exactement la place pour la barre de contrôle */
    bottom: 110px !important; 
    
    height: auto !important;
    background: #000;
    z-index: 1;
}

/* L'IMAGE EN PLEIN ÉCRAN */
.lecteur-wrapper-test:fullscreen .lecteur-cover-container img,
.lecteur-wrapper-test:-webkit-full-screen .lecteur-cover-container img,
.lecteur-wrapper-test:-moz-full-screen .lecteur-cover-container img {
    object-fit: contain !important; /* Image entière */
    width: 100% !important;
    height: 100% !important;
}

/* LES CONTRÔLES EN PLEIN ÉCRAN */
.lecteur-wrapper-test:fullscreen .icecast-lecteur-player,
.lecteur-wrapper-test:-webkit-full-screen .icecast-lecteur-player,
.lecteur-wrapper-test:-moz-full-screen .icecast-lecteur-player {
    
    /* POSITIONNEMENT FORCÉ EN BAS */
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    
    /* On fixe une hauteur max approximative pour être sûr */
    height: auto !important; 
    min-height: 100px !important;
    
    background: rgba(30, 30, 30, 0.95) !important;
    padding: 20px 30px !important;
    box-sizing: border-box !important;
    z-index: 10;
}
