/* Spin animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Wheel spinning class */
.wheel-spinning {
    animation: spin 0.5s linear infinite;
}

/* Bounce animation for buttons */
@keyframes bounce {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in animation */
@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Pulse animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Glow animation */
@keyframes glow {
    0%,
    100% {
        box-shadow: 0 0 5px currentColor;
    }
    50% {
        box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

/* Shake animation for errors */
@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

/* Confetti animation for wins */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Timer countdown pulse */
@keyframes timer-pulse {
    0% {
        transform: scale(1);
        color: var(--accent-primary);
    }
    50% {
        transform: scale(1.1);
        color: var(--accent-secondary);
    }
    100% {
        transform: scale(1);
        color: var(--accent-primary);
    }
}

/* Animated classes */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

.pulse {
    animation: pulse 1s ease-in-out infinite;
}

.shake {
    animation: shake 0.3s ease-in-out;
}

.bounce-hover:hover {
    animation: bounce 0.5s ease-in-out infinite;
}

/* Result reveal animation */
.result-reveal {
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Timer warning animation */
.timer-warning {
    animation: timer-pulse 1s ease-in-out infinite;
}

/* Sector item drag animation */
.sector-item-dragging {
    opacity: 0.5;
    transform: scale(1.05);
    cursor: grabbing;
}

/* Loading spinner */
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

/* Share button success animation */
@keyframes share-success {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.share-success {
    animation: share-success 0.5s ease-in-out;
}

/* Fullscreen transition */
.fullscreen-active {
    transition: all 0.3s ease-in-out;
}

/* Smooth transitions for theme switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease,
        border-color 0.3s ease;
}

/* Disable transitions during theme switch to prevent flashing */
.theme-transitioning * {
    transition: none !important;
}

/* Confetti particles for celebrations */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--accent-primary);
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall 3s linear forwards;
}

.confetti:nth-child(even) {
    background-color: var(--accent-secondary);
    width: 8px;
    height: 8px;
    animation-duration: 2.5s;
}

.confetti:nth-child(3n) {
    background-color: var(--text-primary);
    width: 6px;
    height: 6px;
    animation-duration: 3.5s;
}

/* Ripple effect for clicks */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}
