/**
 * Course Design System - Animations
 * ==================================
 * Micro-interactions and animations for enhanced UX
 */

/* ═══════════════════════════════════════════════════
   FADE ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* ═══════════════════════════════════════════════════
   SCALE ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes bounce {

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════
   ICON ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

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

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes heartbeat {

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

    25% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.1);
    }
}

/* ═══════════════════════════════════════════════════
   LOADING ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes shimmerLoad {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--gray-200) 0%,
            var(--gray-100) 50%,
            var(--gray-200) 100%);
    background-size: 200% 100%;
    animation: shimmerLoad 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════ */
.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.5s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.5s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.5s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease forwards;
}

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

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

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

.animate-wiggle {
    animation: wiggle 0.5s ease;
}

.animate-heartbeat {
    animation: heartbeat 1.5s ease infinite;
}

/* ═══════════════════════════════════════════════════
   DELAYED ANIMATIONS
   ═══════════════════════════════════════════════════ */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-1000 {
    animation-delay: 1000ms;
}

/* ═══════════════════════════════════════════════════
   HOVER EFFECTS
   ═══════════════════════════════════════════════════ */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

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

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

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

/* ═══════════════════════════════════════════════════
   REDUCED MOTION SUPPORT
   ═══════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .slide.active {
        animation: none;
        opacity: 1;
        transform: none;
    }
}