/* AI Image Animations - 15 different animations for template processing effects */

@keyframes aiScan {
    0% { transform: scale(1) rotate(0deg); filter: blur(3px) hue-rotate(0deg); }
    25% { transform: scale(1.05) rotate(1deg); filter: blur(3px) hue-rotate(90deg); }
    50% { transform: scale(1.1) rotate(0deg); filter: blur(3px) hue-rotate(180deg); }
    75% { transform: scale(1.05) rotate(-1deg); filter: blur(3px) hue-rotate(270deg); }
    100% { transform: scale(1) rotate(0deg); filter: blur(3px) hue-rotate(360deg); }
}

@keyframes aiPulse {
    0%, 100% { transform: scale(1); filter: blur(3px) brightness(1); }
    50% { transform: scale(1.08); filter: blur(3px) brightness(1.3); }
}

@keyframes aiGlow {
    0%, 100% { filter: blur(3px) drop-shadow(0 0 8px rgba(0, 212, 255, 0.4)); }
    50% { filter: blur(3px) drop-shadow(0 0 25px rgba(0, 212, 255, 0.9)); }
}

@keyframes aiProcessing {
    0% { filter: blur(3px); }
    25% { filter: blur(3px) contrast(1.2); }
    50% { filter: blur(3px) contrast(1.4) saturate(1.3); }
    75% { filter: blur(3px) contrast(1.2); }
    100% { filter: blur(3px); }
}

@keyframes aiAnalyzing {
    0% { 
        filter: blur(3px); 
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.2);
    }
    50% { 
        filter: blur(3px) brightness(1.1); 
        box-shadow: 0 0 0 8px rgba(0, 212, 255, 0.1);
    }
    100% { 
        filter: blur(3px); 
        box-shadow: 0 0 0 16px rgba(0, 212, 255, 0);
    }
}

@keyframes aiFlicker {
    0%, 90%, 100% { opacity: 1; filter: blur(3px); }
    5%, 15%, 25%, 35% { opacity: 0.7; filter: blur(3px) brightness(1.2); }
}

@keyframes aiMatrix {
    0% { filter: blur(3px) hue-rotate(0deg) contrast(1); }
    33% { filter: blur(3px) hue-rotate(120deg) contrast(1.2); }
    66% { filter: blur(3px) hue-rotate(240deg) contrast(0.8); }
    100% { filter: blur(3px) hue-rotate(360deg) contrast(1); }
}

@keyframes aiWave {
    0% { transform: skew(0deg) scale(1); filter: blur(3px); }
    25% { transform: skew(2deg) scale(1.03); filter: blur(3px) saturate(1.2); }
    50% { transform: skew(0deg) scale(1.06); filter: blur(3px) saturate(1.4); }
    75% { transform: skew(-2deg) scale(1.03); filter: blur(3px) saturate(1.2); }
    100% { transform: skew(0deg) scale(1); filter: blur(3px); }
}

@keyframes aiSpin {
    0% { transform: rotate(0deg) scale(1); filter: blur(3px); }
    50% { transform: rotate(180deg) scale(1.05); filter: blur(3px) brightness(1.2); }
    100% { transform: rotate(360deg) scale(1); filter: blur(3px); }
}

@keyframes aiShimmer {
    0% { filter: blur(3px) brightness(1) contrast(1); }
    25% { filter: blur(3px) brightness(1.3) contrast(1.2); }
    50% { filter: blur(3px) brightness(1.6) contrast(1.4); }
    75% { filter: blur(3px) brightness(1.3) contrast(1.2); }
    100% { filter: blur(3px) brightness(1) contrast(1); }
}

@keyframes aiZoom {
    0%, 100% { transform: scale(1); filter: blur(3px); }
    20% { transform: scale(1.1); filter: blur(3px) saturate(1.3); }
    40% { transform: scale(0.95); filter: blur(3px) saturate(0.8); }
    60% { transform: scale(1.05); filter: blur(3px) saturate(1.1); }
    80% { transform: scale(0.98); filter: blur(3px) saturate(0.9); }
}

@keyframes aiPhase {
    0% { opacity: 1; transform: translateX(0) scale(1); filter: blur(3px); }
    25% { opacity: 0.7; transform: translateX(2px) scale(1.02); filter: blur(3px) hue-rotate(90deg); }
    50% { opacity: 0.4; transform: translateX(0) scale(1.04); filter: blur(3px) hue-rotate(180deg); }
    75% { opacity: 0.7; transform: translateX(-2px) scale(1.02); filter: blur(3px) hue-rotate(270deg); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(3px) hue-rotate(360deg); }
}

@keyframes aiVibrate {
    0%, 100% { transform: translate(0); filter: blur(3px); }
    10% { transform: translate(-1px, -1px); filter: blur(3px); }
    20% { transform: translate(1px, -1px); filter: blur(3px); }
    30% { transform: translate(-1px, 1px); filter: blur(3px); }
    40% { transform: translate(1px, 1px); filter: blur(3px); }
    50% { transform: translate(-1px, -1px); filter: blur(3px); }
    60% { transform: translate(1px, -1px); filter: blur(3px); }
    70% { transform: translate(-1px, 1px); filter: blur(3px); }
    80% { transform: translate(1px, 1px); filter: blur(3px); }
    90% { transform: translate(-1px, -1px); filter: blur(3px); }
}

@keyframes aiMorph {
    0%, 100% { border-radius: 12px; transform: scale(1); filter: blur(3px); }
    25% { border-radius: 50%; transform: scale(1.05); filter: blur(3px) hue-rotate(90deg); }
    50% { border-radius: 0; transform: scale(1.1); filter: blur(3px) hue-rotate(180deg); }
    75% { border-radius: 20px; transform: scale(1.05); filter: blur(3px) hue-rotate(270deg); }
}

@keyframes aiRipple {
    0% { transform: scale(1); filter: blur(3px); box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
    50% { transform: scale(1.03); filter: blur(3px); box-shadow: 0 0 0 10px rgba(0, 212, 255, 0.1); }
    100% { transform: scale(1); filter: blur(3px); box-shadow: 0 0 0 20px rgba(0, 212, 255, 0); }
}

@keyframes aiGlitch {
    0%, 90%, 100% { transform: translate(0); filter: blur(3px); }
    5% { transform: translate(2px, 0); filter: blur(3px) hue-rotate(180deg); }
    10% { transform: translate(-2px, 0); filter: blur(3px) hue-rotate(90deg); }
    15% { transform: translate(1px, 1px); filter: blur(3px) hue-rotate(270deg); }
    20% { transform: translate(-1px, -1px); filter: blur(3px) hue-rotate(45deg); }
}

@keyframes aiFloat {
    0%, 100% { transform: translateY(0) scale(1); filter: blur(3px); }
    25% { transform: translateY(-3px) scale(1.02); filter: blur(3px) brightness(1.1); }
    50% { transform: translateY(-6px) scale(1.04); filter: blur(3px) brightness(1.2); }
    75% { transform: translateY(-3px) scale(1.02); filter: blur(3px) brightness(1.1); }
}

/* Template images container */
.template-images-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 2px solid rgba(0, 212, 255, 0.2);
    overflow: visible;
    position: relative;
    min-height: 160px;
}

.template-image-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible;
}

.template-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
    border: 3px solid rgba(0, 212, 255, 0.4);
    transition: all 0.3s ease;
    filter: blur(3px);
    opacity: 1;
    display: block;
}

.template-image:hover {
    border-color: rgba(0, 212, 255, 0.8);
    transform: scale(1.1);
}

/* AI Working overlays and effects */
.ai-working-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 12px;
    overflow: hidden;
}

.ai-working-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: rgba(0, 212, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    z-index: 10;
}

.ai-working-overlay::after {
    content: attr(data-icon);
    font-family: 'FontAwesome';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: white;
    opacity: 0;
    z-index: 11;
}

.ai-working-overlay[data-icon=""]::after {
    content: '\f013'; /* Default gear icon */
}

/* AI progress bars */
.ai-progress-bar {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
}

.ai-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.8), transparent);
    animation: progressSweep 2s ease-in-out infinite;
}

@keyframes progressSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* AI scanning line */
.ai-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(0, 212, 255, 1), transparent);
    opacity: 0;
    animation: scanLine 3s ease-in-out infinite;
}

@keyframes scanLine {
    0% { left: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: calc(100% - 2px); opacity: 0; }
}

/* AI Working Overlay Animations */
@keyframes aiWorkingGear {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) rotate(0deg) scale(0); 
    }
    20% { 
        opacity: 1; 
        transform: translate(-50%, -50%) rotate(45deg) scale(1); 
    }
    80% { 
        opacity: 1; 
        transform: translate(-50%, -50%) rotate(315deg) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) rotate(360deg) scale(0); 
    }
}

@keyframes aiWorkingIcon {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0); 
    }
    20% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    80% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0); 
    }
}

@keyframes aiProgressShow {
    0% { opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes aiScanShow {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Animation classes */
.ai-anim-scan { animation: aiScan 3s ease-in-out infinite; }
.ai-anim-pulse { animation: aiPulse 2s ease-in-out infinite; }
.ai-anim-glow { animation: aiGlow 2.5s ease-in-out infinite; }
.ai-anim-flicker { animation: aiFlicker 1.5s ease-in-out infinite; }
.ai-anim-matrix { animation: aiMatrix 4s linear infinite; }
.ai-anim-wave { animation: aiWave 3s ease-in-out infinite; }
.ai-anim-spin { animation: aiSpin 4s linear infinite; }
.ai-anim-shimmer { animation: aiShimmer 2s ease-in-out infinite; }
.ai-anim-zoom { animation: aiZoom 2.5s ease-in-out infinite; }
.ai-anim-phase { animation: aiPhase 3.5s ease-in-out infinite; }
.ai-anim-vibrate { animation: aiVibrate 0.8s ease-in-out infinite; }
.ai-anim-morph { animation: aiMorph 5s ease-in-out infinite; }
.ai-anim-ripple { animation: aiRipple 2s ease-in-out infinite; }
.ai-anim-glitch { animation: aiGlitch 1.2s ease-in-out infinite; }
.ai-anim-float { animation: aiFloat 3s ease-in-out infinite; }
.ai-anim-processing { animation: aiProcessing 2.8s ease-in-out infinite; }
.ai-anim-analyzing { animation: aiAnalyzing 3.2s ease-in-out infinite; }

/* AI Working overlay animations */
.ai-working-overlay.active::before {
    animation: aiWorkingGear 4s ease-in-out infinite;
}

.ai-working-overlay.active::after {
    animation: aiWorkingIcon 4s ease-in-out infinite;
}

.ai-progress-bar.active {
    animation: aiProgressShow 5s ease-in-out infinite;
}

.ai-scan-line.active {
    animation: aiScanShow 4s ease-in-out infinite;
}

/* Different animation delays for randomness */
.ai-delay-1 { animation-delay: 0.1s; }
.ai-delay-2 { animation-delay: 0.3s; }
.ai-delay-3 { animation-delay: 0.5s; }
.ai-delay-4 { animation-delay: 0.7s; }
.ai-delay-5 { animation-delay: 0.9s; }
.ai-delay-6 { animation-delay: 1.1s; }
.ai-delay-7 { animation-delay: 1.3s; }
.ai-delay-8 { animation-delay: 1.5s; }
