/* =============================================
    REPRODUCTOR GLOBAL BEATLATIN - FINAL SKIN
   ============================================= */

.sticky-audio-player {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1270px;
    background: rgba(24, 24, 24, 0.95); 
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow: hidden;
    border-top: 2px solid rgba(217, 12, 12, 0.8);
    font-family: 'Sora', system-ui, sans-serif;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(100px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-audio-player.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.player-container {
    display: flex;
    align-items: center;
    padding: 12px 30px;
    gap: 25px;
}

/* INFO DEL REPRODUCTOR */
.player-left { 
    flex: 1;
    min-width: 0; }

.player-title { 
    font-size: 15px; 
    font-weight: 700; 
    color: #ffffff; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: 85%; /* Deja espacio para las barritas */
    margin-bottom: 2px; 
    line-height: 1.4;
    letter-spacing: 0.3px;
}

.sticky-audio-player.active .player-title {
    background: linear-gradient(90deg, #fff, #aaa, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 4s linear infinite;
}

@keyframes shine { to { background-position: 200% center; } }

.player-dj, .player-dj a { 
    font-size: 13px; 
    color: #D90C0C !important; 
    font-weight: 600; 
    text-transform: none; 
    text-decoration: none !important; 
    transition: all 0.3s ease;
    display: inline-block;
}

.player-dj a:hover { 
    color: #ff4d4d !important; 
    transform: translateY(-1px); 
}

/* CONTROLES */
.player-center { display: flex; align-items: center; gap: 18px; }

.player-btn.small { 
    width: 36px; 
    height: 36px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    border-radius: 12px; 
    color: #fff; 
    font-size: 15px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
}

.player-btn.small:hover { 
    background: #D90C0C; 
    transform: scale(1.1) translateY(-2px); 
    box-shadow: 0 5px 15px rgba(217, 12, 12, 0.4);
}

.play-pause-btn { 
    width: 54px; 
    height: 54px; 
    background: #D90C0C; 
    border-radius: 50%; 
    color: #fff; 
    font-size: 22px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 0 20px rgba(217, 12, 12, 0.5); 
    border: none; 
    cursor: pointer; 
    transition: all 0.3s ease; 
}

/* BARRA DE PROGRESO */
/* ==================== BARRA DE PROGRESO DE LUJO ==================== */
.progress-container { 
    height: 4px; 
    background: rgba(255,255,255,0.1); 
    cursor: pointer; 
    margin: 0 30px 10px; 
    border-radius: 10px; 
    position: relative; 
    transition: height 0.3s ease; 
}

.progress-container:hover { 
    height: 8px; /* Se hace un poco más gruesa al pasar el mouse */
}

.progress-filled { 
    position: absolute; 
    left: 0; 
    top: 0; 
    height: 100%; 
    background: linear-gradient(90deg, #D90C0C, #ff4d4d); 
    border-radius: 10px; 
    /* ESTA LÍNEA HACE QUE EL MOVIMIENTO SEA FLUIDO */
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1); 
    pointer-events: none; 
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* EL PUNTO BLANCO (Handle) */
.progress-filled::after { 
    content: ''; 
    position: absolute; 
    right: -6px; 
    width: 14px; 
    height: 14px; 
    background: #ffffff; 
    border-radius: 50%; 
    box-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 5px rgba(0,0,0,0.5); 
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.5);
}

/* Mostrar el punto al pasar el mouse por la barra */
.progress-container:hover .progress-filled::after { 
    opacity: 1; 
    transform: scale(1);
}

/* ==================== PANTALLA PREVIEW VIDEO (EL RETOQUE DE LUJO) ==================== */
#global-video-wrapper {
    position: fixed;
    right: 130px;
    bottom: 110px; /* Ajustado para que flote sobre el reproductor */
    width: 290px;
    background: #000;
    border: 2px solid rgba(217, 12, 12, 0.5);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    z-index: 9998;
    overflow: hidden;
    
    /* Estado inicial oculto con efecto 3D */
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.8) rotateX(-15deg);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    perspective: 1000px;
}

/* Cuando se activa la clase mediante JS */
#global-video-wrapper.is-active {
    display: block !important; /* <--- ESTO ES CLAVE */
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1) rotateX(0);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 1), 0 0 25px rgba(217, 12, 12, 0.3);
}

#global-video-engine { 
   width: 100%; 
   height: auto; 
   display: block;
   background: #000; }

/* Botón cerrar miniatura */
#close-video-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
}
#close-video-preview:hover { background: #D90C0C; border-color: #D90C0C; }

/* RESPONSIVE */
@media (max-width: 768px) {
    #global-video-wrapper {
        right: 50%;
        transform: translateX(50%) translateY(40px) scale(0.8);
        bottom: 105px;
        width: 90%;
        max-width: 280px;
    }
    #global-video-wrapper.is-active {
        transform: translateX(50%) translateY(0) scale(1);
    }
}

/* ==================== AJUSTES MÓVIL BEATLATIN ==================== */
@media (max-width: 768px) {
    /* 1. Ocultar botones Anterior y Siguiente */
    #player-prev, 
    #player-next {
        display: none !important;
    }

    /* 2. Centrar el control en el medio */
    .player-center {
        justify-content: center;
        flex: 1;
        gap: 0; /* Quitamos el espacio ya que no hay botones laterales */
    }

    /* 3. Ajustar el tamaño del botón de Play para que sea cómodo al tacto */
    .play-pause-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    /* 4. Asegurar que la info del track no empuje al botón */
    .player-left {
        flex: 2; /* Le damos espacio al título */
    }

    .player-right {
        display: none !important; /* Ocultamos volumen y tiempo en móviles muy pequeños si estorban */
    }
}

/* Ajuste extra para móviles muy estrechos */
@media (max-width: 480px) {
    .player-container {
        padding: 10px 15px;
        gap: 10px;
    }
    
    .player-title {
        font-size: 13px;
    }
}

/* Contenedor del visualizador */
.bl-playing-visualizer {
    display: none;
    align-items: flex-end;
    gap: 3px;
    width: 25px;
    height: 18px;
}

.sticky-audio-player.is-playing .bl-playing-visualizer {
    display: inline-flex;
}

/* Estilo de cada barrita */
.bl-bar {
    width: 3px;
    background: #D90C0C;
    border-radius: 2px;
    /* Animación base */
    animation: real-wave 0.5s ease-in-out infinite;
    transform-origin: bottom;
}

/* Diferentes velocidades y retardos para simular el ritmo */
.bl-bar:nth-child(1) { animation-duration: 0.4s; animation-delay: 0.1s; height: 60%; }
.bl-bar:nth-child(2) { animation-duration: 0.6s; animation-delay: 0.3s; height: 100%; }
.bl-bar:nth-child(3) { animation-duration: 0.5s; animation-delay: 0.2s; height: 80%; }
.bl-bar:nth-child(4) { animation-duration: 0.7s; animation-delay: 0.0s; height: 70%; }

@keyframes real-wave {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}