/* ========== ANIMATIONS CSS - SpotiTube ========== */
/* Archivo: public/css/animations.css */
/* Descripción: Definiciones de animaciones y transiciones */

/* ========== KEYFRAMES ========== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade Out */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Slide In from Top */
@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In from Bottom */
@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide In from Left */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Slide In from Right */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Pulse */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Shake */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Spin */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scale Out */
@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--spotify-green), 0 0 10px var(--spotify-green);
    }
    50% {
        box-shadow: 0 0 20px var(--spotify-green), 0 0 30px var(--spotify-green);
    }
}

/* Progress Bar Animation */
@keyframes progressPulse {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Wiggle */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* ========== CLASES DE ANIMACIÓN ========== */

/* Fade */
.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease-out forwards;
}

/* Slide */
.animate-slideIn {
    animation: slideInFromTop 0.5s ease-out;
}

.animate-slideInBottom {
    animation: slideInFromBottom 0.5s ease-out;
}

.animate-slideInLeft {
    animation: slideInFromLeft 0.5s ease-out;
}

.animate-slideInRight {
    animation: slideInFromRight 0.5s ease-out;
}

/* Pulse */
.animate-pulse {
    animation: pulse 2s infinite;
}

/* Shake */
.shake {
    animation: shake 0.5s ease-in-out;
}

/* Bounce */
.animate-bounce {
    animation: none;
}

.logo-bounce {
    animation: none;
}

.spotify-logo-bounce {
    animation: none;
}

/* Scale */
.animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
}

.animate-scaleOut {
    animation: scaleOut 0.3s ease-out forwards;
}

/* Glow */
.animate-glow {
    animation: glowPulse 2s ease-in-out infinite;
}

/* Float */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* Wiggle */
.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

/* ========== TRANSICIONES ESPECÍFICAS ========== */

/* Hover lift */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

/* Hover scale */
.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Hover glow */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow-green);
}

/* ========== ANIMACIONES DE CARGA ========== */

/* Skeleton loading */
@keyframes skeleton {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--spotify-gray) 8%,
        var(--spotify-light-gray) 18%,
        var(--spotify-gray) 33%
    );
    background-size: 200px 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

/* Dots loading */
@keyframes dots {
    0%, 20% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
    }
    100% {
        transform: scale(1);
    }
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--spotify-green);
    border-radius: 50%;
    margin: 0 4px;
    animation: dots 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ========== PREFERENCIAS DE MOVIMIENTO REDUCIDO ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-bounce,
    .logo-bounce,
    .spotify-logo-bounce,
    .animate-pulse,
    .animate-float {
        animation: none;
    }
}
