/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');
@import url('https://fonts.cdnfonts.com/css/akira-expanded');

/* RESET COMPLETO para eliminar scroll */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Elimina scroll horizontal */
    overflow-y: auto;
    height: auto;
    min-height: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0; /* Eliminado el padding-bottom que causaba espacio */
    box-sizing: border-box;
    background-color: #0;
    overflow-x: hidden;
}

.barra-player {
    position: fixed; /* Cambiado de absolute a fixed para mejor control */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3cm;
    background-color: #282828;
    color: #eee;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1000;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.3);
    justify-content: space-between;
    overflow: hidden; /* Evita desbordamiento horizontal */
}

.radio-info,
.social-buttons,
.metadata,
.controls,
.player-controller {
    position: relative;
    z-index: 10;
    white-space: nowrap;
}

.radio-info {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.radio-logo {
    height: 3.5cm;
    margin-right: 10px;
    border-radius: 5px;
    display: block; /* Asegura que la imagen sea visible */
    object-fit: contain; /* Mantiene la proporción de la imagen */
}

.radio-name {
    font-size: 1em;
    margin: 0;
    font-weight: 800;
    font-family: 'akira expanded', sans-serif;
}

.social-buttons {
    margin-left: auto;
    margin-right: 20px;
    flex-shrink: 0;
}

.social-buttons a {
    color: #bbb;
    font-size: 1.8em;
    margin-left: 10px;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.social-buttons a:hover {
    color: #eee;
}

.metadata {
    display: flex;
    align-items: center;
    margin-right: 20px;
    flex-shrink: 1;
    overflow: hidden;
    min-width: 0; /* Permite que se encoja correctamente */
}

.player-cover {
    width: 3.5cm;
    height: 3cm;
    overflow: hidden;
    border-radius: 3px;
    margin-right: 8px;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.player-cover.loading::before {
    content: '';
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #eee;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.song-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    min-width: 0;
}

.song-title {
    font-size: 1.0em;
    margin-bottom: 2px;
    margin-top: 0;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.song-artist {
    font-size: 0.7em;
    margin: 0;
    color: #bbb;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}

.controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 0; /* Eliminado el margen derecho que causaba scroll */
}

.controls.player-controller {
    gap: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-button {
    background-color: white;
    color: #888;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
    position: relative;
    overflow: visible;
    margin-left: 5px;
    flex-shrink: 0;
}

.player-button:first-child {
    margin-left: 0;
}

.player-button:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

.player-button-play::after {
    content: '';
    display: block;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(0, 123, 255, 0.4);
    opacity: 0;
    top: 0;
    left: 0;
    transform: scale(0);
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
    z-index: -1;
}

.player-button-play.playing::after {
    transform: scale(1.5);
    opacity: 1;
}

@keyframes pulse-blue {
    0% { transform: scale(1); opacity: 0.6; }
    80% { transform: scale(1.4); opacity: 0; }
    100% { transform: scale(1.4); opacity: 0; }
}

.player-button-play::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(0, 123, 255, 0.3);
    z-index: -2;
    animation: pulse-blue 2s infinite;
}

.volume-button {
    font-size: 1.4em;
    z-index: 10;
}

.controls.player-controller {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.player-button-play {
    z-index: 10;
}

/* ============================================ */
/* SLIDER DE VOLUMEN CORREGIDO - No se sale de pantalla */
/* ============================================ */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    z-index: 5;
    background: #f0f0f0;
    border-radius: 8px;
    height: 10px;
    width: 120px;
    cursor: pointer;
    bottom: 100%;
    left: auto; /* Cambiado de 50% a auto */
    right: 0; /* Alinear a la derecha del botón */
    transform: translateX(0); /* Eliminado el translateX que lo movía */
    margin-bottom: 10px;
    display: none;
}

/* Para pantallas pequeñas, ajustar el slider */
@media (max-width: 768px) {
    .volume-slider {
        width: 100px;
        right: -20px; /* Ajuste fino para móviles */
    }
}

@media (max-width: 480px) {
    .volume-slider {
        width: 80px;
        right: -10px;
    }
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid #e34a4a;
}

.volume-slider::-moz-range-track {
    background: #f0f0f0;
    border-radius: 8px;
    height: 10px;
    cursor: pointer;
    border: none;
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid #e34a4a;
}

.visualizer-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    filter: blur(2px);
}

.visualizer-container.visualizer-hidden {
    opacity: 0;
}

#audio-visualizer {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.dynamic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.25; /* CAMBIADO: antes era 0.05, ahora es 0.25 - MENOS TRANSPARENTE */
    z-index: -1;
}

/* Para pantallas más pequeñas (móviles en horizontal y tablets pequeñas) */
@media (max-width: 768px) {
    .barra-player {
        height: auto;
        flex-direction: row;
        padding: 10px 15px;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .radio-info {
        display: flex; /* CAMBIADO: antes era none, ahora se muestra en móviles */
        margin-bottom: 0;
        align-items: center;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        flex-shrink: 0;
    }

    .radio-logo {
        height: 35px; /* Tamaño reducido para móviles */
        width: auto;
        margin-right: 8px;
        margin-bottom: 0;
    }

    .radio-name {
        font-size: 0.8em; /* Reducido para móviles */
        display: none; /* Ocultar nombre en móviles muy pequeños, opcional */
    }

    .metadata {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-right: 10px;
        margin-bottom: 0;
        text-align: left;
        justify-content: flex-start;
        flex-shrink: 1;
        overflow: hidden;
        min-width: 120px;
    }

    .player-cover {
        width: 45px;
        height: 45px;
        margin-right: 8px;
        margin-bottom: 0;
    }

    .song-details {
        text-align: left;
        margin-left: 0;
        flex-grow: 1;
        overflow: hidden;
    }

    .song-title {
        font-size: 0.75em;
        margin-bottom: 2px;
    }

    .song-artist {
        font-size: 0.6em;
    }

    .social-buttons {
        display: none;
        order: 1;
        margin-left: 10px;
        margin-right: 0;
        margin-bottom: 0;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        flex-shrink: 0;
    }

    .social-buttons a {
        font-size: 1em;
        margin: 0 6px;
    }

    .controls {
        margin-right: 0;
        margin-bottom: 0;
        display: flex;
        justify-content: flex-end;
        margin-left: 10px;
        flex-shrink: 0;
    }

    .controls.player-controller {
        gap: 5px;
        margin-left: auto;
    }

    .player-button {
        width: 32px;
        height: 32px;
        font-size: 0.9em;
        margin: 0 3px;
    }

    .volume-slider {
        width: 100px;
        right: -20px;
    }

    .visualizer-container {
        height: 40px;
    }
}

/* Diseño específico para pantallas muy pequeñas (móviles) */
@media (max-width: 480px) {
    .radio-logo {
        height: 30px;
    }
    
    .radio-name {
        display: none; /* Ocultar nombre en móviles muy pequeños para ahorrar espacio */
    }
    
    .metadata {
        flex-direction: row;
        align-items: center;
        margin-left: 5px;
        margin-right: 5px;
        min-width: 80px;
    }
    
    .player-cover {
        width: 35px;
        height: 35px;
        margin-right: 6px;
        margin-bottom: 0;
    }
    
    .song-title {
        font-size: 0.65em;
    }
    
    .song-artist {
        font-size: 0.5em;
    }
    
    .social-buttons {
        display: none;
        order: 1;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        margin-left: 10px;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .controls {
        margin-left: auto;
        margin-right: 0;
    }

    .controls.player-controller {
        gap: 5px;
    }
    
    .volume-slider {
        width: 80px;
        right: -10px;
    }
}

/* Estilos para pantallas grandes (ancho mínimo de 769px) */
@media (min-width: 769px) {
    .social-buttons {
        display: flex;
    }

    .radio-info {
        display: flex;
    }

    .radio-logo {
        display: block; /* Asegurar visibilidad en desktop */
    }

    .barra-player {
        justify-content: space-between;
        padding: 0 20px;
    }

    .metadata {
        margin-right: 30px;
    }

    .controls {
        margin-left: auto;
        margin-right: 0; /* Eliminado el margen derecho de 2cm */
    }
}

/* Elimina cualquier scroll restante (opcional) */
::-webkit-scrollbar {
    display: none;
}

body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}