/* ========================================================= */
/* 1. STYLES GÉNÉRAUX ET RESET */
/* ========================================================= */
body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
}

/* Conteneur principal qui centre tout */
.main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 95%;
    max-width: 1200px;
    padding: 20px 10px;
    box-sizing: border-box;
}

/* ========================================================= */
/* 2. BOÎTE DE LA RADIO (Lecteur et Contrôles) */
/* ========================================================= */
.radio-box {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 15px;
    
    /* EFFET LED ROUGE PULSÉ SUR LE CADRE EXTÉRIEUR */
    border: 2px solid rgba(255, 0, 0, 0.7); 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.2); 
    animation: red-pulse 4s infinite alternate; /* Pulsation LED (Défini en section 7) */
    
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-sizing: border-box;
}

/* Style du Logo SI */
.logo-si {
    width: 20%; 
    max-width: 62px; 
    height: auto;
    margin: 0 auto 30px auto; 
    display: block; 
    filter: none;
    transition: transform 0.3s ease;
}

.logo-si:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.4));
}


.player-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* ========================================================= */
/* 3. LOGO POP ROCK TIME */
/* ========================================================= */

:root {
    --espacement-vertical: 30px;
}

/* Conteneur de Lien */
.logo-link {
    display: block; 
    margin-left: auto;
    margin-right: auto;
    text-decoration: none; 
    height: auto;
}

/* Propriétés de taille */
.logo-link.joachim-size {
    width: 50%; 
    max-width: 458px; 
    margin-bottom: var(--espacement-vertical); 
}

/* Image */
.logo {
    width: 100%; 
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    filter: none;
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); 
}

/* ========================================================= */
/* 4. AFFICHAGE DU TITRE (Écran Numérique LED avec Défilement) */
/* ========================================================= */
.digital-screen {
    /* Fond sombre pour l'effet numérique */
    background-color: #0d0d0d; 
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    height: 30px; 
    line-height: 30px;
    overflow: hidden; /* TRÈS IMPORTANT : Cache ce qui dépasse */
    
    /* RETIRÉ: white-space: nowrap; et text-overflow: ellipsis; pour le défilement */

    /* STYLE LED ROUGE */
    color: #ff0000; 
    font-size: 1.4em;
    font-weight: bold;
    font-family: 'Consolas', monospace; 
    
    /* Contour LED rouge autour de l'écran */
    border: none;
    box-shadow: inset 0 0 5px rgba(255, 0, 0, 0.8), 0 0 8px rgba(255, 0, 0, 0.6);
    
    /* Centrage par défaut par flexbox. Le JS changera en flex-start si scrolling */
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

#titreActuel {
    font-size: 1em; 
    color: #ff0000; 
    font-weight: bold;
    
    /* Lueur du texte */
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.8), 0 0 10px rgba(255, 0, 0, 0.4);
    
    /* Styles pour la mesure du texte */
    white-space: nowrap; /* Force le texte sur une seule ligne */
    display: inline-block; /* Permet de mesurer sa scrollWidth */
    
    /* L'animation est désactivée par défaut, JS l'activera via la classe .scrolling */
    animation: none;
    transform: none;
}

/* NOUVEAU : CLASSE APPLIQUÉE PAR JAVASCRIPT POUR LES TITRES LONGS */
#titreActuel.scrolling {
    /* L'animation est lancée ici */
    animation-name: marquee; 
    animation-timing-function: linear; 
    animation-iteration-count: infinite; 
    /* La durée sera définie dynamiquement par script.js */
}

/* ========================================================= */
/* 5. LECTEUR AUDIO ET CONTRÔLES */
/* ========================================================= */
#monLecteur {
    width: 100%;
    filter: none;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 300px;
    margin: 0 auto;
}

.controls button {
    padding: 12px 18px;
    
    /* STYLE ROUGE DES BOUTONS */
    border: 2px solid #ff0000; 
    color: #ff0000;
    
    flex-grow: 1;
    flex-basis: 0; 
    background-color: rgba(255, 255, 255, 0.05); 
    text-shadow: none;
    border-radius: 8px; 
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
}
.controls button:hover {
    /* Effet au survol en rouge */
    background-color: #330000; 
    color: #ffffff; 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3);
    transform: translateY(-2px);
}
#btnStop {
    /* Style spécifique du bouton Stop */
    border-color: #ff0000; 
    color: #ff0000;       
    background-color: rgba(255, 255, 255, 0.05); 
}
#btnStop:hover {
    background-color: #330000;
    color: #ffffff; 
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 0 20px rgba(255, 0, 0, 0.3);
}

/* ========================================================= */
/* 6. RESPONSIVITÉ */
/* ========================================================= */

@media (max-width: 480px) {
    .radio-box {
        padding: 20px 15px; 
        width: 100%; 
        border-radius: 0; 
        box-shadow: none; 
    }
    .logo-link.joachim-size {
        width: 100%; 
        max-width: none;
        border-radius: 0;
    }
    .logo-si {
        width: 30%; 
        max-width: 80px;
    }
    .controls {
        max-width: none; 
        flex-direction: row; 
    }
    .controls button {
        padding: 10px;
        font-size: 0.8em;
    }
}

/* ========================================================= */
/* 7. ANIMATIONS */
/* ========================================================= */

/* Animation de Pulsation LED Rouge (Cadre Extérieur) */
@keyframes red-pulse {
    0% {
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6), 0 0 15px rgba(255, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.8), 0 0 25px rgba(255, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.6), 0 0 15px rgba(255, 0, 0, 0.3);
    }
}

/* NOUVEAU : Animation de Défilement (Marquee) */
@keyframes marquee {
    from {
        /* Commence à la droite du conteneur (caché) */
        transform: translateX(100%);
    }
    to {
        /* Se termine à l'extrémité gauche du texte */
        transform: translateX(-100%); 
    }
}