/* Simple Neural Flow Visualization */

/* Split Container */
.section-split-container {
    width: 100%;
    height: 100vh;
    display: flex;
    position: sticky;
    top: 0;
}

.section-left-half {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
    z-index: 2;
}

.section-right-half {
    width: 50%;
    height: 100%;
    background: #000000;
    border-left: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

/* Content Styling */
.section-content {
    max-width: 500px;
    width: 100%;
    text-align: left;
}

/* Step Content Transitions */
.step-content {
    position: absolute;
    top: 50%;
    left: 70%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    pointer-events: none;
    will-change: opacity;
}

/* First step (Ingest) is visible by default - higher specificity */
.step-content[data-step="ingest"]:not(.transitioning) {
    opacity: 1;
    pointer-events: auto;
}

/* Active state shows content */
.step-content.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hide non-active content during transitions */
.step-content.transitioning:not(.active) {
    opacity: 0;
    pointer-events: none;
}

.section-label {
    color: #8a8a8a;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-align: left;
}

.section-heading {
    color: #ffffff;
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 1.75rem;
    text-align: left;
}

.section-description {
    color: #ffffff;
    font-size: 1.5rem;
    line-height: 1.7;
    opacity: 0.9;
    text-align: left;
}

/* Flow Container */
.neural-flow-container {
    width: 800px;
    height: 85%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 30px 50px;
    overflow: visible;
}

/* Node Rows */
.input-row,
.output-row {
    display: flex;
    justify-content: center;
    width: 100%;
    z-index: 2;
    position: relative;
    gap: 60px;
}

/* Flow Nodes */
.flow-node {
    background: linear-gradient(135deg, rgba(60, 19, 97, 0.15) 0%, rgba(10, 10, 10, 0.8) 100%);
    border: 2px solid rgba(139, 92, 246, 0.6);
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-width: 160px;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    transform: translateZ(0); /* GPU acceleration */
    will-change: border-color, box-shadow;
}

.flow-node:hover {
    border-color: rgba(139, 92, 246, 0.9);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(60, 19, 97, 0.25) 0%, rgba(10, 10, 10, 0.9) 100%);
}

/* Top nodes with purple tint */
.input-row .flow-node {
    border-color: rgba(60, 19, 97, 0.7);
    box-shadow: 0 2px 10px rgba(60, 19, 97, 0.3);
}

/* Bottom nodes with purple tint (inverted gradient) */
.output-row .flow-node {
    border-color: rgba(60, 19, 97, 0.7);
    box-shadow: 0 2px 10px rgba(60, 19, 97, 0.3);
}

/* Center Core */
.neural-core-center {
    width: 140px;
    height: 140px;
    background: #000000;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: calc(50% - 5px);
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    border: 2px solid;
    border-image: linear-gradient(135deg, #3c1361 0%, #8B5CF6 50%, #d97706 100%) 1;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.3);
    z-index: 4;
    pointer-events: none;
    will-change: filter, box-shadow;
}

.neural-core-center img {
    pointer-events: auto;
}

.core-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.9;
}

/* SVG Lines - Fiber Optic Cable Style */
.flow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* GPU acceleration */
    will-change: transform;
}

.flow-line {
    /* Consistent width - no changes allowed */
    stroke-width: 0.3 !important;
    fill: none;
    stroke-linecap: round;
    /* Solid glowing cable effect */
    stroke: rgba(139, 92, 246, 0.6);
    /* Simplified shadow for performance */
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.6));
    opacity: 1;
    /* Smooth transitions - removed stroke-width */
    transition: stroke 0.4s ease, filter 0.4s ease;
}

.flow-particle {
    opacity: 1;
    /* Single shadow for better performance */
    filter: drop-shadow(0 0 4px currentColor);
    r: 0.6;
}

/* Animation States */
/* State 1: Ingest - Input lines bright, output lines dim */
.neural-flow-container.state-ingest .flow-line[id^="path1"],
.neural-flow-container.state-ingest .flow-line[id^="path2"],
.neural-flow-container.state-ingest .flow-line[id^="path3"],
.neural-flow-container.state-ingest .flow-line[id^="path4"] {
    stroke: rgba(116, 238, 221, 0.7);
    filter: drop-shadow(0 0 5px rgba(116, 238, 221, 0.7));
}

.neural-flow-container.state-ingest .flow-line[id^="path5"],
.neural-flow-container.state-ingest .flow-line[id^="path6"],
.neural-flow-container.state-ingest .flow-line[id^="path7"],
.neural-flow-container.state-ingest .flow-line[id^="path8"] {
    stroke: rgba(139, 92, 246, 0.25);
    filter: none;
}

.neural-flow-container.state-ingest .flow-particle:nth-of-type(5),
.neural-flow-container.state-ingest .flow-particle:nth-of-type(6),
.neural-flow-container.state-ingest .flow-particle:nth-of-type(7),
.neural-flow-container.state-ingest .flow-particle:nth-of-type(8) {
    opacity: 0.3;
}

.neural-flow-container.state-ingest .neural-core-center {
    filter: brightness(0.7);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
}

/* Subtle glow effect for top input nodes during Ingest */
.neural-flow-container.state-ingest .input-row .flow-node {
    box-shadow: 0 0 12px rgba(116, 238, 221, 0.4);
    border-color: rgba(116, 238, 221, 0.6);
    transform: translateZ(0); /* GPU acceleration */
}

/* State 2: Analyze - Both lines visible, balanced */
.neural-flow-container.state-analyze .flow-line[id^="path1"],
.neural-flow-container.state-analyze .flow-line[id^="path2"],
.neural-flow-container.state-analyze .flow-line[id^="path3"],
.neural-flow-container.state-analyze .flow-line[id^="path4"] {
    stroke: rgba(139, 92, 246, 0.5);
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.5));
}

.neural-flow-container.state-analyze .flow-line[id^="path5"],
.neural-flow-container.state-analyze .flow-line[id^="path6"],
.neural-flow-container.state-analyze .flow-line[id^="path7"],
.neural-flow-container.state-analyze .flow-line[id^="path8"] {
    stroke: rgba(139, 92, 246, 0.35);
    filter: drop-shadow(0 0 3px rgba(139, 92, 246, 0.3));
}

.neural-flow-container.state-analyze .flow-particle:nth-of-type(5),
.neural-flow-container.state-analyze .flow-particle:nth-of-type(6),
.neural-flow-container.state-analyze .flow-particle:nth-of-type(7),
.neural-flow-container.state-analyze .flow-particle:nth-of-type(8) {
    opacity: 0.5;
}

.neural-flow-container.state-analyze .neural-core-center {
    animation: coreGlowEnhanced 2s ease-in-out infinite;
    border-color: rgba(139, 92, 246, 0.9);
}

/* Keep input nodes slightly glowing during Analyze */
.neural-flow-container.state-analyze .input-row .flow-node {
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateZ(0);
}

@keyframes coreGlowEnhanced {
    0%, 100% { 
        filter: brightness(1.1);
        box-shadow: 0 0 50px rgba(139, 92, 246, 0.4);
        transform: translate(-50%, -50%);
    }
    50% { 
        filter: brightness(1.15);
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
        transform: translate(-50%, -50%);
    }
}

/* State 3: Activate - Output lines bright, input lines dim */
.neural-flow-container.state-activate .flow-line[id^="path1"],
.neural-flow-container.state-activate .flow-line[id^="path2"],
.neural-flow-container.state-activate .flow-line[id^="path3"],
.neural-flow-container.state-activate .flow-line[id^="path4"] {
    stroke: rgba(139, 92, 246, 0.25);
    filter: none;
}

.neural-flow-container.state-activate .flow-line[id^="path5"],
.neural-flow-container.state-activate .flow-line[id^="path6"],
.neural-flow-container.state-activate .flow-line[id^="path7"],
.neural-flow-container.state-activate .flow-line[id^="path8"] {
    stroke: rgba(217, 119, 6, 0.7);
    filter: drop-shadow(0 0 5px rgba(217, 119, 6, 0.7));
}

.neural-flow-container.state-activate .flow-particle:nth-of-type(1),
.neural-flow-container.state-activate .flow-particle:nth-of-type(2),
.neural-flow-container.state-activate .flow-particle:nth-of-type(3),
.neural-flow-container.state-activate .flow-particle:nth-of-type(4) {
    opacity: 0.4;
}

.neural-flow-container.state-activate .neural-core-center {
    /* Keep the same core glow from Analyze state */
    animation: coreGlowEnhanced 2s ease-in-out infinite;
    border-color: rgba(139, 92, 246, 0.9);
}

/* Subtle glow effect for bottom output nodes during Activate */
.neural-flow-container.state-activate .output-row .flow-node {
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.4);
    border-color: rgba(217, 119, 6, 0.6);
    transform: translateZ(0);
}

/* Keep input nodes very subtly glowing */
.neural-flow-container.state-activate .input-row .flow-node {
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateZ(0);
}

/* State 4: Optimize - All lines bright and unified */
.neural-flow-container.state-optimize .flow-line {
    stroke: rgba(139, 92, 246, 0.6);
    filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.6));
}

.neural-flow-container.state-optimize .neural-core-center {
    /* Keep enhanced core glow from Analyze, just slightly stronger */
    animation: coreGlowOptimize 2s ease-in-out infinite;
    border-color: rgba(139, 92, 246, 0.9);
}

/* All nodes with subtle unified glow */
.neural-flow-container.state-optimize .flow-node {
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateZ(0);
}

/* All particles fully visible */
.neural-flow-container.state-optimize .flow-particle {
    filter: drop-shadow(0 0 6px currentColor);
    opacity: 1;
}

/* Subtle connecting background glow */
.neural-flow-container.state-optimize::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle at center, 
        rgba(139, 92, 246, 0.08) 0%, 
        rgba(116, 238, 221, 0.03) 30%,
        transparent 60%);
    pointer-events: none;
    animation: systemPulse 4s ease-in-out infinite;
}

@keyframes coreGlowOptimize {
    0%, 100% { 
        filter: brightness(1.15);
        box-shadow: 0 0 60px rgba(139, 92, 246, 0.5);
        transform: translate(-50%, -50%);
    }
    50% { 
        filter: brightness(1.2);
        box-shadow: 0 0 70px rgba(139, 92, 246, 0.6);
        transform: translate(-50%, -50%);
    }
}

@keyframes systemPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .flow-node:hover {
        /* Disable hover effects on touch devices */
        border-color: inherit;
        box-shadow: inherit;
        background: inherit;
    }
}

/* Tablet Responsive (iPad Pro, iPad Air) */
@media (max-width: 1024px) {
    .section-split-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .section-left-half {
        width: 100%;
        height: 600px;
        min-height: 600px;
        padding: 40px;
    }
    
    .section-right-half {
        width: 100%;
        height: auto;
        min-height: 400px;
        border-left: none;
        border-top: 1px solid rgba(139, 92, 246, 0.1);
        padding: 50px 40px;
    }
    
    .section-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .section-heading {
        font-size: 3rem;
    }
    
    .section-description {
        font-size: 1.375rem;
    }
    
    .section-label {
        font-size: 1rem;
    }
    
    .neural-flow-container {
        width: 100%;
        max-width: 700px;
        height: 100%;
        margin: 0 auto;
        padding: 40px 30px;
    }
    
    .input-row,
    .output-row {
        gap: 40px;
    }
    
    .flow-node {
        min-width: 140px;
        font-size: 11px;
        padding: 10px 8px;
    }
    
    .neural-core-center {
        width: 120px;
        height: 120px;
    }
    
    .core-logo {
        width: 60px;
        height: 60px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .section-split-container {
        flex-direction: column;
    }
    
    .section-left-half {
        width: 100%;
        height: 500px;
        min-height: 500px;
        padding: 20px;
    }
    
    .section-right-half {
        width: 100%;
        height: auto;
        min-height: 350px;
        border-left: none;
        border-top: 1px solid rgba(139, 92, 246, 0.1);
        padding: 40px 20px;
    }
    
    .section-heading {
        font-size: 2.5rem;
    }
    
    .section-description {
        font-size: 1.25rem;
    }
    
    .section-label {
        font-size: 1rem;
    }
    
    .neural-flow-container {
        width: 100%;
        max-width: 500px;
        height: 100%;
        margin: 0 auto;
        padding: 30px 20px;
    }
    
    .input-row,
    .output-row {
        gap: 20px;
    }
    
    .flow-node {
        min-width: 100px;
        font-size: 9px;
        padding: 8px 6px;
    }
    
    .neural-core-center {
        width: 100px;
        height: 100px;
    }
    
    .core-logo {
        width: 50px;
        height: 50px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .section-left-half {
        height: 450px;
        min-height: 450px;
        padding: 15px;
    }
    
    .neural-flow-container {
        padding: 20px 10px;
    }
    
    .input-row,
    .output-row {
        gap: 15px;
    }
    
    .flow-node {
        min-width: 70px;
        font-size: 8px;
        padding: 6px 4px;
    }
    
    .neural-core-center {
        width: 80px;
        height: 80px;
    }
    
    .core-logo {
        width: 40px;
        height: 40px;
    }
}