/* Animations */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

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

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

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

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

/* Page transitions */
.page-enter {
    animation: fadeIn 0.3s ease;
}

.page-exit {
    animation: fadeOut 0.3s ease;
}

/* Menu item animations */
.menu-item {
    animation: fadeIn 0.5s ease backwards;
}

.menu-item:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-item:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-item:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* Pinyin card animations */
.pinyin-card {
    animation: fadeIn 0.4s ease backwards;
}

/* Stagger animation for cards */
.practice-grid .pinyin-card:nth-child(1) { animation-delay: 0.05s; }
.practice-grid .pinyin-card:nth-child(2) { animation-delay: 0.1s; }
.practice-grid .pinyin-card:nth-child(3) { animation-delay: 0.15s; }
.practice-grid .pinyin-card:nth-child(4) { animation-delay: 0.2s; }
.practice-grid .pinyin-card:nth-child(5) { animation-delay: 0.25s; }
.practice-grid .pinyin-card:nth-child(n+6) { animation-delay: 0.3s; }
