/* --- AI Innovation Section --- */
.section-ai-innovation {
    position: relative;
    padding: 140px 0;
    overflow: hidden;
    background: var(--bg-light);
    transition: background 0.5s ease;
}

[data-theme="dark"] .section-ai-innovation {
    background: #080414;
}

/* AI Ambient Background */
.ai-ambient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.ai-wave {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
    animation: aiWaveRotate 30s linear infinite;
}

@keyframes aiWaveRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Header */
.ai-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 80px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ai-title-main {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text-primary-light);
    letter-spacing: -1.5px;
    margin: 0;
    line-height: 1.1;
}

[data-theme="dark"] .ai-title-main {
    color: var(--text-primary-dark);
}

.ai-subtitle-main {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-muted);
    max-width: 600px;
    margin: 0;
}

/* Pipeline Container */
.ai-pipeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

/* Flow Lines */
.ai-flow-line {
    width: 100px;
    min-width: 60px;
    height: 2px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.4), rgba(139, 92, 246, 0.1));
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.ai-data-particle {
    position: absolute;
    top: 50%;
    left: -10px;
    width: 20px;
    height: 2px;
    background: var(--primary-violet);
    box-shadow: 0 0 10px var(--primary-violet);
    transform: translateY(-50%);
    animation: particleMove 2s infinite linear;
}

@keyframes particleMove {
    from { left: -20%; }
    to { left: 120%; }
}

/* Step Cards */
.ai-step-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    padding: 32px;
    width: 320px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

[data-theme="dark"] .ai-step-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Step 1: Input */
.input-text-anim {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.05);
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    min-height: 44px;
}

[data-theme="dark"] .input-text-anim {
    background: rgba(255,255,255,0.05);
}

/* Step 2: Engine Core */
.ai-step-card.engine-card {
    background: rgba(109, 40, 217, 0.05);
    border-color: rgba(109, 40, 217, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(109, 40, 217, 0.1);
}

.engine-core {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, var(--primary-violet), #c084fc);
    border-radius: 50%;
    margin: 20px auto;
    position: relative;
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    animation: corePulse 2s infinite alternate ease-in-out;
}

.engine-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px dashed rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    animation: ringRotate 10s linear infinite;
}

@keyframes corePulse {
    from { transform: scale(0.9); box-shadow: 0 0 20px rgba(139, 92, 246, 0.4); }
    to { transform: scale(1.1); box-shadow: 0 0 60px rgba(139, 92, 246, 0.8); }
}

@keyframes ringRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.engine-status-list {
    font-size: 0.75rem;
    color: var(--primary-violet);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    margin-top: 16px;
    height: 20px;
    overflow: hidden;
}

/* Step 3: Output */
.output-box {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 16px;
    position: relative;
}

.confidence-badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #10b981;
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 100px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

/* Common Typography */
.step-num {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-violet);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.step-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary-light);
}

[data-theme="dark"] .step-title {
    color: var(--text-primary-dark);
}

/* Responsive */
@media (max-width: 1024px) {
    .ai-header {
        margin-bottom: 60px;
        padding: 0 20px;
    }
    .ai-pipeline {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }
    .ai-flow-line {
        width: 2px !important;
        height: 60px;
        flex: none;
        background: transparent !important;
        border-left: 2px solid rgba(109, 40, 217, 0.2);
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin: 10px 0;
        display: block;
        padding: 0;
    }
    .ai-data-particle {
        position: absolute;
        top: 0;
        left: -2px; /* Center on the border-left */
        width: 2px;
        height: 20px;
        background: var(--primary-violet);
        box-shadow: 0 0 8px var(--primary-violet);
        border-radius: 2px;
        animation: particleMoveVertical 1.5s infinite linear;
    }
    @keyframes particleMoveVertical {
        0% { top: -20px; opacity: 0; }
        20% { opacity: 1; }
        80% { opacity: 1; }
        100% { top: 100%; opacity: 0; }
    }
    .ai-step-card {
        width: calc(100% - 40px);
        max-width: 400px;
        margin: 0 auto;
    }
}
