/* ========================================
   AI STORY FLOW
   أساس البلوك + الخلفية + رأس القسم
   Base section + background + section header
======================================== */

.vp-ai-flow {
    --ai-section-padding: 140px;
    padding-inline: 24px;
}


.vp-ai-flow__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.vp-ai-flow__glow.glow-one {
    top: -140px;
    left: -120px;
    background: #7b61ff;
}

.vp-ai-flow__glow.glow-two {
    right: -140px;
    bottom: -160px;
    background: #00d0ff;
    animation-delay: 2s;
}

.vp-ai-flow__inner {
    position: relative;
    z-index: 3;
    max-width: 1180px;
    margin: 0 auto;
}

.vp-ai-flow__head {
    max-width: 780px;
    margin: 0 auto 90px;
    text-align: center;
}

.vp-ai-flow__kicker {
    margin-bottom: 22px;
    border: 1px solid rgba(184, 146, 255, 0.22);
}

.vp-ai-flow__title {
    margin: 0;
    color: #ffffff;

    line-height: 0.95;
    letter-spacing: -0.06em;
    font-weight: 650;
    text-wrap: balance;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.08),
        0 0 42px rgba(143, 92, 255, 0.18);

    font-size: clamp(42px, 6.5vw, 86px);
}

.vp-ai-flow__text {
    max-width: 700px;
    margin: 26px auto 0;
}

@keyframes vpAiFlowGlowFloat {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }

    to {
        transform: translate3d(40px, -30px, 0) scale(1.12);
    }
}

/* ========================================
   FLOW PATH + STEPS
   مسار النظام + محطات الرحلة
======================================== */

.vp-ai-flow__path {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 980px;
    margin: 0 auto;
}

.vp-ai-flow__path::before {
    content: "";
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background:
        linear-gradient(180deg,
            transparent,
            rgba(184, 146, 255, 0.75),
            rgba(0, 208, 255, 0.65),
            transparent);
    box-shadow:
        0 0 24px rgba(184, 146, 255, 0.35),
        0 0 42px rgba(0, 208, 255, 0.20);
}

.vp-ai-flow__step {
    position: relative;
    width: calc(50% - 58px);
    min-height: 190px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
        rgba(8, 15, 30, 0.72);
    backdrop-filter: blur(22px);
    box-shadow:
        0 28px 90px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    overflow: hidden;
}


.vp-ai-flow__step:nth-child(odd) {
    justify-self: start;
}

.vp-ai-flow__step:nth-child(even) {
    justify-self: end;
}

.vp-ai-flow__step::before {
    content: "";
    position: absolute;
    top: 42px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #b892ff;
    box-shadow:
        0 0 18px rgba(184, 146, 255, 0.9),
        0 0 42px rgba(0, 208, 255, 0.35);
}

.vp-ai-flow__step:nth-child(odd)::before {
    right: -68px;
}

.vp-ai-flow__step:nth-child(even)::before {
    left: -68px;
    background: #00d0ff;
}

.vp-ai-flow__number {
    display: inline-flex;
    margin-bottom: 28px;
    color: rgba(184, 146, 255, 0.75);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.24em;
}

.vp-ai-flow__step h3 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.vp-ai-flow__step p {
    max-width: 430px;
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 16px;
    line-height: 1.75;
}

/* ========================================
   ENERGY PULSE
   نبضة الطاقة المتحركة على مسار النظام
======================================== */

.vp-ai-flow__path::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 20px;
    width: 10px;
    height: 90px;
    transform: translateX(-50%);
    border-radius: 999px;
    background:
        linear-gradient(180deg,
            transparent,
            rgba(255, 255, 255, 0.95),
            rgba(0, 208, 255, 0.85),
            transparent);
    filter: blur(4px);
    box-shadow:
        0 0 24px rgba(0, 208, 255, 0.75),
        0 0 52px rgba(184, 146, 255, 0.45);
    animation: vpAiFlowPulseMove 4.8s ease-in-out infinite;
}

@keyframes vpAiFlowPulseMove {
    0% {
        top: 20px;
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    82% {
        opacity: 1;
    }

    100% {
        top: calc(100% - 110px);
        opacity: 0;
    }
}

/* ========================================
   STEP INTERACTION
   التفاعل الذكي مع مراحل النظام
======================================== */

.vp-ai-flow__step {
    transition:
        transform 0.45s ease,
        border-color 0.45s ease,
        box-shadow 0.45s ease,
        background 0.45s ease;
}

.vp-ai-flow__step:hover {
    transform: translateY(-10px);
    border-color: rgba(184, 146, 255, 0.34);

    box-shadow:
        0 36px 120px rgba(0, 0, 0, 0.42),
        0 0 60px rgba(184, 146, 255, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);

    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.12),
            rgba(255, 255, 255, 0.035)),
        rgba(10, 18, 36, 0.82);
}

.vp-ai-flow__step::before {
    transition:
        transform 0.45s ease,
        box-shadow 0.45s ease,
        background 0.45s ease;
}

.vp-ai-flow__step:hover::before {
    transform: scale(1.35);

    box-shadow:
        0 0 24px rgba(184, 146, 255, 1),
        0 0 60px rgba(0, 208, 255, 0.55);
}

/* ========================================
   STEP SCAN LIGHT
   لمعة مسح سينمائية داخل كل مرحلة
======================================== */

.vp-ai-flow__step::after {
    content: "";
    position: absolute;
    top: -120%;
    left: -45%;
    width: 170px;
    height: 320%;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.08),
            rgba(0, 208, 255, 0.20),
            rgba(184, 146, 255, 0.14),
            transparent);
    transform: rotate(18deg) translateX(-260%);
    transition: transform 1.1s cubic-bezier(.19, 1, .22, 1);
}

.vp-ai-flow__step:hover::after {
    transform: rotate(18deg) translateX(340%);
}

/* ========================================
   FLOW REVEAL MOTION
   دخول سينمائي ناعم للرأس والمراحل
======================================== */

.vp-ai-flow__kicker,
.vp-ai-flow__title,
.vp-ai-flow__text,
.vp-ai-flow__step {
    opacity: 0;
    animation: vpAiFlowRevealSoft 1.25s cubic-bezier(.16, 1, .3, 1) both;
}

.vp-ai-flow__kicker {
    animation-delay: 0.08s;
}

.vp-ai-flow__title {
    animation-delay: 0.18s;
}

.vp-ai-flow__text {
    animation-delay: 0.32s;
}

.vp-ai-flow .step-one {
    animation-delay: 0.48s;
    --flow-x: -42px;
}

.vp-ai-flow .step-two {
    animation-delay: 0.62s;
    --flow-x: 42px;
}

.vp-ai-flow .step-three {
    animation-delay: 0.76s;
    --flow-x: -42px;
}

.vp-ai-flow .step-four {
    animation-delay: 0.90s;
    --flow-x: 42px;
}

@keyframes vpAiFlowRevealSoft {
    from {
        opacity: 0;
        transform: translate3d(var(--flow-x, 0), 44px, 0) scale(0.96);
        filter: blur(14px);
    }

    65% {
        opacity: 1;
        filter: blur(0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
        filter: blur(0);
    }
}

/* ========================================
   NEURAL ATMOSPHERE
   شبكة عصبية تطفو حول مسار النظام
======================================== */

.vp-ai-flow__network {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.vp-ai-flow__dot {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(184, 146, 255, 0.95);
    box-shadow:
        0 0 18px rgba(184, 146, 255, 0.85),
        0 0 42px rgba(0, 208, 255, 0.35);
    opacity: 0.75;
    animation: vpAiDotFloat 5s ease-in-out infinite;
}

.dot-1 {
    top: 7%;
    left: 35%;
}

.dot-2 {
    top: 23%;
    right: 29%;
    background: rgba(0, 208, 255, 0.95);
    animation-delay: 0.5s;
}

.dot-3 {
    top: 43%;
    left: 31%;
    animation-delay: 1s;
}

.dot-4 {
    top: 59%;
    right: 31%;
    background: rgba(0, 208, 255, 0.95);
    animation-delay: 1.5s;
}

.dot-5 {
    bottom: 19%;
    left: 35%;
    animation-delay: 2s;
}

.dot-6 {
    bottom: 5%;
    right: 35%;
    background: rgba(0, 208, 255, 0.95);
    animation-delay: 2.5s;
}

@keyframes vpAiDotFloat {

    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(0.9);
        opacity: 0.45;
    }

    50% {
        transform: translate3d(18px, -22px, 0) scale(1.25);
        opacity: 1;
    }
}

/* ========================================
   RESPONSIVE FLOW
   ضبط البلوك على التابلت والموبايل
======================================== */

@media (max-width: 900px) {
    .vp-ai-flow {
        padding: 110px 20px;
    }

    .vp-ai-flow__head {
        margin-bottom: 64px;
    }

    .vp-ai-flow__path {
        gap: 24px;
        max-width: 680px;
    }

    .vp-ai-flow__path::before,
    .vp-ai-flow__path::after {
        left: 18px;
        transform: none;
    }

    .vp-ai-flow__step {
        width: auto;
        margin-left: 54px;
        justify-self: stretch !important;
    }

    .vp-ai-flow__step::before {
        left: -45px !important;
        right: auto !important;
    }

    .vp-ai-flow__network {
        opacity: 0.55;
    }
}

@media (max-width: 560px) {
    .vp-ai-flow {
        padding: 90px 16px;
    }

    .vp-ai-flow__title {
        font-size: clamp(38px, 12vw, 58px);
        letter-spacing: -0.045em;
    }

    .vp-ai-flow__text {
        font-size: 16px;
        line-height: 1.7;
    }

    .vp-ai-flow__step {
        padding: 24px;
        border-radius: 24px;
    }

    .vp-ai-flow__step h3 {
        font-size: 24px;
    }

    .vp-ai-flow__step p {
        font-size: 15px;
    }

    .vp-ai-flow__dot {
        opacity: 0.45;
        transform: scale(0.85);
    }
}

/* ========================================
   AI FLOW MOUSE LIGHT
   ضوء تفاعلي يتحرك مع الماوس
======================================== */

.vp-ai-flow__mouse-light {
    position: absolute;
    left: var(--ai-flow-mouse-x, 50%);
    top: var(--ai-flow-mouse-y, 50%);
    z-index: 2;
    width: 520px;
    height: 520px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    background:
        radial-gradient(circle,
            rgba(184, 146, 255, 0.16),
            rgba(0, 208, 255, 0.08) 34%,
            transparent 68%);
    filter: blur(18px);
    opacity: 0;
    transition:
        opacity 0.35s ease,
        left 0.12s ease-out,
        top 0.12s ease-out;
}

.vp-ai-flow:hover .vp-ai-flow__mouse-light {
    opacity: 1;
}

.vp-ai-flow__path,
.vp-ai-flow__step {
    transition:
        transform 0.25s ease-out,
        border-color 0.45s ease,
        box-shadow 0.45s ease,
        background 0.45s ease;
}

/* ========================================
   SCROLL PROGRESS LINE
   خط تقدم يتفاعل مع السكرول
======================================== */

.vp-ai-flow__path {
    --flow-progress: 0%;
}

.vp-ai-flow__path::before {
    opacity: 0.35;
}

.vp-ai-flow__path-progress {
    position: absolute;
    top: 28px;
    bottom: 28px;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    pointer-events: none;
    border-radius: 999px;
    background:
        linear-gradient(180deg,
            rgba(184, 146, 255, 0.95),
            rgba(0, 208, 255, 0.90));
    box-shadow:
        0 0 24px rgba(184, 146, 255, 0.55),
        0 0 52px rgba(0, 208, 255, 0.35);
    clip-path: inset(0 0 calc(100% - var(--flow-progress)) 0);
}

/* ========================================
   ACTIVE FLOW STEPS
   تفعيل المراحل حسب تقدم السكرول
======================================== */

.vp-ai-flow__step.is-active {
    border-color: rgba(0, 208, 255, 0.42);
    box-shadow:
        0 36px 120px rgba(0, 0, 0, 0.42),
        0 0 70px rgba(0, 208, 255, 0.18),
        0 0 120px rgba(184, 146, 255, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.vp-ai-flow__step.is-active::before {
    transform: scale(1.35);
    background: #00d0ff;
    box-shadow:
        0 0 28px rgba(0, 208, 255, 1),
        0 0 70px rgba(184, 146, 255, 0.55);
}

.vp-ai-flow__step.is-active .vp-ai-flow__number {
    color: rgba(0, 208, 255, 0.95);
}

/* ========================================
   SCROLL ENERGY CURSOR
   مؤشر طاقة يتحرك مع تقدم السكرول
======================================== */

.vp-ai-flow__energy-cursor {
    position: absolute;
    left: 50%;
    top: var(--flow-progress, 0%);
    z-index: 3;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: #00d0ff;
    box-shadow:
        0 0 22px rgba(0, 208, 255, 1),
        0 0 70px rgba(184, 146, 255, 0.55);
    pointer-events: none;
}

.vp-ai-flow__energy-cursor::after {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: inherit;
    border: 1px solid rgba(0, 208, 255, 0.35);
    animation: vpAiCursorPulse 1.7s ease-in-out infinite;
}

@keyframes vpAiCursorPulse {

    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.7);
    }

    50% {
        opacity: 1;
        transform: scale(1.25);
    }
}

/* ========================================
   ACTIVE STEP BEAM
   شعاع ضوئي يربط المرحلة النشطة بالمسار
======================================== */

.vp-ai-flow__step {
    isolation: isolate;
}

.vp-ai-flow__step.is-active::after {
    opacity: 1;
}

.vp-ai-flow__step::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 58px;
    height: 2px;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg,
            transparent,
            rgba(0, 208, 255, 0.95));
    box-shadow:
        0 0 18px rgba(0, 208, 255, 0.75),
        0 0 42px rgba(184, 146, 255, 0.35);
    transition: opacity 0.45s ease;
}

.vp-ai-flow__step:nth-child(odd)::after {
    right: -58px;
}

.vp-ai-flow__step:nth-child(even)::after {
    left: -58px;
    transform: rotate(180deg);
}

/* ========================================
   DYNAMIC FOCUS GLOW
   توهج ديناميكي حول المرحلة النشطة
======================================== */

.vp-ai-flow__step::selection {
    background: rgba(0, 208, 255, 0.18);
}

.vp-ai-flow__step::before {
    z-index: 2;
}

.vp-ai-flow__step-content-glow {
    position: absolute;
    inset: -80px;
    z-index: -1;
    pointer-events: none;
    border-radius: inherit;
    background:
        radial-gradient(circle,
            rgba(0, 208, 255, 0.22),
            rgba(184, 146, 255, 0.12) 38%,
            transparent 72%);
    filter: blur(40px);
    opacity: 0;
    transform: scale(0.85);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease;
}

.vp-ai-flow__step.is-active .vp-ai-flow__step-content-glow {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   STEP DATA CHIPS
   شرائح بيانات صغيرة داخل مراحل النظام
======================================== */

.vp-ai-flow__chip {
    display: inline-flex;
    margin-inline-start: 12px;
    margin-bottom: 28px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 208, 255, 0.20);
    border-radius: 999px;
    background: rgba(0, 208, 255, 0.055);
    color: rgba(0, 208, 255, 0.82);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.vp-ai-flow__step.is-active .vp-ai-flow__chip {
    border-color: rgba(0, 208, 255, 0.48);
    background: rgba(0, 208, 255, 0.10);
    box-shadow: 0 0 26px rgba(0, 208, 255, 0.18);
}

/* ========================================
   ACTIVE CHIP PULSE
   نبضة ذكية لشريحة المرحلة النشطة
======================================== */

.vp-ai-flow__step.is-active .vp-ai-flow__chip {
    animation: vpAiChipPulse 1.4s ease-in-out infinite;
}

@keyframes vpAiChipPulse {

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

    50% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

/* ========================================
   FINAL FLOW POLISH
   اللمسة الأخيرة لتوازن البلوك
======================================== */

.vp-ai-flow__step.is-active h3 {
    text-shadow:
        0 0 18px rgba(0, 208, 255, 0.18),
        0 0 42px rgba(184, 146, 255, 0.12);
}

.vp-ai-flow__step.is-active p {
    color: rgba(255, 255, 255, 0.78);
}

.vp-ai-flow__energy-cursor {
    transition: top 0.18s ease-out;
}

@media (max-width: 900px) {
    .vp-ai-flow__energy-cursor {
        left: 18px;
        transform: translate(-50%, -50%);
    }

    .vp-ai-flow__path-progress {
        left: 18px;
        transform: none;
    }
}