/* Todays.gg - Creative Animations and Effects */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Subtle animations for elements entering viewport */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Pulse animation for important elements */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Apply animations to specific elements */
.stack {
    animation: slideUp 0.6s ease-out;
}

.home-grid > .stack:nth-child(1) {
    animation-delay: 0.1s;
}

.home-grid > .stack:nth-child(2) {
    animation-delay: 0.2s;
}

.post-card,
.featured-post-card,
.related-card {
    animation: slideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.post-card:nth-child(odd) {
    animation-name: slideInLeft;
}

.post-card:nth-child(even) {
    animation-name: slideInRight;
}

/* Staggered animation for post cards */
.home-grid .post-card:nth-child(1) { animation-delay: 0.1s; }
.home-grid .post-card:nth-child(2) { animation-delay: 0.2s; }
.home-grid .post-card:nth-child(3) { animation-delay: 0.3s; }
.home-grid .post-card:nth-child(4) { animation-delay: 0.4s; }
.home-grid .post-card:nth-child(5) { animation-delay: 0.5s; }
.home-grid .post-card:nth-child(6) { animation-delay: 0.6s; }

/* Subtle hover glow effect */
.post-card:hover,
.featured-post-card:hover,
.related-card:hover {
    box-shadow:
        var(--shadow-medium),
        0 0 20px rgba(79, 70, 229, 0.1);
}

/* Loading shimmer effect */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Gradient text animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-text {
    background: linear-gradient(-45deg, #059669, #10b981, #0d9488, #047857);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
}

/* Interactive button press effect */
.btn:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* Focus ring improvements */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
