/* Animations for Te Reo Wordle */

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(-90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

@keyframes bounce {
    0%, 20% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-30px);
    }
    50% {
        transform: translateY(5px);
    }
    60% {
        transform: translateY(-15px);
    }
    80% {
        transform: translateY(2px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Animation Classes */
.tile.flip {
    animation: flip 0.6s ease-in-out;
}

.tile.flip-0 {
    animation-delay: 0s;
}

.tile.flip-1 {
    animation-delay: 0.1s;
}

.tile.flip-2 {
    animation-delay: 0.2s;
}

.tile.flip-3 {
    animation-delay: 0.3s;
}

.tile.flip-4 {
    animation-delay: 0.4s;
}

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

.tile.bounce {
    animation: bounce 1s ease-in-out;
}

.tile.bounce-0 {
    animation-delay: 0s;
}

.tile.bounce-1 {
    animation-delay: 0.1s;
}

.tile.bounce-2 {
    animation-delay: 0.2s;
}

.tile.bounce-3 {
    animation-delay: 0.3s;
}

.tile.bounce-4 {
    animation-delay: 0.4s;
}

/* Smooth transitions */
.tile {
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.key {
    transition: background-color 0.3s ease, transform 0.1s ease;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
