/* =========================================
   SECTION 03: DEFINITION - WORLD CLASS ENGINE
   High-end tech visualization: Glass, Depth, Flow
   ========================================= */

/* Main container with perspective */
.engine-flow-visual {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 0 40px;
    perspective: 1000px;
    /* Enable 3D depth */
}

/* Common Step Styles */
.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;
}

.step-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.6s ease forwards 0.5s;
}

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

/* =========================================
   1. INPUT: The Request Source
   Style: Clean, White, Floating Stack
   ========================================= */
.flow-input .step-block {
    width: 110px;
    height: 120px;
    position: relative;
    /* Stack effect created with pseudo-elements */
}

/* Bottom card */
.flow-input .step-block::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: -10px;
    bottom: -10px;
    background: #FFFFFF;
    border: 1px solid #EAEAEA;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    z-index: 1;
    transform: translateZ(-10px);
}

/* Top card (Main) */
.flow-input .step-block::after {
    content: '';
    /* Abstract lines UI */
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 6px rgba(0, 0, 0, 0.02);
    z-index: 2;
    background-image:
        linear-gradient(#F5F5F7 6px, transparent 6px),
        linear-gradient(#F5F5F7 6px, transparent 6px),
        linear-gradient(#F5F5F7 6px, transparent 6px);
    background-size: 60% 6px, 80% 6px, 50% 6px;
    background-position: 15px 20px, 15px 35px, 15px 50px;
    background-repeat: no-repeat;
    animation: floatInput 6s ease-in-out infinite;
}

@keyframes floatInput {

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

    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

/* Hide original HTML content inside input to use pure CSS styling */
.flow-input .step-block>* {
    opacity: 0;
}


/* =========================================
   CONNECTOR: Data Stream
   Style: Animated Gradient Flow
   ========================================= */
.flow-connector {
    width: 60px;
    height: 3px;
    background: #EAEAEA;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.flow-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 50%;
    background: linear-gradient(90deg, transparent, #FF6B35, transparent);
    transform: translateX(-100%);
    animation: flowData 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: blur(2px);
}

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

    100% {
        transform: translateX(250%);
    }
}


/* =========================================
   2. ENGINE: The Core (Black Box)
   Style: Dark Glossy Monolith with Energy
   ========================================= */
.flow-engine .step-block {
    width: 160px;
    height: 160px;
    background: #0F0F11;
    /* Deepest black */
    border-radius: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    /* Glass edge */
    z-index: 10;
    overflow: hidden;
    animation: floatEngine 8s ease-in-out infinite reverse;
}

/* Internal Glow Mesh */
.flow-engine .step-block::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at 50% 50%, rgba(255, 107, 53, 0.15), transparent 60%);
    animation: spinGlow 10s linear infinite;
    z-index: 0;
}

@keyframes spinGlow {
    from {
        transform: rotate(0deg);
    }

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

@keyframes floatEngine {

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

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

.engine-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.engine-label-text {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    margin-bottom: 8px;
}

/* Dots Animation */
.engine-dots-viz {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.dot {
    width: 6px;
    height: 6px;
    background: #FF6B35;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.8);
    animation: dotBlink 1.4s ease-in-out infinite alternate;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBlink {
    from {
        opacity: 0.3;
        transform: scale(0.8);
    }

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

.engine-meta {
    margin-top: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


/* =========================================
   3. OUTPUT: The Artifact
   Style: Crystallized, Pristine, Completed
   ========================================= */
.flow-output .step-block {
    width: 110px;
    height: 120px;
    background: #FFFFFF;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 10px 40px rgba(16, 185, 129, 0.1),
        0 4px 10px rgba(0, 0, 0, 0.02);
    animation: floatOutput 7s ease-in-out infinite 0.5s;
    overflow: hidden;
}

@keyframes floatOutput {

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

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

/* Green top accent */
.flow-output .step-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #10B981;
}

/* Checkmark Icon styled with CSS */
.flow-output .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flow-output .step-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 3;
}