/* ==========================================================================
   INCLUSIV DESIGN SYSTEM — Animations
   Entrance animations, transitions, scroll reveals
   ========================================================================== */

/* ==========================================================================
   ENTRANCE ANIMATIONS
   ========================================================================== */

@keyframes iv-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes iv-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iv-fade-down {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes iv-fade-left {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.iv-animate-fade-in {
    animation: iv-fade-in var(--transition-base) ease both;
}

.iv-animate-fade-up {
    animation: iv-fade-up var(--transition-slow) ease both;
}

.iv-animate-fade-down {
    animation: iv-fade-down var(--transition-slow) ease both;
}

.iv-animate-fade-left {
    animation: iv-fade-left var(--transition-slow) ease both;
}

.iv-animate-scale-in {
    animation: iv-scale-in var(--transition-slow) ease both;
}

/* ==========================================================================
   STAGGER DELAYS
   ========================================================================== */

.iv-stagger-1 { animation-delay: 50ms; }
.iv-stagger-2 { animation-delay: 100ms; }
.iv-stagger-3 { animation-delay: 150ms; }
.iv-stagger-4 { animation-delay: 200ms; }
.iv-stagger-5 { animation-delay: 250ms; }
.iv-stagger-6 { animation-delay: 300ms; }

/* ==========================================================================
   SCROLL REVEAL
   ========================================================================== */

.iv-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.iv-reveal.iv-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   COUNT-UP ANIMATION (JS-driven, class only sets style)
   ========================================================================== */

.iv-count-up {
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   SPINNER / LOADING
   ========================================================================== */

@keyframes iv-spin {
    to { transform: rotate(360deg); }
}

.iv-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: iv-spin 0.6s linear infinite;
}

.iv-spinner--lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ==========================================================================
   LOADING STATE
   ========================================================================== */

.iv-loading {
    position: relative;
    pointer-events: none;
}

.iv-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 18, 25, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 10;
}

/* ==========================================================================
   PULSE ANIMATION (for live indicators)
   ========================================================================== */

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

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

/* ==========================================================================
   REDUCED MOTION — Kill all animations
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .iv-animate-fade-in,
    .iv-animate-fade-up,
    .iv-animate-fade-down,
    .iv-animate-fade-left,
    .iv-animate-scale-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .iv-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .iv-spinner {
        animation-duration: 1.5s;
    }

    .iv-pulse {
        animation: none !important;
    }
}
