/* ============================================
   ANIMATIONS.CSS - ANIMACIONES Y TRANSICIONES
   Keyframes, Transiciones, Efectos Visuales
   Centralizado: Única fuente de animaciones
   ============================================ */

/* ========== ANIMACIÓN POP IN ========== */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.pop-in {
    animation: popIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========== ANIMACIÓN FADE IN ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========== ANIMACIÓN FADE IN UP ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========== ANIMACIÓN SLIDE DOWN ========== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slideDown 0.2s ease-out;
}

/* ========== ANIMACIÓN SLIDE IN (LATERAL) ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* ========== ANIMACIÓN SLIDE OUT ========== */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

.slide-out {
    animation: slideOut 0.3s ease-out;
}

/* ========== ANIMACIÓN SLIDE UP ========== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* ========== ANIMACIÓN PULSE (GENÉRICA) ========== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.pulse {
    animation: pulse 1s infinite;
}

/* ========== ANIMACIÓN COUNTDOWN PULSE ========== */
@keyframes pulse-countdown {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

.countdown-display,
.countdown-pulse {
    animation: pulse-countdown 1s infinite;
}

/* ========== ANIMACIÓN READY PULSE ========== */
@keyframes readyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.ready-pulse {
    animation: readyPulse 1s infinite;
}

/* ========== ANIMACIÓN SELECT PULSE ========== */
@keyframes selectedPulse {
    0%, 100% {
        transform: scale(1.2) rotate(0deg);
    }
    50% {
        transform: scale(1.25) rotate(5deg);
    }
}

.selected-pulse,
.select-pulse {
    animation: selectedPulse 1s infinite;
}

/* ========== ANIMACIÓN GLOW ========== */
@keyframes glow {
    from {
        filter: drop-shadow(0 0 20px #00F0FF);
    }
    to {
        filter: drop-shadow(0 0 40px #FF0055);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

/* ========== ANIMACIÓN SHAKE ========== */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* ========== ANIMACIÓN BOUNCE ========== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.bounce {
    animation: bounce 0.6s;
}

/* ========== ANIMACIÓN HEARTBEAT ========== */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
}

.heartbeat {
    animation: heartbeat 0.6s ease-in-out;
}

/* ========== ANIMACIÓN FLIP ========== */
@keyframes flip {
    from {
        transform: rotateY(0deg);
    }
    to {
        transform: rotateY(360deg);
    }
}

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

/* ========== ANIMACIÓN SPIN (LOADING) ========== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ========== TRANSICIÓN DE FONDO ========== */
@keyframes backgroundShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.background-shift {
    background-size: 200% 200%;
    animation: backgroundShift 3s ease infinite;
}

/* ========== RIPPLE EFFECT ========== */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

/* ========== TIMER HURRY UP (REMATE) - UNIFIED ========== */
@keyframes tc-timer-hurry {
    0%, 100% {
        transform: scale(1);
        color: #FF6B6B;
        text-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
    }
    50% {
        transform: scale(1.08);
        color: #FF3333;
        text-shadow: 0 0 20px rgba(255, 107, 107, 0.9);
    }
}

.tc-timer--hurry,
.header-timer.timer-warning,
.timer-display.warning {
    animation: tc-timer-hurry 0.6s ease-in-out infinite;
    color: #FF6B6B !important;
}

/* ========== BUTTON HURRY PULSE (HOST) ========== */
@keyframes hurry-pulse {
    0%, 100% {
        background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 50%), rgba(255, 215, 0, 0.18);
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.35);
    }
    50% {
        background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 50%), rgba(255, 215, 0, 0.28);
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.40);
    }
}

.btn-hurry-up {
    animation: hurry-pulse 1.2s ease-in-out infinite;
}

/* ========== COPIED PULSE (FEEDBACK) ========== */
@keyframes copiedPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.code-sticker-floating.copied {
    animation: copiedPulse 0.6s ease-out;
}

/* ========== TRANSICIONES SELECTIVAS ========== */
button, .btn, [role="button"] {
    transition: transform var(--transition-fast) ease, 
                background-color var(--transition-fast) ease,
                border-color var(--transition-fast) ease;
}

input, select, textarea {
    transition: border-color var(--transition-normal) ease, 
                background-color var(--transition-normal) ease,
                box-shadow var(--transition-normal) ease;
}

input:focus, select:focus, textarea:focus {
    transition: border-color var(--transition-normal) ease, 
                background-color var(--transition-normal) ease,
                box-shadow var(--transition-normal) ease;
}

/* ========== TRANSFORMACIÓN SUAVE ========== */
.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

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

.hover-glow:hover {
    filter: brightness(1.1);
}

/* ========== DISABLE SMOOTH TRANSITIONS PARA PERFORMANCE ========== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
