/* =================================
   Animations & Transitions
   ================================= */

/* Fade In Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

.animate-fade-in-delay {
    animation: fadeIn 0.8s ease-out 0.3s backwards;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 0.8s ease-out 0.6s backwards;
}

.animate-fade-in-delay-3 {
    animation: fadeIn 0.8s ease-out 0.9s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide In Animations */
.animate-slide-in {
    animation: slideIn 1s ease-out 0.5s backwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale Animation */
.animate-scale {
    animation: scaleUp 0.5s ease-out;
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    animation: pageLoad 0.5s ease-out;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Loading Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Pulse Animation */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Shimmer Effect */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* Floating Animation */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Reveal on Scroll */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Typing Animation */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Gradient Animation */
.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* =================================
   Animated Equipment SVG Animations
   ================================= */

/* Equipment SVG Container */
.animated-equipment {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equipment-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 40px rgba(0, 0, 0, 0.1));
}

/* Copper Top Pulse */
.copper-top {
    animation: copperPulse 2s ease-in-out infinite;
}

@keyframes copperPulse {
    0%, 100% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.3);
    }
}

/* Cooling Coils Glow */
.cooling-coils path {
    animation: coilGlow 3s ease-in-out infinite;
}

.coil-1 { animation-delay: 0s; }
.coil-2 { animation-delay: 0.2s; }
.coil-3 { animation-delay: 0.4s; }
.coil-4 { animation-delay: 0.6s; }

@keyframes coilGlow {
    0%, 100% {
        opacity: 0.3;
        stroke-width: 2;
    }
    50% {
        opacity: 0.9;
        stroke-width: 4;
    }
}

/* Vapor Bubbles Rising */
.bubble {
    animation: bubbleRise 4s ease-in-out infinite;
}

.bubble-1 { animation-delay: 0s; }
.bubble-2 { animation-delay: 0.8s; }
.bubble-3 { animation-delay: 1.6s; }
.bubble-4 { animation-delay: 2.4s; }
.bubble-5 { animation-delay: 3.2s; }

@keyframes bubbleRise {
    0% {
        transform: translateY(0);
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Liquid Drops Flow */
.liquid-drop {
    animation: liquidFlow 2s ease-in-out infinite;
}

.liquid-1 { animation-delay: 0s; }
.liquid-2 { animation-delay: 0.3s; }
.liquid-3 { animation-delay: 0.6s; }

@keyframes liquidFlow {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateX(60px);
        opacity: 0;
    }
}

/* Heat Glow Pulse */
.heat-glow {
    animation: heatPulse 1.5s ease-in-out infinite;
}

@keyframes heatPulse {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.5;
    }
}

/* Flame Flicker */
.flame {
    animation: flameFlicker 0.8s ease-in-out infinite;
    transform-origin: bottom center;
}

.flame-1 { animation-delay: 0s; }
.flame-2 { animation-delay: 0.2s; }
.flame-3 { animation-delay: 0.1s; }
.flame-4 { animation-delay: 0.3s; }

@keyframes flameFlicker {
    0%, 100% {
        transform: scaleY(1) scaleX(1);
        opacity: 0.8;
    }
    25% {
        transform: scaleY(1.2) scaleX(0.95);
        opacity: 1;
    }
    50% {
        transform: scaleY(0.9) scaleX(1.05);
        opacity: 0.7;
    }
    75% {
        transform: scaleY(1.1) scaleX(0.97);
        opacity: 0.9;
    }
}

/* Still Body Subtle Float */
.still-body {
    animation: subtleFloat 6s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes subtleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* =================================
   Animated Factory SVG Animations
   ================================= */

/* Factory SVG Container */
.animated-factory {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.factory-svg {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Clouds Movement */
.cloud {
    animation: cloudDrift 20s ease-in-out infinite;
}

.cloud-1 {
    animation-delay: 0s;
}

.cloud-2 {
    animation-delay: 5s;
}

@keyframes cloudDrift {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(30px);
    }
}

/* Smoke Rising Animation */
.smoke {
    animation: smokeRise 6s ease-out infinite;
}

.smoke-1-1, .smoke-2-1, .smoke-3-1 {
    animation-delay: 0s;
}

.smoke-1-2, .smoke-2-2, .smoke-3-2 {
    animation-delay: 0.5s;
}

.smoke-1-3, .smoke-2-3, .smoke-3-3 {
    animation-delay: 1s;
}

@keyframes smokeRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-40px) scale(1.3);
        opacity: 0;
    }
}

/* Delivery Truck Movement */
.delivery-truck {
    animation: truckMove 15s linear infinite;
}

@keyframes truckMove {
    0% {
        transform: translateX(0);
    }
    30% {
        transform: translateX(-400px);
    }
    35% {
        transform: translateX(-400px);
    }
    65% {
        transform: translateX(-400px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Window Lights Blink */
.factory-buildings rect[fill="#6c83e9"] {
    animation: windowBlink 4s ease-in-out infinite;
}

.factory-buildings rect:nth-child(2) {
    animation-delay: 0s;
}

.factory-buildings rect:nth-child(3) {
    animation-delay: 1s;
}

.factory-buildings rect:nth-child(4) {
    animation-delay: 2s;
}

.factory-buildings rect:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes windowBlink {
    0%, 90%, 100% {
        opacity: 0.7;
    }
    95% {
        opacity: 0.3;
    }
}
