/* ============================================
   ANIMACIONES Y EFECTOS MODERNOS
   ============================================ */

/* Shake mejorado con mayor intensidad */
@keyframes shake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    10% {
        transform: translateX(-15px) rotate(-2deg);
    }
    20% {
        transform: translateX(15px) rotate(2deg);
    }
    30% {
        transform: translateX(-15px) rotate(-2deg);
    }
    40% {
        transform: translateX(15px) rotate(2deg);
    }
    50% {
        transform: translateX(-10px) rotate(-1deg);
    }
    60% {
        transform: translateX(10px) rotate(1deg);
    }
    70% {
        transform: translateX(-10px) rotate(-1deg);
    }
    80% {
        transform: translateX(10px) rotate(1deg);
    }
    90% {
        transform: translateX(-5px) rotate(-0.5deg);
    }
}

.shake {
    animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Caída de corazones mejorada con rotación y fade */
@keyframes heartFall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(255, 0, 85, 0.8));
    }
    25% {
        transform: translateY(150px) rotate(90deg) scale(0.9);
        opacity: 0.8;
        filter: drop-shadow(0 0 6px rgba(255, 0, 85, 0.6));
    }
    50% {
        transform: translateY(300px) rotate(180deg) scale(0.7);
        opacity: 0.5;
        filter: drop-shadow(0 0 4px rgba(255, 0, 85, 0.4));
    }
    75% {
        transform: translateY(450px) rotate(270deg) scale(0.5);
        opacity: 0.3;
        filter: drop-shadow(0 0 2px rgba(255, 0, 85, 0.2));
    }
    100% {
        transform: translateY(600px) rotate(360deg) scale(0.3);
        opacity: 0;
        filter: drop-shadow(0 0 0 transparent);
    }
}

.heart-falling {
    animation: heartFall 1.2s cubic-bezier(0.55, 0, 0.1, 1) forwards;
    pointer-events: none;
}

/* Efecto de partículas al acertar */
@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

.particle-burst {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--particle-color, #00ff88);
    border-radius: 50%;
    pointer-events: none;
    animation: particleBurst 0.8s ease-out forwards;
    box-shadow: 0 0 10px var(--particle-color, #00ff88);
}

/* Pulso de resplandor para elementos importantes */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px var(--glow-color),
            0 0 40px var(--glow-color);
    }
    50% {
        box-shadow: 
            0 0 30px var(--glow-color),
            0 0 60px var(--glow-color),
            0 0 80px var(--glow-color);
    }
}

/* Animación de aparición suave */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Animación de aparición con escala */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Efecto de onda al hacer clic */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    width: 20px;
    height: 20px;
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Rotación suave continua */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotating {
    animation: rotate 3s linear infinite;
}

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

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Efecto de destello */
@keyframes shine {
    0% {
        left: -100%;
    }
    20%, 100% {
        left: 100%;
    }
}

.shine-effect {
    position: relative;
    overflow: hidden;
}

.shine-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 3s ease-in-out infinite;
}

/* Animación de éxito (tick verde) */
@keyframes successTick {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.success-tick {
    animation: successTick 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Animación de error (X roja) */
@keyframes errorCross {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

.error-cross {
    animation: errorCross 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Vibración sutil para hover */
@keyframes hover-vibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.hover-vibrate:hover {
    animation: hover-vibrate 0.3s ease-in-out;
}

/* Efecto de escritura (typing) */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--neon-pink, #ff007f); }
}

.typing-effect {
    overflow: hidden;
    border-right: 3px solid;
    white-space: nowrap;
    animation: 
        typing 2s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* Efecto neón pulsante */
@keyframes neonPulse {
    0%, 100% {
        text-shadow: 
            0 0 5px currentColor,
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor;
        filter: brightness(1);
    }
    50% {
        text-shadow: 
            0 0 10px currentColor,
            0 0 20px currentColor,
            0 0 40px currentColor,
            0 0 80px currentColor,
            0 0 120px currentColor;
        filter: brightness(1.5);
    }
}

.neon-pulse {
    animation: neonPulse 2s ease-in-out infinite;
}

/* Parpadeo rápido para alertas */
@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0; }
}

.blinking {
    animation: blink 1s linear infinite;
}

/* Zoom in suave */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.zoom-in {
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Slide desde arriba */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Efecto de dispersión */
@keyframes scatter {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: 
            translate(
                calc(var(--scatter-x, 0) * 100px), 
                calc(var(--scatter-y, 0) * 100px)
            ) 
            scale(0);
        opacity: 0;
    }
}

.scatter {
    animation: scatter 1s ease-out forwards;
}

/* Efecto de rebote */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-20px);
    }
    50% {
        transform: translateY(0);
    }
    75% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 1s ease-in-out;
}

/* Gradiente animado de fondo */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animation {
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
}

/* Efecto de carga/loading */
@keyframes loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--neon-pink, #ff007f);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: loading 1s linear infinite;
}

/* Ondulación al aparecer */
@keyframes wave {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.wave-effect {
    position: relative;
}

.wave-effect::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: wave 1.5s ease-out infinite;
}
