/**
 * animations.css
 * Centralized animation keyframes and utility classes
 * Replaces duplicated animations across multiple CSS files
 */

/* =========================================
   Basic Animations
   ========================================= */

/* Fade In - Basic opacity fade */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Fade In with Y translation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Fade In with scale */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

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

/* Scale In - Grow from slightly smaller */
@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide Up - From bottom with translate */
@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* =========================================
   Spinner Animations
   ========================================= */

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

    to {
        transform: rotate(360deg);
    }
}

/* =========================================
   Feedback Animations
   ========================================= */

/* Shake - For error feedback */
@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Pulse Ring - For attention-grabbing effects */
@keyframes pulse-ring {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* =========================================
   Slide Animations (for toasts/notifications)
   ========================================= */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* =========================================
   Animation Utility Classes
   ========================================= */

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

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

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

.animate-fade-in-scale {
    animation: fadeInScale 0.4s ease-out;
}

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

.animate-shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.animate-pulse-ring {
    animation: pulse-ring 1.5s ease-out infinite;
}

/* Fade In class - General use */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}