/* ==========================================
   4. ANIMACIONES Y EFECTOS VISUALES
   ========================================== */

/* ANIMACIÓN LATIDO BOTÓN */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 12px 30px rgba(212, 175, 55, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    }
}

/* EFECTO RESPLANDOR (SHINE) */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: shine-effect 3.5s infinite cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 1;
}

@keyframes shine-effect {
    0% {
        left: -150%;
    }

    15% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* EFECTO MARQUEE INTELIGENTE */
.track-info {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
}

.marquee-wrapper {
    display: inline-block;
    padding-left: 0;
    will-change: transform;
}

.track-item:hover .marquee-anim {
    animation: marquee-logic 8s linear infinite;
}

.marquee-wrapper p {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
}

@media (max-width: 768px) {
    .marquee-anim {
        animation: marquee-logic 12s linear infinite;
    }
}

@keyframes marquee-logic {
    0% {
        transform: translateX(0);
    }

    10% {
        transform: translateX(0);
    }

    90% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* SCROLL CUSTOM (BARRA RANKING) */
.scrollable-ranking {
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px !important;
}

.scrollable-ranking::-webkit-scrollbar {
    width: 6px;
}

.scrollable-ranking::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.scrollable-ranking::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 10px;
    transition: 0.3s;
}

.scrollable-ranking:hover::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
}

@media (min-width: 1024px) {
    .scrollable-ranking {
        max-height: 480px !important;
    }
}

/* CONTENEDOR CON FADE INFERIOR (Para rankings) */
.ranking-fade-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
}

.ranking-fade-wrapper::after {
    display: none;
}

/* Opcional: ocultar si no hay scroll (se puede hacer con JS más adelante si se pide) */

/* NEW STAGGERED ENTRY ANIMATIONS (Premium Feel) */
.fade-in-up {
    opacity: 0;
    animation: fadeUpAnim 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeUpAnim {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    opacity: 0;
    animation: scaleInAnim 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleInAnim {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* EFECTO DESTELLO SECUENCIAL PARA PASOS */
.sequential-shine {
    position: relative;
    overflow: hidden;
}

.sequential-shine::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 60%;
    height: 200%;
    background: linear-gradient(
        to right, 
        transparent 0%, 
        rgba(255, 255, 255, 0) 30%,
        rgba(255, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0) 70%,
        transparent 100%
    );
    transform: rotate(25deg);
    animation: shine-loop 6s infinite ease-in-out;
}

/* Tiempos para que vayan uno tras otro */
.shine-step-1::after { animation-delay: 0s; }
.shine-step-2::after { animation-delay: 1s; }
.shine-step-3::after { animation-delay: 2s; }

@keyframes shine-loop {
    0% { left: -150%; }
    15% { left: 150%; }
    100% { left: 150%; }
}
