/**
 * PartyBox - Animation Styles
 * Keyframes and animation utilities
 */

/* Keyframe Animations */

/* Spin animation for loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

/* Slide in animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide up animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Pop in animation */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Bounce animation */
@keyframes bounce {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Shake animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-5px);
    }
    40%, 80% {
        transform: translateX(5px);
    }
}

/* Flip animations */
@keyframes flipOut {
    from {
        opacity: 1;
        transform: rotateY(0);
    }
    to {
        opacity: 0;
        transform: rotateY(90deg);
    }
}

@keyframes flipIn {
    from {
        opacity: 0;
        transform: rotateY(-90deg);
    }
    to {
        opacity: 1;
        transform: rotateY(0);
    }
}

/* Pulse glow animation */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 0, 110, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 0, 110, 0.6);
    }
}

/* Confetti animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Wheel spin slowdown */
@keyframes wheelSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(3600deg);
    }
}

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

/* Wiggle animation */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Animation utility classes */
.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease;
}

.animate-slide-up {
    animation: slideUp var(--transition-normal) ease;
}

.animate-slide-in {
    animation: slideIn var(--transition-normal) ease;
}

.animate-pop-in {
    animation: popIn var(--transition-normal) ease;
}

.animate-bounce {
    animation: bounce 0.5s ease-in-out;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

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

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

.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

/* Staggered animations for lists */
.stagger-animation > *:nth-child(1) { animation-delay: 0s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(9) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(10) { animation-delay: 0.45s; }

/* 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;
    }
}

/* Touch feedback */
.btn:active,
.card:active,
.game-card:active,
.choice-btn:active {
    transform: scale(0.97);
}

/* Smooth page transitions */
.screen {
    transform-origin: center center;
}

.screen.active {
    animation: fadeIn 0.3s ease;
}

/* Card hover effects */
@media (hover: hover) {
    .game-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .game-card:hover {
        transform: translateY(-4px) scale(1.02);
    }
    
    .game-card:hover .game-icon {
        animation: wiggle 0.5s ease-in-out;
    }
}

/* Success celebration effect */
.celebrate {
    position: relative;
    overflow: visible;
}

.celebrate::after {
    content: '🎉';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    animation: float 1s ease-in-out, fadeIn 0.3s ease;
}

/* Loading dots animation */
@keyframes loadingDots {
    0%, 20% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.loading-dots span {
    animation: loadingDots 1.4s infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Neon glow effects */
.neon-text {
    text-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        0 0 20px var(--primary),
        0 0 40px var(--primary);
}

.neon-box {
    box-shadow: 
        0 0 5px var(--primary),
        0 0 10px var(--primary),
        inset 0 0 5px rgba(255, 0, 110, 0.5);
}

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

.gradient-text-animated {
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--secondary),
        var(--accent),
        var(--primary)
    );
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s ease infinite;
}
