/* ======================================
   Campaign Flow Diagram — Rail Style
   ====================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section--campaign-flow {
    background: #faf9fb;
    padding: 100px 0;
    overflow: hidden;
}

.campaign-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto 60px;
    min-height: 340px;
}

.fade-in-up {
    opacity: 1;
}

/* =========================================
   Side columns
   ========================================= */
.cf-side {
    display: flex;
    flex-direction: column;
    flex: 0 0 140px;
}

.cf-side--left {
    align-items: flex-end;
    height: 400px;
    justify-content: space-between;
    padding: 10px 0;
}

.cf-side--right {
    align-items: flex-start;
    gap: 20px;
}

/* --- Individual nodes --- */
.cf-node {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    position: relative;
}

.cf-node__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(230, 18, 190, 0.12), rgba(230, 18, 190, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e612be;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cf-node__icon:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(230, 18, 190, 0.2);
}

.cf-node__label {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.5);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

/* --- Highlighted node --- */
.cf-node--highlight .cf-node__icon {
    box-shadow: 0 0 0 2px rgba(230, 18, 190, 0.3);
    animation: cfPulseRing 2s ease-in-out infinite;
}

@keyframes cfPulseRing {

    0%,
    100% {
        box-shadow: 0 0 0 2px rgba(230, 18, 190, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(230, 18, 190, 0.08), 0 0 12px rgba(230, 18, 190, 0.15);
    }
}

.cf-node__badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #e612be;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.2px;
    animation: cfBadgePop 0.5s ease both;
    animation-delay: 1.2s;
    z-index: 2;
}

@keyframes cfBadgePop {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.7);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

/* =========================================
   Thick Rail Paths (left side)
   ========================================= */
.cf-rails {
    flex: 0 0 180px;
    height: 400px;
    position: relative;
}

.cf-rails svg {
    width: 100%;
    height: 100%;
}

/* Thick outer rail */
.cf-rail {
    fill: none;
    stroke: rgba(230, 18, 190, 0.1);
    stroke-width: 10;
    stroke-linecap: round;
}

/* Dashed center stripe */
.cf-rail-stripe {
    fill: none;
    stroke: rgba(230, 18, 190, 0.2);
    stroke-width: 1.5;
    stroke-dasharray: 6 8;
    stroke-linecap: round;
    animation: railFlowLTR 1.2s linear infinite;
}

@keyframes railFlowLTR {
    to {
        stroke-dashoffset: -28;
    }
}

/* =========================================
   Bullets — small dots on rails (JS-animated)
   ========================================= */
.cf-bullet {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e612be;
    box-shadow: 0 0 6px rgba(230, 18, 190, 0.4);
    z-index: 4;
    top: 0;
    left: 0;
    opacity: 0;
    offset-distance: 0%;
}

.cf-bullet--1 {
    offset-path: path("M0,34 C70,34 130,95 200,95");
}

.cf-bullet--2 {
    offset-path: path("M0,145 C70,145 130,155 200,155");
}

.cf-bullet--3 {
    offset-path: path("M0,255 C70,255 130,210 200,210");
}

.cf-bullet--4 {
    offset-path: path("M0,366 C70,366 130,270 200,270");
}

/* =========================================
   Event Labels — float above bullets (JS-animated)
   ========================================= */
.cf-event-label {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    top: 0;
    left: 0;
    opacity: 0;
    offset-distance: 0%;
}

.cf-event-label span {
    display: inline-block;
    background: #e612be;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(230, 18, 190, 0.3);
    transform: translateY(-18px);
}

.cf-event-label--1 {
    offset-path: path("M0,34 C70,34 130,95 200,95");
}

.cf-event-label--2 {
    offset-path: path("M0,145 C70,145 130,155 200,155");
}

.cf-event-label--3 {
    offset-path: path("M0,255 C70,255 130,210 200,210");
}

.cf-event-label--4 {
    offset-path: path("M0,366 C70,366 130,270 200,270");
}

/* Right-side bullet offset-paths */
.cf-bullet-r--1 {
    offset-path: path("M0,95 C70,95 130,40 200,40");
}

.cf-bullet-r--2 {
    offset-path: path("M0,140 C70,140 130,120 200,120");
}

.cf-bullet-r--3 {
    offset-path: path("M0,180 C70,180 130,200 200,200");
}

.cf-bullet-r--4 {
    offset-path: path("M0,220 C70,220 130,280 200,280");
}

/* Right-side label offset-paths */
.cf-event-label-r--1 {
    offset-path: path("M0,95 C70,95 130,40 200,40");
}

.cf-event-label-r--2 {
    offset-path: path("M0,140 C70,140 130,120 200,120");
}

.cf-event-label-r--3 {
    offset-path: path("M0,180 C70,180 130,200 200,200");
}

.cf-event-label-r--4 {
    offset-path: path("M0,220 C70,220 130,280 200,280");
}

/* =========================================
   Condition checks — JS-animated green transition
   ========================================= */
.cf-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.25);
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    transform: scale(1);
}

.cf-check.active {
    background: rgba(76, 175, 80, 0.18);
    color: #2e7d32;
    animation: checkPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes checkPop {
    0% {
        transform: scale(1);
        background: rgba(0, 0, 0, 0.06);
        color: rgba(0, 0, 0, 0.25);
        box-shadow: none;
    }

    40% {
        transform: scale(1.6);
        background: rgba(76, 175, 80, 0.35);
        color: #1b5e20;
        box-shadow: 0 0 12px rgba(76, 175, 80, 0.5);
    }

    70% {
        transform: scale(0.95);
        background: rgba(76, 175, 80, 0.22);
        color: #2e7d32;
        box-shadow: 0 0 4px rgba(76, 175, 80, 0.2);
    }

    100% {
        transform: scale(1);
        background: rgba(76, 175, 80, 0.18);
        color: #2e7d32;
        box-shadow: none;
    }
}

/* Action checks — start gray, turn green via JS */
.cf-action--1,
.cf-action--2,
.cf-action--3 {
    animation: none;
}

/* =========================================
   Right-side thick rails (mirrors left, LTR dashes)
   ========================================= */
.cf-rails--right {
    flex: 0 0 180px;
    height: 400px;
    position: relative;
}

.cf-rail-stripe--ltr {
    animation: railFlowLTR_right 1.2s linear infinite !important;
}

@keyframes railFlowLTR_right {
    to {
        stroke-dashoffset: -28;
    }
}

.cf-side--right {
    align-items: flex-start;
    height: 400px;
    justify-content: space-between;
    padding: 10px 0;
}

/* =========================================
   Center campaign card
   ========================================= */
.cf-card {
    flex: 0 0 260px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    z-index: 1;
    animation: cfCardIn 0.7s ease both;
    animation-delay: 0.3s;
}

@keyframes cfCardIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

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

.cf-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e612be;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    letter-spacing: 0.5px;
}

.cf-card__section {
    margin-bottom: 16px;
}

.cf-card__section:last-child {
    margin-bottom: 0;
}

.cf-card__heading {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.cf-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cf-card__list li {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .campaign-flow {
        flex-wrap: wrap;
        gap: 32px;
    }

    .cf-side {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        flex: 1 1 100%;
        gap: 16px;
        height: auto !important;
        padding: 0 !important;
    }

    .cf-side--left,
    .cf-side--right {
        align-items: center;
    }

    .cf-rails,
    .cf-lines {
        display: none;
    }

    .cf-card {
        flex: 0 1 320px;
    }
}

@media (max-width: 480px) {
    .section--campaign-flow {
        padding: 60px 0;
    }

    .cf-card {
        flex: 1 1 100%;
        max-width: 300px;
    }
}