/* ==========================================================================
   PLAYER.CSS - VERSIÓN ORO (LAYOUT INFO/CARÁTULA COMO PLATA)
   Solo carátula + título + artista copiados del plata, resto intacto
   ========================================================================== */

.player-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5vw;
    padding: 20px;
    /* 👈 Este es el valor que igualamos en ORO */
}


.art-container {
    position: relative;
    width: min(45vh, 350px);
    aspect-ratio: 1/1;
    min-width: 220px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: all var(--transition-smooth);
}

.cover-wrapper {
    position: relative;
    width: fit-content;
}

.main-art {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    border: 3px solid var(--glass-border);
    box-shadow: var(--shadow-depth), var(--shadow-glow);
    transition: opacity 0.8s ease-in-out, transform 1s ease-in-out;
    transform: translateZ(0);
    will-change: opacity, transform;
}

.hide-cover {
    opacity: 0 !important;
    transform: scale(0.95) !important;
}

/* AURA CUANDO REPRODUCE (intacto del oro) */
.main-art.playing-glow {
    border-color: rgba(var(--primary-rgb), 0.8) !important;
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(var(--primary-rgb), 0.5),
        0 0 80px rgba(var(--primary-rgb), 0.3) !important;
    animation: pulse-aura 3s ease-in-out infinite;
}

@keyframes pulse-aura {

    0%,
    100% {
        box-shadow:
            0 15px 45px rgba(0, 0, 0, 0.6),
            0 0 40px rgba(var(--primary-rgb), 0.5),
            0 0 80px rgba(var(--primary-rgb), 0.3);
    }

    50% {
        box-shadow:
            0 15px 45px rgba(0, 0, 0, 0.6),
            0 0 60px rgba(var(--primary-rgb), 0.7),
            0 0 100px rgba(var(--primary-rgb), 0.4);
    }
}

.info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 500px;
    width: 100%;
    /* Forzar que ocupe el espacio asignado */
    overflow: hidden;
    /* Prevenir que estire la grid */
}

/* ==========================================================================
   ✨ BADGE "EN VIVO" - CLASE MAESTRA UNIFICADA (PARIDAD CON BRONCE/PLATA)
   ========================================================================== */
.badge-envivo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px) saturate(160%);
    -webkit-backdrop-filter: blur(10px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.2);

    border-radius: 9999px;
    padding: 0.35em 1em;

    min-width: 11rem;
    /* Ancho fijo idéntico a Plata */
    width: fit-content;
    margin: 0 auto 0.625rem auto;

    font-family: var(--font-titulo);
    font-size: clamp(0.625rem, 1.5vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #fff;
}

.badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #ff3333;
    flex-shrink: 0;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(255, 51, 51, 0);
    }
}

.badge-text {
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    color: #fff;
}

.badge-divider {
    width: 1px;
    height: 0.9em;
    background: rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.badge-listeners {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: inherit;
    font-family: inherit;
    font-weight: 700;
    color: #fff;
}

.badge-listeners i {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.8);
}

/* Ocultar oyentes (solo Bronce) */
.badge-no-listeners .badge-divider,
.badge-no-listeners .badge-listeners {
    display: none;
}

.dot {
    width: 10px;
    /* Más grande como en tu imagen de referencia */
    height: 10px;
    border-radius: 50%;
    background: #ff0000;
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}

.live-text {
    font-family: var(--font-titulo);
    font-size: 0.75rem;
    font-weight: bold;
    /* ← Más impacto visual */
    letter-spacing: 1.5px;
    /* ← Menos estirado que 2px */
    color: var(--text-white);
    text-transform: uppercase;
    white-space: nowrap;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Máscara para fade en los bordes */
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

#track-title {
    font-family: var(--font-titulo);
    font-size: 2.2rem;
    white-space: nowrap;
    display: inline-block;
    will-change: transform;
    margin: 0;
    padding: 0;
    flex-shrink: 0; /* No permitir que flexbox lo achique */
}

/* ✨ MARQUESINA DINÁMICA: Título */
.marquee-active {
    white-space: nowrap;
    overflow: hidden;
    display: inline-block !important;
    padding-right: 50px; /* Espacio para que no choque al dar la vuelta */
    animation: scrollText 12s linear infinite; /* Equilibrio de velocidad */
    will-change: transform;
    flex-shrink: 0;
    width: max-content !important;
}

@keyframes scrollText {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100% - 10px)); }
}

/* Pausar al hacer hover (mejor UX) */
.marquee-container:hover .track-title-marquee,
.artist-container:hover .track-artist-marquee {
    animation-play-state: paused;
}

/* ✨ MARQUESINA DINÁMICA: Artista */
.artist-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

#track-artist {
    white-space: nowrap;
    display: inline-block;
    will-change: transform;
    margin: 0;
    padding: 0;
}

/* .track-artist-marquee reemplazado por .marquee-active */

/* Espacio entre repeticiones del loop */
.marquee-spacer {
    display: inline-block;
    padding: 0 50px;
    opacity: 0;
}

/* Animación UNIVERSAL SIN COSTURAS (Loop 0 a -50%) */
/* Animación marquee-infinite-loop reemplazada por scrollText */

.marquee-content {
    display: inline-block;
}

.artist-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;

    /* Máscara para el artista también */
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

#track-artist {
    font-family: var(--font-artista);
    font-size: 1.3rem;
    opacity: 0.85;
    margin-top: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}


/* ==========================================================================
    🎚️ CONTROL DE VOLUMEN PROFESIONAL (ULTRA PRO)
   ========================================================================== */

.volume-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    min-height: 60px;
    padding: 18px 35px;

    /* Glassmorphism mejorado */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.12) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.15);

    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    transition: all var(--transition-smooth);
}

.volume-container:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.18) 100%);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.volume-icon {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-fast);
}

.volume-container:hover .volume-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* ✨ SLIDER PROFESIONAL */
.volume-slider-wrapper {
    position: relative;
    flex: 1;
    max-width: 180px;
}

#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 10px;

    /* Track con gradiente */
    background: linear-gradient(to right,
            var(--primary-color) 0%,
            var(--primary-color) var(--volume-percent, 50%),
            rgba(255, 255, 255, 0.15) var(--volume-percent, 50%),
            rgba(255, 255, 255, 0.15) 100%);

    outline: none;
    cursor: pointer;

    /* Touch area ampliada */
    padding: 18px 0;
    margin: -18px 0;

    transition: all var(--transition-fast);
}

#volume-slider:hover {
    background: linear-gradient(to right,
            var(--primary-color) 0%,
            var(--primary-color) var(--volume-percent, 50%),
            rgba(255, 255, 255, 0.25) var(--volume-percent, 50%),
            rgba(255, 255, 255, 0.25) 100%);
}

/* ✨ THUMB PROFESIONAL (Chrome/Safari) */
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;

    /* Glassmorphism en el thumb */
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);

    border: 3px solid var(--primary-color);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(0, 86, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);

    cursor: pointer;

    transition: all var(--transition-fast);
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.4),
        0 0 0 6px rgba(0, 86, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#volume-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

/* ✨ THUMB PROFESIONAL (Firefox) */
#volume-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid var(--primary-color);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(0, 86, 255, 0.2);
    cursor: pointer;
}

/* ✨ PORCENTAJE CON TOOLTIP */
#vol-pct {
    min-width: 45px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);

    /* Glassmorphism mini */
    background: rgba(0, 86, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;

    transition: all var(--transition-fast);
}

.volume-container:hover #vol-pct {
    background: rgba(0, 86, 255, 0.2);
    transform: scale(1.05);
}


#pwa-install-btn {
    display: none;
    background: linear-gradient(135deg, var(--primary-color), #0099ff);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 12px 24px;
    font-family: var(--font-artista);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 15px;
    transition: all var(--transition-smooth);
}

#pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4);
}

/* ==========================================================================
   13. RESPONSIVE - MOBILE FIRST & PORTRAIT VERTICAL
   ========================================================================== */

@media (max-width: 999px) and (orientation: portrait),
(max-width: 768px) {
    .player-main {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 20px !important;
        padding: 15px;
        margin-top: 2vh;
    }

    /* Grid A (Carátula): Centrada arriba */
    .art-container {
        width: min(60vw, 320px);
        margin: 0 auto;
        justify-self: center !important;
    }

    /* Grid B (Información): Centrada abajo */
    .info-wrapper {
        width: 100%;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-self: center !important;
        padding-right: 0 !important;
    }

    .marquee-container,
    .artist-container,
    .volume-container {
        justify-content: center;
        width: 100%;
    }


    .volume-container {
        display: none !important;
    }

    .live-indicator {
        margin-top: -5px;
        margin-bottom: 10px;
        /* Consistencia total */
        gap: 5px;
    }

    .marquee-container {
        width: 90vw;
        max-width: 320px;
        margin: 0 auto;
    }

    #track-title {
        font-size: 1.6rem;
    }

    #track-artist {
        font-size: 1rem;
        opacity: 0.75;
    }

    .social-trigger {
        padding: 8px 22px;
        font-size: 0.7rem;
    }

    .site-header {
        height: 70px;
    }

    .header-content-centered {
        gap: 15px;
    }

    .header-name {
        font-size: 1rem;
        letter-spacing: 2px;
    }

    .header-slogan {
        font-size: 0.5rem;
        letter-spacing: 2px;
    }

    .header-logo {
        height: 35px;
    }

    .social-icons-grid {
        gap: 25px;
        padding: 0 20px;
    }

    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 2rem;
    }
}

@media (min-width: 1000px) {
    .player-main {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 4vw;
        width: 100%;
        max-width: 1600px;
        margin: 0 auto;
        padding: 40px;
        animation: smooth-reveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .art-container {
        width: 330px;
        max-width: 40vw;
        justify-self: end;
        animation: smooth-reveal 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    .info-wrapper {
        justify-self: start;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 550px;
        padding-right: 50px;
        /* Igual que PLATA */
        animation: smooth-reveal 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    /* ← Cambiado: quitamos .live-indicator del width: 100% */
    .marquee-container,
    .artist-container {
        justify-content: center;
        width: 100%;
    }

    /* ← Nuevo: aseguramos que el indicador en vivo sea compacto y centrado */
    .live-indicator {
        width: fit-content;
        margin: 0 auto;
        justify-content: center;
        /* Centra el contenido interno si hubiera espacio */
    }

    #track-title {
        font-size: 2.8rem;
    }
}

/* ==========================================================================
   15. PREFERS-REDUCED-MOTION (ACCESIBILIDAD)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .dot::before,
    #bg-cover-blur,
    .pulse-bar,
    .main-art.playing {
        animation: none !important;
    }
}

.volume-changing {
    background: rgba(0, 0, 0, 0.75) !important;
    border-color: rgba(var(--primary-rgb), 0.4) !important;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(var(--primary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.volume-changing {
    background: rgba(0, 0, 0, 0.75) !important;
    border-color: rgba(var(--primary-rgb), 0.4) !important;
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(var(--primary-rgb), 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}