/* ==========================================
   ANIMATIONS - Micro-interactions & Effects
   ========================================== */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Stagger animation for cards */
.card.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.card.fade-in:nth-child(1) { animation-delay: 0.1s; }
.card.fade-in:nth-child(2) { animation-delay: 0.2s; }
.card.fade-in:nth-child(3) { animation-delay: 0.3s; }
.card.fade-in:nth-child(4) { animation-delay: 0.4s; }
.card.fade-in:nth-child(5) { animation-delay: 0.5s; }
.card.fade-in:nth-child(6) { animation-delay: 0.6s; }
.card.fade-in:nth-child(7) { animation-delay: 0.7s; }
.card.fade-in:nth-child(8) { animation-delay: 0.8s; }
.card.fade-in:nth-child(9) { animation-delay: 0.9s; }

/* Slide In from Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

/* Slide In from Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* Shimmer Loading Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Image Parallax */
.parallax {
    transition: transform 0.3s ease-out;
}

/* Smooth transitions for theme change */
body,
.header,
.card,
.btn,
.filter-pill {
    transition: background-color var(--transition-base),
                color var(--transition-base),
                border-color var(--transition-base);
}

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    height: 350px;
    border-radius: var(--radius-lg);
}

.skeleton-text {
    height: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

/* Gradient Animation */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

/* Magnetic Cursor Effect (Optional) */
@media (hover: hover) and (pointer: fine) {
    .magnetic {
        transition: transform 0.2s ease;
    }
}

/* Focus animations */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
    }
    100% {
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0);
    }
}

*:focus-visible {
    animation: focusRing 0.6s ease;
}

/* Page transitions */
.page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
}

.page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}

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