/**
 * FlowLatin Sticky Pro Player - Full Width Edition
 * DJ Aesthetic + Glassmorphism
 */

#fl-sticky-pro-player {
    position: fixed !important;
    bottom: -100px; /* Oculto por defecto */
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important; /* Forza el ancho real del navegador */
    height: 102px !important;
    background: #000 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2147483647 !important; 
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.6s ease;
    box-shadow: 0 -10px 50px rgba(0,0,0,0.9);
    color: #fff !important;
    font-family: 'Outfit', sans-serif;
    box-sizing: border-box !important;
}

#fl-sticky-pro-player.active {
    bottom: 0px !important;
}

/* 🚫 NUCLEAR: OCULTAR EL REPRODUCTOR STICKY NATIVO DE SONAAR NATIVAMENTE */
/* Ocultamos cualquier rastro que Sonaar intente renderizar como fijo/global */
.iron-audioplayer.iron-fixed,
.iron-audioplayer.iron-standard.iron-fixed,
.iron-audioplayer-fixed,
.sonaar-footer-player,
#sonaar-player,
[id*="sonaar-player"],
.sonaar-player-fixed,
div[style*="z-index: 9999999"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

#fl-sticky-pro-player.is-collapsed {
    transform: translateY(90px) !important;
}

/* 📍 NAV CONTAINER (Barra de navegación superior) */
#fl-sticky-nav-container {
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 50% !important; /* 🔥 50% de ancho centrado */
    height: 25px !important;
    background: rgba(0, 0, 0, 0.6) !important; /* 🔥 Un poco más oscuro para visibilidad */
    border: 1px solid rgba(255, 255, 255, 0.8) !important; /* 🔥 Borde blanco */
    cursor: pointer;
    overflow: hidden;
    z-index: 10 !important;
    box-sizing: border-box !important;
}

/* Elementos internos del nav container */
#fl-sticky-nav-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 1 !important;
}

.fl-sticky-nav-progress {
    position: absolute !important;
    top: 0 !important;
    height: 100% !important;
    background: rgba(255, 255, 255, 0.08) !important; /* 🔥 Un poco más visible */
    pointer-events: none !important;
    z-index: 2 !important;
}

.fl-sticky-nav-playhead {
    position: absolute !important;
    top: 0 !important;
    width: 2px !important;
    height: 100% !important;
    background: #fff !important;
    box-shadow: 0 0 10px #fff, 0 0 5px rgba(255, 255, 255, 0.8) !important;
    pointer-events: none !important;
    z-index: 3 !important;
}

/* 🔥 TIEMPOS EN EL NAV */
.fl-sticky-nav-time {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 9px !important;
    color: #fff !important;
    font-family: 'Outfit', sans-serif !important;
    pointer-events: none !important;
    z-index: 4 !important;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8) !important;
    padding: 0 6px !important;
    font-weight: 500 !important;
}

.fl-sticky-nav-time.elapsed {
    left: 0 !important;
}

.fl-sticky-nav-time.total {
    right: 0 !important;
}

.fl-sticky-nav-tooltip {
    position: absolute !important;
    top: -28px !important;
    left: 0 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    color: #fff !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 10px !important;
    display: none;
    pointer-events: none !important;
    transform: translateX(-50%) !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    z-index: 20 !important;
}

/* ZONA PRINCIPAL (Onda + Controles) */
.fl-sticky-content {
    position: relative;
    width: 100vw !important; /* Forza el ancho real del navegador */
    height: 100%;
    overflow: hidden;
    background: #000;
    box-sizing: border-box !important; /* 🔥 Forzar border-box para evitar conflictos con CSS global */
}

/* ONDA (FONDO) */
.fl-sticky-wave-wrap {
    position: absolute;
    top: 25px; /* 🔥 Inicia después del nav container */
    left: 0;
    right: 0px;
    width: 100%;
    height: calc(100% - 25px); /* 🔥 Altura reducida por el nav container */
    z-index: 1;
    pointer-events: none;
    opacity: 0.85;
    box-sizing: border-box !important; /* 🔥 Protección contra box-sizing: inherit */
}

#fl-sticky-wave-canvas {
    width: 100% !important;
    height: 100% !important; /* 🔥 Llenar el espacio disponible dentro de wave-wrap */
    display: block;
}

/* LÍNEA GUÍA CENTRAL */
.fl-sticky-center-line {
    position: absolute;
    left: 50% !important;
    top: -25px; /* 🔥 Extender hacia arriba para cubrir toda la altura */
    bottom: 0;
    height: calc(100% + 25px); /* 🔥 Altura total incluyendo nav container */
    width: 2px;
    background: #ff0404; /* Red Guiding Line */
    box-shadow: 0 0 10px #ff0404, 0 0 20px rgba(255, 4, 4, 0.2);
    z-index: 5;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0.5; /* Más atenuada como pediste */
}

/* INTERFAZ UI */
.fl-sticky-ui-layer {
    position: absolute;
    top: 25px; /* 🔥 Inicia después del nav container (25px) */
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(100% - 25px); /* 🔥 Altura reducida por el nav container */
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
    box-sizing: border-box !important; /* 🔥 Protección contra box-sizing: inherit */
}

.fl-sticky-info {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
    box-sizing: border-box !important; /* 🔥 Protección contra box-sizing: inherit */
}

/* ... (Thumb/Meta/Artist siguen igual) ... */


/* 🎚️ MIXER RACK (Ahora un HIJO ABSOLUTO del player) */
.fl-sticky-mixer-rack {
    position: absolute !important;
    right: 20px !important;
    bottom: 8px !important; /* Siempre en posición relativa al padre */
    width: 100px !important;
    height: 94px !important;
    background: rgba(0, 0, 0, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    z-index: 100 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    pointer-events: auto;
    opacity: 0 !important; /* Invisible por defecto hasta que tenga picos */
    box-sizing: border-box;
    transition: opacity 0.5s ease;
}

/* Sincronización de estados (Simplificado) */
.fl-sticky-mixer-rack.is-ready {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.fl-sticky-mixer-rack .fl-waveform-volume-container {
    flex: 0 0 40px;
    display: flex;
    justify-content: center;
    height: 80px;
    background: transparent;
}

.fl-sticky-mixer-rack .fl-waveform-volume-track {
    background: rgba(255, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 0, 0, 0.1);
    box-shadow: inset 0 2px 8px rgb(141 31 31), 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}

.fl-waveform-volume-level {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, #ff0404 0%, #ff5e5e 100%) !important;
    opacity: 0.9;
    box-shadow: 0 0 10px rgba(255, 4, 4, 0.6);
    border-radius: 0 0 3px 3px;
    z-index: 1;
}

.fl-sticky-mixer-rack .fl-waveform-vumeter-container {
    flex: 0 0 16px;
    display: flex !important; /* 🔥 FORZAR VISIBILIDAD */
    justify-content: center;
    height: 80px;
    background: #000;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fl-sticky-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
}

.fl-sticky-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 200px; /* Tamaño fijo maestro */
    overflow: hidden;
}

.fl-sticky-title {
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    display: inline-block;
}

/* EFECTO PING-PONG */
.fl-sticky-title.is-scrolling {
    animation: fl-ping-pong 4s ease-in-out infinite alternate;
    animation-delay: 1.5s; /* Pausa inicial antes de empezar */
}

@keyframes fl-ping-pong {
    0%, 10% { transform: translateX(0); }
    90%, 100% { transform: translateX(calc(-1 * var(--scroll-dist, 0px))); }
}

.fl-sticky-artist {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CONTROLES (Ahora en bloque izquierdo) */
.fl-sticky-controls {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px; /* Más compacto para estar al lado del título */
    margin-left: 20px; /* Separación del texto de la canción */
}

.fl-sticky-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.fl-sticky-btn svg {
    fill: #fff;
    width: 26px;
    height: 26px;
    opacity: 0.8;
}

.fl-sticky-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

#fl-sticky-play {
    background: #ff0404 !important; /* Force FlowLatin Red */
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    box-shadow: 0 0 20px rgba(255, 4, 4, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#fl-sticky-play svg {
    fill: #fff !important; /* Iconos en blanco */
    width: 26px !important;
    height: 26px !important;
    opacity: 1 !important;
}

#fl-sticky-play:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 0 30px rgba(255, 4, 4, 0.5) !important;
    background: #e60000 !important;
}

/* 🔽 TOGGLE COLLAPSE (Oculto por defecto hasta que el player sea .active) */
.fl-sticky-toggle {
    position: absolute;
    left: 20px; /* 🔥 Movido de right a left */
    top: -26px; /* Sobresale por arriba */
    width: 32px;
    height: 26px;
    background: #ff0404;
    border-radius: 6px 6px 0 0;
    display: none; /* 🔥 Oculto por defecto */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    pointer-events: auto !important;
    transition: all 0.3s ease;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
}

/* Mostrar solo cuando el reproductor esté activo */
#fl-sticky-pro-player.active .fl-sticky-toggle {
    display: flex;
}

.fl-sticky-toggle svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    transition: transform 0.4s ease;
}

#fl-sticky-pro-player.is-collapsed .fl-sticky-toggle {
    top: -26px; /* Se queda pegado arriba mientras la barra baja */
}

#fl-sticky-pro-player.is-collapsed .fl-sticky-toggle svg {
    transform: rotate(180deg);
}

.fl-sticky-toggle:hover {
    background: #e60000;
    height: 30px;
    top: -30px;
}
