/**
 * LP Audio Player - Diseño personalizado
 * Version: 2.0.0
 */

/* ============================================
   REPRODUCTOR INDIVIDUAL
   ============================================ */

.audio-player-container {
    background: #555555;
    border-radius: 12px;
    padding: 15px 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    box-sizing: border-box;
}

/* Header con ícono y label */
.audio-player-container::before {
    content: '🎧';
    position: absolute;
    top: 15px;
    left: 20px;
    font-size: 24px;
}

.audio-player-container::after {
    content: 'Premium';
    position: absolute;
    top: 24px !important;
    left: 60px;
    color: #FF8C00;
    font-size: 15px;
    font-weight: 600;
}


/* Título del audio */
.audio-title {
    color: white;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
}

/* En reproductores individuales: título arriba con margen */
.audio-player-container:not(.audio-playlist .audio-player-container) .audio-title {
    margin: 45px 0 15px 0;
}

/* Mensajes de estado */
.loading-msg,
.error-msg {
    text-align: center;
    padding: 8px;
    margin: 10px 0;
    border-radius: 6px;
    font-size: 13px;
}

.loading-msg {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.error-msg {
    background: rgba(255, 0, 0, 0.2);
    color: #ffcccc;
}

/* Controles de audio - Layout horizontal en individuales */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0 10px 0;
}

/* En reproductores individuales: título dentro de controles */
.audio-player-container:not(.audio-playlist .audio-player-container) .track-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 45px;
}

.audio-player-container:not(.audio-playlist .audio-player-container) .track-header .audio-title {
    flex: 1;
    margin: 0;
}

.audio-player-container:not(.audio-playlist .audio-player-container) .audio-controls {
    margin: 0;
    flex-shrink: 0;
    gap: 10px;
}

/* Botón Play */
.play-btn {
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    padding: 0;
}

.play-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.play-btn.playing .btn-icon::before {
    content: '⏸️';
    font-size: 24px;
    margin: 0;
    padding: 0;
}

.play-btn:not(.playing) .btn-icon::before {
    content: '▶️';
    font-size: 24px;
    padding: 0;
    margin: 0;
}

/* Animación sutil en play */
@keyframes playPulse {
    0%, 100% {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

.play-btn.playing {
    animation: playPulse 2s ease-in-out infinite;
}

/* Botón Stop (cuadrado) */
.stop-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: none;
    background: #777;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.stop-btn:hover:not(:disabled) {
    background: #888;
}

.stop-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.stop-icon {
    font-size: 16px;
}

/* Control de volumen (arriba a la derecha en individual) */
.volume-control {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.volume-slider {
    width: 140px;
    height: 5px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: #3a3a3a;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #888;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #888;
    cursor: pointer;
    border: none;
}

/* Barra de progreso */
.progress-container {
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #3a3a3a;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2196F3;
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Display de tiempos */
.time-display {
    display: flex;
    justify-content: space-between;
    color: #ccc;
    font-size: 11px;
    margin-top: 6px;
}

/* ============================================
   PLAYLIST
   ============================================ */

.audio-playlist {
    background-image: linear-gradient(to bottom right, #505050, #202020);
    /* background: #2a2a2a; */
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

/* Etiqueta fija + Título de playlist */
.playlist-title {
    color: #FF8C00 !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    margin-bottom: 5px;
    text-align: center;
}

.playlist-title::after {
    content: '🎧 Narrativa simple y directa';
    display: block;
    font-size: 16px;
    color: #ccc;
    font-weight: 400;
    margin: 8px;
}

/* Controles globales de playlist */
.playlist-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px 20px;
    background: #0e0e0e;
    border-radius: 12px;
}

/* Botones de navegación (prev/next) */
.playlist-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #666;
    background: #4a4a4a;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.playlist-btn:hover:not(:disabled) {
    background: #5a5a5a;
    border-color: #777;
}

.playlist-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.playlist-btn-central {
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
    transition: all 0.3s ease;
    margin: 0 20px;
}

.playlist-btn-central:hover:not(:disabled) {
    background: #5a5a5a;
    border-color: #777;
}

.playlist-btn-central:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.playlist-btn.playlist-play:hover:not(:disabled) {
    transform: scale(1.05);
}

/* Control de volumen maestro */
.playlist-volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.playlist-volume-slider {
    width: 140px;
    height: 5px;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    background: #555;
    cursor: pointer;
}

.playlist-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #888;
    cursor: pointer;
}

.playlist-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #888;
    cursor: pointer;
    border: none;
}

/* Contenedor de pistas */
.playlist-tracks {
    margin-top: 15px;
    width: 100%;
}

/* Ocultar elementos de reproductor individual en playlist */
.audio-playlist .audio-player-container::before,
.audio-playlist .audio-player-container::after {
    display: none !important;
}

.audio-playlist .audio-player-container .stop-btn {
    display: none !important;
}

.audio-playlist .audio-player-container .volume-control {
    display: none !important;
}

/* Pistas en playlist - Layout horizontal */
.audio-playlist .audio-player-container {
    background: #4d4d4d;
    margin: 10px 0;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.audio-playlist .audio-player-container:hover {
    background: #777777;
}

/* Pista activa - título amarillo */
.audio-playlist .audio-player-container.track-playing {
    background: #666666;
}

.audio-playlist .audio-player-container.track-playing .audio-title {
    color: #FFD700 !important;
    font-weight: 500;
}

/* Header de pista: checkbox + título + play (horizontal) */
.audio-playlist .track-header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* Checkbox a la izquierda */
.audio-playlist .track-checkbox-container {
    display: block !important;
    flex-shrink: 0;
    order: -1;
    text-align: left !important;
}

.track-checkbox {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #949494;
}

/* Título en pistas de playlist */
.audio-playlist .audio-title {
    color: white;
    margin: 0;
    flex: 1;
}

/* Enlaces en títulos */
.audio-title a {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.audio-title a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Enlace en reproductor individual */
.audio-player-container:not(.audio-playlist .audio-player-container) .audio-title a {
    color: white;
}

/* Enlace en pista de playlist */
.audio-playlist .audio-title a {
    color: white;
}

/* Enlace en pista activa (amarillo) */
.audio-playlist .audio-player-container.track-playing .audio-title a {
    color: #FFD700;
}

/* Controles ocultos en pistas de playlist */
.audio-playlist .audio-controls {
    margin: 0;
    width: auto;
}

/* Barra de progreso abajo en pistas */
.audio-playlist .progress-container {
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.audio-playlist .progress-bar {
    height: 4px;
}

.audio-playlist .time-display {
    font-size: 10px;
    margin-top: 4px;
}

.audio-playlist .loading-msg,
.audio-playlist .error-msg {
    display: none !important;
}

/* Mensajes en reproductores individuales */
.audio-player-container:not(.audio-playlist .audio-player-container) .loading-msg,
.audio-player-container:not(.audio-playlist .audio-player-container) .error-msg {
    margin: 10px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 720px) {
    .audio-player-container {
        padding: 12px 15px;
    }
    
    .volume-slider {
        width: 100px;
    }
    
    .playlist-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .playlist-volume-control {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }
    
    .playlist-volume-slider {
        width: 100%;
        max-width: 250px;
    }
    
    .audio-playlist .track-header {
        flex-wrap: wrap;
    }
    
    .audio-playlist .play-btn {
        order: 2;
    }
}
.audio-title {
    font-size: 22px;
    padding: 10px ;
}
@media (min-width: 721px) and (max-width: 960px) {
    .audio-title {
        font-size: 18px;
    }
}
@media (max-width: 720px) {
    .audio-title {
        font-size: 14px;
    }
}