/* 
 * RUG AI - Animation Controls
 * Controls animation speed and effects throughout the interface
 */

:root {
    /* Animation control variables */
    --animation-duration-scale: 1;
    --animation-enabled: 1;
}

/* Base animations with duration scale support */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes progressPulse {
    0% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.7;
    }
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 145, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 145, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 145, 0, 0.5);
    }
}

@keyframes iconPulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.15);
    }
    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

@keyframes lineProgress {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes textFlicker {
    0% {
        opacity: 0.9;
    }
    3% {
        opacity: 0.5;
    }
    6% {
        opacity: 0.9;
    }
    9% {
        opacity: 0.7;
    }
    12% {
        opacity: 0.9;
    }
    80% {
        opacity: 0.9;
    }
    83% {
        opacity: 0.6;
    }
    86% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.9;
    }
}

@keyframes valueChange {
    0% { color: rgba(255, 255, 255, 0.9); }
    50% { color: rgba(66, 186, 91, 1); }
    100% { color: rgba(66, 186, 91, 0.9); }
}

/* Animation duration controlled elements */
.pulse-dot, 
.status-pulse, 
.flow-progress.active::before, 
.value-changed {
    animation-duration: calc(2s * var(--animation-duration-scale));
}

.scanline {
    animation-duration: calc(10s * var(--animation-duration-scale));
}

.glitch-text::before, 
.glitch-text::after {
    animation-duration: calc(3s * var(--animation-duration-scale));
}

.flow-connector.active::after {
    animation-duration: calc(3s * var(--animation-duration-scale));
}

.timeline-item.active .timeline-icon::after {
    animation-duration: calc(2s * var(--animation-duration-scale));
}

/* Reduce motion support */
.reduce-motion * {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
}

.reduce-motion .scanline {
    opacity: 0.1 !important;
}

.reduce-motion .pulse-dot, 
.reduce-motion .status-pulse,
.reduce-motion .flow-progress.active::before,
.reduce-motion .flow-connector.active::after,
.reduce-motion .timeline-item.active .timeline-icon::after {
    animation: none !important;
}

/* Terminal theme specific animations */
body.theme-terminal .scanline {
    opacity: 0.5;
    background: rgba(0, 255, 0, 0.1);
}

body.theme-terminal {
    animation: crt-flicker 8s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 1.0; }
    1% { opacity: 0.8; }
    2% { opacity: 1.0; }
    70% { opacity: 1.0; }
    71% { opacity: 0.9; }
    72% { opacity: 1.0; }
}
