/* ============================================
   WebForge — Animations
   ============================================ */

/* === Fade In Up (on scroll) === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@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);
    }
}

/* Initial state for elements that animate on scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.stagger-children .animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.stagger-children .animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.stagger-children .animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.stagger-children .animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.stagger-children .animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.stagger-children .animate-on-scroll:nth-child(6) { transition-delay: 400ms; }

/* === Theme transition === */
body.theme-transitioning,
body.theme-transitioning * {
    transition: background-color var(--transition-theme),
                color var(--transition-theme),
                border-color var(--transition-theme),
                box-shadow var(--transition-theme) !important;
}

/* === Hover lift for cards === */
.card-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* === Pulse animation for accents === */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* === Glow effect === */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(88, 166, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
    }
}

/* === Loading spinner === */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .card-lift:hover {
        transform: none;
    }

    .animate-pulse {
        animation: none;
    }

    body.theme-transitioning,
    body.theme-transitioning * {
        transition: none !important;
    }
}