/* ============================================
   CLIP TUTORIAL - ANIMATIONS
   Keyframe animations for multimodal interactions
   ============================================ */

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Slide In From Left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

/* Slide In From Right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* Pulse Animation */
@keyframes pulse {

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

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

/* Glow Animation */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(0, 212, 255, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
    }
}

/* Match Animation (for positive pairs) */
@keyframes match {

    0%,
    100% {
        border-color: var(--color-similarity);
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    }

    50% {
        border-color: var(--color-similarity);
        box-shadow: 0 0 25px rgba(16, 185, 129, 0.6);
    }
}

/* Contrast Animation (for negative pairs) */
@keyframes contrast {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.6;
    }
}

/* Embedding Flow */
@keyframes embedFlow {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translateY(-40px) scale(1);
        opacity: 0;
    }
}

/* Heatmap Highlight */
@keyframes heatmapHighlight {

    0%,
    100% {
        background: rgba(16, 185, 129, 0.3);
    }

    50% {
        background: rgba(16, 185, 129, 0.6);
    }
}

/* Connection Line Animation */
@keyframes connect {
    from {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Scale Up */
@keyframes scaleUp {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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

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

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

/* Bounce */
@keyframes bounce {

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

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

/* Shimmer (for loading) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* Progress Animation */
@keyframes progress {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Apply Animations to Elements */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

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

.match {
    animation: match 1.5s ease-in-out infinite;
}

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

.scale-up {
    animation: scaleUp 0.4s ease-out;
}

.rotate {
    animation: rotate 2s linear infinite;
}

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

.shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.05) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}