/* ==========================================================================
   REPRODUCTOR GLOBAL BEATLATIN ? Apple Music Style (consolidado)
   ========================================================================== */

/* --- Shell --- */
.sticky-audio-player {
    position: fixed;
    bottom: 22px;
    left: 50%;
    z-index: 9999;
    width: min(620px, calc(100% - 32px));
    max-width: 620px;
    height: 56px;
    min-height: 56px;
    font-family: 'Sora', sans-serif;
    background: rgba(34, 34, 36, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 1000px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        inset 0 -1px 0 rgba(255, 255, 255, 0.035),
        0 18px 48px rgba(0, 0, 0, 0.46);
    backdrop-filter: blur(34px) saturate(185%);
    -webkit-backdrop-filter: blur(34px) saturate(185%);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sticky-audio-player.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Grid layout --- */
.player-container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    height: 56px;
    min-height: 56px;
    padding: 0 18px;
    box-sizing: border-box;
}

/* --- Left controls --- */
.player-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: max-content;
    padding-right: 4px;
}

.control-icon {
    font-size: 16px;
    line-height: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.control-icon:hover {
    color: #ffffff;
    transform: scale(1.06);
}

/* Play/pause: fixed box so center never shifts */
.play-pause-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

.play-pause-icons {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
}

.play-pause-icons i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25px;
    line-height: 1;
    color: #ffffff;
}

/* --- Center: cover + track + progress --- */
.player-center {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 25px 4px;
    align-items: center;
    align-content: center;
    column-gap: 12px;
    row-gap: 4px;
    width: 100%;
    min-width: 0;
    height: 42px;
}

.player-cover-link {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.player-cover-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.24);
}

.player-cover-link.is-disabled {
    pointer-events: none;
}

.player-cover,
.player-cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.62);
    font-size: 16px;
}

.player-cover-link.has-cover .player-cover-fallback,
.player-cover-link:not(.has-cover) .player-cover {
    display: none;
}

.player-track-block {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    overflow: hidden;
}

.player-artist {
    display: none;
}

/* --- Marquee --- */
.player-info-meta.marquee-fade-container {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    overflow: hidden;
    cursor: pointer;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.marquee-text-scroller {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    white-space: nowrap;
    overflow: hidden;
    will-change: auto;
}

.marquee-text-scroller.is-marquee {
    justify-content: flex-start;
    width: max-content;
    min-width: max-content;
    overflow: visible;
    animation: blMarqueeScroll 18s linear infinite;
    will-change: transform;
}

.player-title,
.marquee-cloned {
    flex: 0 0 auto;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 25px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.marquee-text-scroller.is-marquee .player-title,
.marquee-text-scroller.is-marquee .marquee-cloned {
    width: auto;
    min-width: max-content;
    text-align: left;
    overflow: visible;
    text-overflow: clip;
}

.marquee-cloned {
    display: none;
}

.marquee-text-scroller.is-marquee .marquee-cloned {
    display: block;
}

.player-info-meta.marquee-fade-container:hover .marquee-text-scroller.is-marquee {
    animation-play-state: paused;
}

@keyframes blMarqueeScroll {
    0%, 8% {
        transform: translate3d(0, 0, 0);
    }
    92%, 100% {
        transform: translate3d(calc(-50% - 24px), 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-text-scroller.is-marquee {
        animation: none;
        justify-content: center;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .marquee-text-scroller.is-marquee .marquee-cloned {
        display: none;
    }

    .marquee-text-scroller.is-marquee .player-title {
        width: 100%;
        min-width: 0;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- Progress --- */
.progress-row {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    width: 100%;
    height: 4px;
    gap: 6px;
    min-width: 0;
}

.player-time {
    width: 0;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.88);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.18s ease, width 0.18s ease, min-width 0.18s ease;
}

#current-time {
    text-align: right;
}

#total-time {
    text-align: left;
}

.sticky-audio-player.is-progress-hover .player-time {
    width: 42px;
    min-width: 42px;
    opacity: 1;
}

.sticky-audio-player.is-progress-hover .player-track-block {
    filter: blur(5px);
    opacity: 0.28;
}

.progress-container {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    transition: height 0.15s ease, background 0.15s ease;
}

.progress-container:hover {
    height: 4px;
    background: rgba(255, 255, 255, 0.24);
}

.progress-filled {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* --- Right: volume + options --- */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: max-content;
    padding-left: 2px;
}

.player-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.player-volume-toggle {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.player-volume-toggle:hover,
.player-volume-wrap.is-open .player-volume-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.volume-icon {
    font-size: 15px;
    color: currentColor;
}

.player-volume-popover {
    position: absolute;
    right: 0;
    bottom: 42px;
    width: 118px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.player-volume-wrap.is-open .player-volume-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#volume-slider {
    display: block;
    width: 100%;
    accent-color: #ffffff;
    opacity: 0.86;
    cursor: pointer;
}

/* --- Options menu --- */
.bl-options-menu-container {
    position: relative;
    display: inline-block;
}

button#bl-player-options-btn.bl-track-options-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.72);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

button#bl-player-options-btn.bl-track-options-btn:hover,
.bl-options-menu-container.active button#bl-player-options-btn.bl-track-options-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.bl-context-menu-glass {
    position: absolute;
    right: 0;
    bottom: 44px;
    width: 215px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(24, 24, 26, 0.84);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    z-index: 9999999;
    box-sizing: border-box;
    display: none;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.bl-context-menu-glass.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bl-context-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bl-context-menu-list .bl-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    color: #e2e2e4;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 9px;
    transition: background 0.15s ease, color 0.15s ease;
}

.bl-context-menu-list .bl-action-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bl-context-menu-list .bl-action-item i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.bl-arrow-marker {
    color: rgba(255, 255, 255, 0.4);
}

.bl-menu-back-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    cursor: pointer;
    border-radius: 9px;
}

.bl-menu-back-header:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.bl-menu-back-header i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* --- Video preview --- */
#global-video-wrapper {
    position: fixed;
    top: calc(100vh - 300px);
    left: calc(100vw - 520px);
    width: 290px;
    height: auto;
    min-height: 0;
    max-height: 165px;
    background: #000;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    z-index: 9998;
    overflow: hidden;
    cursor: move;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.8) rotateX(-15deg);
    transition: opacity 0.7s, visibility 0.7s, transform 0.7s;
    perspective: 1000px;
}

#global-video-wrapper.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1) rotateX(0deg);
}

#global-video-wrapper.ui-draggable-dragging {
    transition: none;
    height: auto;
}

#global-video-engine {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

#close-video-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, border-color 0.2s;
}

#close-video-preview:hover {
    background: #D90C0C;
    border-color: #D90C0C;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .sticky-audio-player {
        width: calc(100% - 18px);
        max-width: none;
        bottom: 14px;
        border-radius: 22px;
        background: rgba(34, 34, 36, 0.70);
    }

    .player-container {
        gap: 12px;
        padding: 0 12px;
    }

    .player-left {
        gap: 10px;
        padding-right: 2px;
    }

    .control-icon {
        font-size: 14px;
    }

    .play-pause-btn,
    .play-pause-icons {
        width: 28px;
        height: 28px;
    }

    .play-pause-icons i {
        font-size: 22px;
    }

    .player-center {
        grid-template-columns: 38px minmax(0, 1fr);
        grid-template-rows: 23px 4px;
        height: 40px;
        column-gap: 10px;
        row-gap: 3px;
    }

    .player-cover-link {
        width: 38px;
        height: 38px;
    }

    .player-track-block,
    .player-info-meta.marquee-fade-container,
    .marquee-text-scroller,
    .player-title,
    .marquee-cloned {
        height: 23px;
        line-height: 23px;
        font-size: 12.5px;
    }

    .player-volume-wrap {
        display: none;
    }

    .sticky-audio-player.is-progress-hover .player-time {
        width: 34px;
        min-width: 34px;
        font-size: 10px;
    }

    .bl-context-menu-glass,
    #bl-player-share-submenu {
        right: 40px;
        bottom: 55px;
        width: 200px;
    }

    #global-video-wrapper {
        top: auto;
        left: 50%;
        bottom: 105px;
        cursor: default;
        transform: translateX(-50%) translateY(40px) scale(0.8);
    }

    #global-video-wrapper.is-active {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* ==========================================================================
   OVERRIDE TEMA ? botones sin fondo blanco/rojo en hover
   ========================================================================== */

.sticky-audio-player .player-left button,
.sticky-audio-player .player-left .player-btn,
.sticky-audio-player .player-left .control-icon,
.sticky-audio-player #player-prev,
.sticky-audio-player #player-next,
.sticky-audio-player #player-playpause,
.sticky-audio-player .play-pause-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.85) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.sticky-audio-player .player-left button:hover,
.sticky-audio-player .player-left button:focus,
.sticky-audio-player .player-left button:active,
.sticky-audio-player .player-left .player-btn:hover,
.sticky-audio-player .player-left .player-btn:focus,
.sticky-audio-player .player-left .player-btn:active,
.sticky-audio-player .player-left .control-icon:hover,
.sticky-audio-player .player-left .control-icon:focus,
.sticky-audio-player .player-left .control-icon:active,
.sticky-audio-player #player-playpause:hover,
.sticky-audio-player #player-playpause:focus,
.sticky-audio-player #player-playpause:active,
.sticky-audio-player .play-pause-btn:hover,
.sticky-audio-player .play-pause-btn:focus,
.sticky-audio-player .play-pause-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    transform: scale(1.06);
}

.sticky-audio-player .player-left button i,
.sticky-audio-player .play-pause-icons i,
.sticky-audio-player #player-prev i,
.sticky-audio-player #player-next i {
    color: #ffffff !important;
}

.sticky-audio-player .player-left button:hover i,
.sticky-audio-player .player-left button:focus i,
.sticky-audio-player .player-left button:active i,
.sticky-audio-player .play-pause-icons i,
.sticky-audio-player #player-prev:hover i,
.sticky-audio-player #player-next:hover i {
    color: #ffffff !important;
}

.sticky-audio-player .play-pause-icons {
    background: transparent !important;
}

.sticky-audio-player .play-pause-icons i {
    transform: translate(-50%, -50%);
}

.sticky-audio-player .player-left button:hover .play-pause-icons i {
    transform: translate(-50%, -50%) scale(1.06);
}

/* ========================================================================== 
   FIX FINAL - VOLUMEN SIN FONDO BLANCO NI ROJO EN HOVER
   ========================================================================== */
.sticky-audio-player .player-volume-toggle,
.sticky-audio-player .player-volume-toggle:hover,
.sticky-audio-player .player-volume-toggle:focus,
.sticky-audio-player .player-volume-toggle:active,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle {
    background: transparent !important;
    background-color: transparent !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.sticky-audio-player .player-volume-toggle:hover,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle {
    color: #ffffff !important;
    transform: scale(1.04);
}

.sticky-audio-player .player-volume-toggle i,
.sticky-audio-player .player-volume-toggle svg,
.sticky-audio-player .player-volume-toggle:hover i,
.sticky-audio-player .player-volume-toggle:hover svg,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle i,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle svg {
    color: currentColor !important;
    fill: currentColor !important;
}
