/* ===================================================
   Animations & Transitions
   =================================================== */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card entrance animation */
.post-card-col {
    animation: fadeInUp .5s ease both;
}
.post-card-col:nth-child(1) { animation-delay: .05s; }
.post-card-col:nth-child(2) { animation-delay: .1s; }
.post-card-col:nth-child(3) { animation-delay: .15s; }
.post-card-col:nth-child(4) { animation-delay: .2s; }
.post-card-col:nth-child(5) { animation-delay: .25s; }
.post-card-col:nth-child(6) { animation-delay: .3s; }

/* AJAX loaded cards */
.post-card-col.ajax-loaded {
    animation: fadeInUp .4s ease both;
}

/* Live search dropdown */
.live-search-dropdown {
    animation: slideDown .2s ease;
}

/* Stat counter */
.stat-counter {
    animation: countUp .5s ease both;
}
.stat-counter:nth-child(2) { animation-delay: .1s; }
.stat-counter:nth-child(3) { animation-delay: .2s; }
.stat-counter:nth-child(4) { animation-delay: .3s; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--sb-bg-secondary) 25%,
        var(--sb-bg-tertiary) 50%,
        var(--sb-bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--sb-radius-sm);
}

/* Hero animations */
.hero-main {
    animation: fadeIn .6s ease;
}
.hero-side-post {
    animation: fadeInUp .5s ease both;
}
.hero-side-post:nth-child(1) { animation-delay: .15s; }
.hero-side-post:nth-child(2) { animation-delay: .25s; }
.hero-side-post:nth-child(3) { animation-delay: .35s; }

/* Scroll reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .6s ease, transform .6s ease;
}
.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth interactions */
.post-card,
.category-card,
.related-card,
.subcategory-card {
    will-change: transform;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}