/**
 * animations.css
 * Extracted from inline styles across EnigmAPI frontend
 * Contains all reusable keyframe animations and transitions
 */

/* ========================================
   KEYFRAME ANIMATIONS
   ======================================== */

/**
 * Pulse Animation
 * Extracted from: dashboard.html, index.html (2 files)
 * Used for: Loading states, active indicators, attention-grabbing elements
 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/**
 * Pulse (Opacity Only) - Lightweight variant
 * Extracted from: dashboard.html
 * Used for: Subtle loading indicators
 */
@keyframes pulse-opacity {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/**
 * Spin Animation
 * Extracted from: assigned-bots.html
 * Used for: Loading spinners, refresh icons
 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

/**
 * Fade In Animation
 * Common pattern across multiple files
 * Used for: Page transitions, modal appearances
 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/**
 * Fade In Up Animation
 * Used for: Card entrances, staggered content reveals
 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/**
 * Slide In From Right
 * Used for: Sidebar/drawer animations
 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/**
 * Slide In From Left
 * Used for: Sidebar/drawer animations
 */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/**
 * Bounce Animation
 * Used for: Success indicators, notifications
 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/**
 * Shake Animation
 * Used for: Error states, validation failures
 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========================================
   UTILITY ANIMATION CLASSES
   ======================================== */

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-pulse-opacity {
    animation: pulse-opacity 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.animate-bounce {
    animation: bounce 0.5s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* ========================================
   TRANSITION UTILITIES
   ======================================== */

.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

.transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.transition-transform {
    transition: transform 0.3s ease;
}

.transition-opacity {
    transition: opacity 0.3s ease;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: rgba(99, 102, 241, 1);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ========================================
   HOVER ANIMATIONS
   ======================================== */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}
