/* === ANIMATIONS ===
   모든 애니메이션과 트랜지션을 정의합니다. */

/* === 기본 애니메이션 === */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

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

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

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

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

@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 shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-10px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(10px);
    }
}

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

/* === 콤보 팝 애니메이션 === */
@keyframes combo-pop-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
    100% {
        transform: scale(1);
    }
}

/* === 게임 시작 버튼 애니메이션 === */
@keyframes pulse-start-btn {
    0% {
        transform: scale(1);
        box-shadow: 5px 5px 0px var(--secondary);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 8px 8px 15px var(--secondary);
    }
    100% {
        transform: scale(1);
        box-shadow: 5px 5px 0px var(--secondary);
    }
}

/* === 글로우 효과 === */
@keyframes glow {
    0% {
        box-shadow: 0 0 5px var(--accent);
    }
    50% {
        box-shadow: 0 0 20px var(--accent);
    }
    100% {
        box-shadow: 0 0 5px var(--accent);
    }
}

/* === 정답 펄스 효과 === */
@keyframes correct-pulse {
    0% {
        background-color: var(--correct);
        transform: scale(1);
    }
    50% {
        background-color: var(--correct);
        transform: scale(1.02);
        box-shadow: 0 0 15px var(--correct);
    }
    100% {
        background-color: var(--correct);
        transform: scale(1);
    }
}

/* === 오답 흔들기 효과 === */
@keyframes incorrect-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* === 페이드 인/아웃 클래스 === */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

.slide-in-up {
    animation: slideInUp 0.4s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.4s ease-out;
}

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

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

.pulse {
    animation: pulse 2s infinite;
}

.glow {
    animation: glow 2s infinite;
}

.correct-pulse {
    animation: correct-pulse 0.6s ease-out;
}

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

/* === 트랜지션 클래스 === */
.transition-all {
    transition: all 0.3s ease;
}

.transition-fast {
    transition: all 0.15s ease;
}

.transition-slow {
    transition: all 0.5s ease;
}

/* === 호버 효과 === */
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hover-grow:hover {
    transform: scale(1.05);
}

.hover-shrink:hover {
    transform: scale(0.95);
}

/* === 로딩 애니메이션 === */
.loading-dots {
    display: inline-block;
}

.loading-dots:after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%,
    20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%,
    100% {
        content: '...';
    }
}
