/* Reseteo y estilos base para que encaje perfecto en el iframe */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #1e1e24; /* Color oscuro similar a tu CMS */
    overflow: hidden; /* Evita scrollbars en el iframe */
    color: #ffffff;
}

/* Contenedor principal - Ajustado a 95px de alto */
.player-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 95px;
    padding: 0 20px;
    background-color: rgba(30, 30, 36, 0.85);
    position: relative;
    overflow: hidden;
    border-top: 2px solid #ff9900; /* Línea de acento naranja */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
}

.ambient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: blur(30px) opacity(0.4);
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
}

/* Sección de información (Izquierda) */
.stream-info {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 30%;
    min-width: 250px;
    z-index: 1;
    position: relative;
}

.cover-art {
    width: 65px;
    height: 65px;
    border-radius: 8px;
    background: #333;
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: opacity 0.4s ease;
    animation: pulse-border 2s infinite alternate;
}

.text-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.radio-name {
    font-size: 14px;
    font-weight: bold;
    color: #ff9900; /* Naranja corporativo */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.song-title {
    font-size: 16px;
    font-weight: 500;
    animation: scrollText 15s linear infinite;
    display: inline-block;
    padding-left: 100%;
}

@keyframes scrollText {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Controles (Centro) */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    z-index: 1;
    position: relative;
}

.play-btn {
    background: #ff9900;
    color: #1e1e24;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.4);
}

.play-btn:hover {
    transform: scale(1.1);
    background: #ffb84d;
}

.play-btn i {
    margin-left: 4px; /* Centra visualmente el icono de play */
}

.play-btn.playing i {
    margin-left: 0; /* Centra el icono de pausa */
}

/* Volumen (Derecha) */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
    justify-content: flex-end;
    min-width: 150px;
    z-index: 1;
    position: relative;
}

.volume-control i {
    color: #ccc;
    font-size: 18px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none; /* <-- Esta es la línea que soluciona la advertencia */
    width: 100px;
    height: 6px;
    background: #444;
    border-radius: 5px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff9900;
    cursor: pointer;
    transition: transform 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Animación suave para la carátula cuando está sonando */
@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(255, 153, 0, 0.4); }
    100% { box-shadow: 0 0 0 8px rgba(255, 153, 0, 0); }
}

.paused-anim { animation: none !important; }

/* --- DISEÑO RESPONSIVO ULTRA OPTIMIZADO (Max-height: 95px) --- */
@media (max-width: 768px) {
    /* Ocultar volumen para ganar espacio vital */
    .volume-control { 
        display: none !important; 
    }
    
    /* Reducir márgenes del contenedor principal */
    .player-bar {
        padding: 0 10px;
        justify-content: space-between;
    }

    /* Ajustar la info de la canción para que ocupe el máximo disponible sin empujar el botón */
    .stream-info { 
        width: 75%; /* Le damos prioridad al texto */
        min-width: unset;
        gap: 10px;
    }
    
    /* Carátula ligeramente más pequeña */
    .cover-art { 
        width: 50px; 
        height: 50px; 
        min-width: 50px; /* Evita que flexbox la aplaste */
    }

    /* Evitar que textos largos rompan la altura de 95px */
    .text-info {
        width: calc(100% - 60px); /* Resto del ancho menos la carátula */
    }
    
    .radio-name { 
        font-size: 11px; /* Más legible en móvil */
        margin-bottom: 2px;
    }
    
    .song-title { 
        font-size: 13px;
        /* Truco CSS para cortar con puntos suspensivos si es muy largo */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Botón de Play y Ecualizador más compactos */
    .controls {
        flex: unset;
        justify-content: flex-end;
    }
    
    .play-btn { 
        width: 45px; 
        height: 45px; 
        font-size: 18px; 
    }
    
    .visualizer {
        margin-left: 8px; /* Reducir gap en móvil */
    }
}

/* --- ECUALIZADOR VISUAL --- */
.visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px; /* Altura máxima de las barras */
    margin-left: 15px; /* Separación con el botón de play */
}

.visualizer .bar {
    width: 4px;
    background-color: #ff9900; /* Naranja para combinar */
    border-radius: 2px;
    height: 5px; /* Altura inicial en pausa */
    /* La animación base, configurada pero pausada por defecto vía la clase .paused-anim */
    animation: bounce 1s infinite alternate ease-in-out;
}

/* Diferentes duraciones para que parezca aleatorio y natural */
.visualizer .bar:nth-child(1) { animation-duration: 0.6s; }
.visualizer .bar:nth-child(2) { animation-duration: 0.8s; }
.visualizer .bar:nth-child(3) { animation-duration: 0.5s; }
.visualizer .bar:nth-child(4) { animation-duration: 0.9s; }
.visualizer .bar:nth-child(5) { animation-duration: 0.7s; }

/* Animación del rebote (bounce) */
@keyframes bounce {
    0%   { height: 5px; background-color: #ff9900; }
    50%  { height: 25px; background-color: #ffcc00; }
    100% { height: 10px; background-color: #ff7700; }
}

/* IMPORTANTE: Cuando el elemento tiene esta clase, la animación se detiene */
.paused-anim .bar {
    animation-play-state: paused;
    height: 5px; /* Lo forzamos a quedar bajito cuando está en pausa */
}