/* ===================================
   Animations
   =================================== */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Slide In from Bottom */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Slide In from Top */
@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal Slide In */
@keyframes modalSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Pulse */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Shake */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Bounce */
@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

/* Glow */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(107, 70, 193, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(107, 70, 193, 0.6);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Confetti (Level Up Effect) */
@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===================================
   Animation Classes
   =================================== */

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideInUp 0.5s ease-out;
}

.animate-slide-down {
    animation: slideInDown 0.5s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-shake {
    animation: shake 0.5s;
}

.animate-bounce {
    animation: bounce 1s;
}

.animate-glow {
    animation: glow 2s infinite;
}

.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* ===================================
   Transition Utilities
   =================================== */

.transition-all {
    transition: all var(--transition-base);
}

.transition-fast {
    transition: all var(--transition-fast);
}

.transition-slow {
    transition: all var(--transition-slow);
}

/* ===================================
   Hover Effects
   =================================== */

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
}

.hover-scale {
    transition: transform var(--transition-base);
}

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

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(107, 70, 193, 0.5);
}

/* ===================================
   Loading Spinner
   =================================== */

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rotate 1s linear infinite;
}

/* ===================================
   Success/Error Feedback Animations
   =================================== */

.feedback-correct {
    animation: bounce 0.6s ease-out, glow 0.6s ease-out;
}

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

/* ===================================
   Stagger Animations (for lists)
   =================================== */

.stagger-item {
    opacity: 0;
    animation: slideInUp 0.5s ease-out forwards;
}

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

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

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

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

.stagger-item:nth-child(5) {
    animation-delay: 0.5s;
}

.stagger-item:nth-child(6) {
    animation-delay: 0.6s;
}

.stagger-item:nth-child(7) {
    animation-delay: 0.7s;
}

.stagger-item:nth-child(8) {
    animation-delay: 0.8s;
}

.stagger-item:nth-child(9) {
    animation-delay: 0.9s;
}

.stagger-item:nth-child(10) {
    animation-delay: 1.0s;
}

/* ===================================
   Page Transition
   =================================== */

.page-transition-enter {
    animation: fadeIn 0.3s ease-in-out;
}

.page-transition-exit {
    animation: fadeIn 0.3s ease-in-out reverse;
}