/* Animations for SpinAWheel App */

/* Keyframes */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin-reverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes confetti-1 {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes confetti-2 {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(-360deg) scale(0.8);
        opacity: 0;
    }
}

@keyframes confetti-3 {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(180deg) scale(0.6);
        opacity: 0;
    }
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.8), 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

@keyframes ready-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px -5px rgba(99, 102, 241, 0.3);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateX(-50%) translateY(0px);
    }
    50% {
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes wiggle {
    0%, 7% {
        transform: rotateZ(0);
    }
    15% {
        transform: rotateZ(-15deg);
    }
    20% {
        transform: rotateZ(10deg);
    }
    25% {
        transform: rotateZ(-10deg);
    }
    30% {
        transform: rotateZ(6deg);
    }
    35% {
        transform: rotateZ(-4deg);
    }
    40%, 100% {
        transform: rotateZ(0);
    }
}

/* Wheel Animations */
.wheel-spinning {
    animation: spin 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, glow 2s ease-in-out infinite;
}

.wheel-spinning-fast {
    animation: spin 0.5s linear infinite, glow 2s ease-in-out infinite;
}

.wheel-spinning-slow {
    animation: spin 2s ease-out forwards, glow 2s ease-in-out infinite;
}

.ready-for-spin {
    animation: ready-pulse 2s ease-in-out;
}

/* Button Animations */
.btn-spin:hover {
    animation: pulse 0.6s ease-in-out;
}

.btn-spin:active {
    animation: wiggle 0.5s ease-in-out;
}

/* Winner Animations */
.winner-section {
    animation: fadeInUp 0.8s ease-out;
}

.winner-card {
    animation: fadeIn 1s ease-out;
}

.winner-name {
    animation: bounce 1s ease-out 0.5s both;
}

.winner-title {
    animation: wiggle 2s ease-in-out infinite;
}

/* Confetti Animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1000;
}

.confetti:nth-child(1) {
    left: 10%;
    animation: confetti-1 3s ease-out forwards;
}

.confetti:nth-child(2) {
    left: 20%;
    animation: confetti-2 3.5s ease-out 0.2s forwards;
}

.confetti:nth-child(3) {
    left: 30%;
    animation: confetti-3 3.2s ease-out 0.4s forwards;
}

.confetti:nth-child(4) {
    left: 40%;
    animation: confetti-1 3.8s ease-out 0.6s forwards;
}

.confetti:nth-child(5) {
    left: 50%;
    animation: confetti-2 3.3s ease-out 0.8s forwards;
}

/* Sparkle Animation */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

.sparkle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 30%;
    right: 30%;
    animation-delay: 0.3s;
}

.sparkle:nth-child(3) {
    bottom: 40%;
    left: 40%;
    animation-delay: 0.6s;
}

.sparkle:nth-child(4) {
    bottom: 20%;
    right: 20%;
    animation-delay: 0.9s;
}

/* Glow Animation */
/* Always-on subtle glow for the wheel in all modes */
#wheel {
    animation: glow 2.2s ease-in-out infinite !important;
}

/* Float Animation */
/* Always animate pointer; remove hover dependency */
.wheel-pointer {
    animation: float 3s ease-in-out infinite !important;
}

/* Page Load Animations */
.hero {
    animation: fadeInUp 1s ease-out;
}

.wheel-section {
    animation: fadeIn 1.2s ease-out 0.3s both;
}

.input-section {
    animation: slideInRight 1s ease-out 0.6s both;
}

/* Hover Animations */
.nav-link:hover {
    animation: pulse 0.3s ease-in-out;
}

.logo:hover {
    animation: wiggle 0.5s ease-in-out;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Success Animation */
.success-pulse {
    animation: pulse 0.6s ease-in-out;
}

/* Error Shake */
.error-shake {
    animation: shake 0.5s ease-in-out;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Performance Animations */
.wheel-spinning,
.wheel-spinning-fast,
.wheel-spinning-slow {
    will-change: transform;
}

.confetti {
    will-change: transform, opacity;
}

/* Print Styles */
@media print {
    .wheel-section,
    .controls,
    .winner-section {
        display: none;
    }
} 