/**
 * Minigames Hybrid Animations
 * Smooth animations and micro-interactions
 */

/* Fade in animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@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); }
}

/* Page load animations */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* Stagger animations for lists */
.animate-stagger > * {
    animation: fadeIn 0.6s ease-out;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.6s; }

/* Hover animations */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-game);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Loading animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Bounce animation for interactive elements */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
    40%, 43% { transform: translateY(-8px); }
    70% { transform: translateY(-4px); }
    90% { transform: translateY(-2px); }
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

/* Entrance animations for components */
.entrance-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.entrance-animation.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transitions for theme elements */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Game card specific animations */
.game-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover {
    transform: scale(1.05) translateZ(0);
}

/* Category card animations */
.category-card {
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px) scale(1.02);
}

/* Header scroll animation */
.site-header {
    transition: all 0.3s ease;
}

.site-header.scrolled {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Text animations */
@keyframes textGlow {
    0%, 100% { text-shadow: 0 0 5px var(--accent-primary); }
    50% { text-shadow: 0 0 20px var(--accent-primary), 0 0 30px var(--accent-primary); }
}

.text-glow:hover {
    animation: textGlow 1s ease-in-out;
}

/* Carousel smooth scrolling */
.game-carousel {
    scroll-behavior: smooth;
}

/* Focus animations for accessibility */
.focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@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;
    }
}