/* style.css */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0; /* [MODIFICADO] Eliminar padding-bottom */
    box-sizing: border-box;
    background-color: transparent; /* [MODIFICADO] Fondo transparente para iframe */
    min-height: auto; /* [MODIFICADO] Altura automática */
}

/* [NUEVO] Estilo para cuando el reproductor está en modo iframe */
.barra-player.iframe-mode {
    position: relative; /* [MODIFICADO] Cambiado de absolute a relative */
    bottom: auto; /* [MODIFICADO] Eliminar bottom */
    left: auto; /* [MODIFICADO] Eliminar left */
    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); /* [MODIFICADO] Sombra superior cambiada a inferior */
    justify-content: space-between;
    border-radius: 8px; /* [NUEVO] Bordes redondeados para mejor apariencia en iframe */
    margin: 0; /* [NUEVO] Sin margen */
}

/* [NUEVO] Estilo para el contenedor del iframe */
.player-iframe-container {
    display: inline-block;
    width: 100%;
    max-width: 1200px;
    border: none;
    overflow: hidden;
}

/* El resto de tu CSS permanece igual */
.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;
}

.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;
}

.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;
}

.song-title {
    font-size: 1.0em;
    margin-bottom: 2px;
    margin-top: 0;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.song-artist {
    font-size: 0.7em;
    margin: 0;
    color: #bbb;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.controls {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 2cm;
}

.controls.player-controller {
    gap: 10px;
}

.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;
}

.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;
}

.controls.player-controller {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.volume-button {
    z-index: 10;
}

.player-button-play {
    z-index: 10;
}

.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: -10%;
    transform: translateX(-20%);
    margin-bottom: 10px;
    display: none;
}

.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%;
}

.dynamic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: -1;
}

/* Estilos para las fuentes */
@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');

body {
    font-family: 'Montserrat', sans-serif;
}

/* Media queries ajustadas para iframe */
@media (max-width: 768px) {
    .barra-player.iframe-mode {
        height: auto;
        flex-direction: row;
        padding: 10px 15px;
        align-items: center;
        justify-content: space-between;
    }

    .radio-info {
        display: none;
    }

    .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;
    }

    .player-cover {
        width: 80px;
        height: 80px;
        margin-right: 8px;
        margin-bottom: 0;
    }

    .song-details {
        text-align: left;
        margin-left: 0;
        flex-grow: 1;
        overflow: hidden;
    }

    .song-title {
        font-size: 0.9em;
        margin-bottom: 2px;
    }

    .song-artist {
        font-size: 0.7em;
    }

    .social-buttons {
        display: none;
    }

    .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: 30px;
        height: 30px;
        font-size: 1em;
        margin: 0 3px;
    }

    .volume-slider {
        width: 50px;
    }

    .visualizer-container {
        height: 40px;
    }
}

@media (max-width: 480px) {
    .metadata {
        flex-direction: row;
        align-items: center;
        margin-left: 10px;
        margin-right: 10px;
    }
    .player-cover {
        margin-right: 8px;
        margin-bottom: 0;
    }
    .song-details {
        overflow: hidden;
    }
    .social-buttons {
        display: none;
    }
    .controls {
        margin-left: auto;
        margin-right: 0;
    }
}

@media (min-width: 769px) {
    .social-buttons {
        display: flex;
    }

    .radio-info {
        display: flex;
    }

    .barra-player.iframe-mode {
        justify-content: space-between;
        padding: 0 20px;
    }

    .metadata {
        margin-right: 30px;
    }

    .controls {
        margin-left: auto;
        margin-right: 2cm;
    }
}