/* Animation keyframes and utility classes */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px var(--color-accent-glow);
    }
    50% {
        box-shadow: 0 0 20px var(--color-accent-glow);
    }
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================
   ANIMATION UTILITY CLASSES
   ============================================ */

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

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

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

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

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

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

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

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

/* ============================================
   STAGGERED ANIMATIONS
   ============================================ */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* For elements that should start hidden before animation */
.animate-on-load {
    opacity: 0;
}

.animate-on-load.fade-in,
.animate-on-load.slide-up,
.animate-on-load.slide-down,
.animate-on-load.slide-in-left,
.animate-on-load.slide-in-right,
.animate-on-load.scale-in {
    animation-fill-mode: forwards;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   TRANSITION UTILITIES
   ============================================ */

.transition-none {
    transition: none !important;
}

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

.transition-normal {
    transition: all var(--transition-normal);
}

.transition-slow {
    transition: all var(--transition-slow);
}
