/* ============================================
   System Lab Section - Futuristic Design
   Scroll-based animations, GPU optimized
   ============================================ */

/* Section Container */
.system-lab {
    padding: 100px 0;
    background: #fafafa;
    position: relative;
    overflow: hidden;
}

/* Lab Header */
.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

.lab-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #94a3b8;
    text-transform: uppercase;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: #fff;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.toggle-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: #3b82f6;
    color: #fff;
}

.toggle-btn:hover:not(.active) {
    color: #0f172a;
}

/* Main Grid */
.lab-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

/* Statement Section - Left */
.lab-statement {
    max-width: 500px;
}

.statement-headline {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.statement-line {
    display: block;
}

.statement-line.highlight {
    color: #3b82f6;
}

.statement-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.body-line {
    font-size: 1rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0;
}

/* Flow Section - Right */
.lab-flow {
    position: relative;
}

.flow-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
}

/* Flow Steps */
.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.flow-step:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.flow-step:hover .step-tooltip {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.step-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 10px;
    color: #3b82f6;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.step-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: #0f172a;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.step-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #0f172a;
}

/* Flow Connectors */
.flow-connector {
    width: 32px;
    height: 2px;
    background: linear-gradient(90deg, #e2e8f0, #3b82f6, #e2e8f0);
    flex-shrink: 0;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Staggered delays for flow steps */
.flow-step[data-step="1"].visible {
    transition-delay: 0.1s;
}

.flow-step[data-step="2"].visible {
    transition-delay: 0.2s;
}

.flow-step[data-step="3"].visible {
    transition-delay: 0.3s;
}

.flow-step[data-step="4"].visible {
    transition-delay: 0.4s;
}

.flow-step[data-step="5"].visible {
    transition-delay: 0.5s;
}

.flow-step[data-step="6"].visible {
    transition-delay: 0.6s;
}

/* Responsive */
@media (max-width: 1024px) {
    .lab-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .lab-statement {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .system-lab {
        padding: 60px 0;
    }

    .lab-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .flow-container {
        flex-direction: column;
        gap: 8px;
    }

    .flow-connector {
        width: 2px;
        height: 24px;
        background: linear-gradient(180deg, #e2e8f0, #3b82f6, #e2e8f0);
    }

    .step-tooltip {
        display: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}