/* Work Process — U-Shape Snake Chain */

:root {
    --wf-card-bg: #ffffff;
    --wf-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
    --wf-shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.13);
    --wf-radius: 14px;
    --wf-node-size: 48px;
    --wf-connector-color: #c5cad3;
}

/* Section */
.workflow-section {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
}

.timeline-bg-shape {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(93, 90, 209, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}
.timeline-bg-shape-1 { top: 10%; left: -50px; }
.timeline-bg-shape-2 { bottom: 15%; right: -50px; }

/* ── Snake Container ── */
.wf-snake {
    position: relative;
}

/* ── Row of 3 cards ── */
.wf-snake-row {
    display: flex;
    gap: 0;
    position: relative;
}

.wf-snake-row .wf-snake-item {
    flex: 1;
    min-width: 0;
    padding: 20px 15px;
    position: relative;
}

/* ── Horizontal connector arrows ── */
.wf-conn {
    display: none;
}

@media (min-width: 992px) {
    .wf-conn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 30px;
        color: var(--wf-connector-color);
        position: relative;
        z-index: 5;
    }
    .wf-conn svg {
        width: 26px;
        height: 26px;
    }
}

/* ── U-Turn between rows ── */
.wf-uturn {
    display: none;
}

@media (min-width: 992px) {
    .wf-uturn {
        display: flex;
        align-items: center;
        height: 60px;
        position: relative;
    }

    .wf-uturn-path {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--wf-connector-color);
    }

    .wf-uturn-arrow {
        position: absolute;
        bottom: -2px;
        color: var(--wf-connector-color);
    }

    .wf-uturn-arrow svg {
        width: 22px;
        height: 22px;
        display: block;
    }

    /* After a forward row: line drops on right side, arrow at bottom */
    .wf-uturn-right .wf-uturn-path {
        right: calc(16.66%);
    }
    .wf-uturn-right .wf-uturn-arrow {
        right: calc(16.66% - 10px);
    }

    /* After a reverse row: line drops on left side, arrow at bottom */
    .wf-uturn-left .wf-uturn-path {
        left: calc(16.66%);
    }
    .wf-uturn-left .wf-uturn-arrow {
        left: calc(16.66% - 10px);
    }
}

/* ── Card ── */
.wf-card {
    position: relative;
    background: var(--wf-card-bg);
    border-radius: var(--wf-radius);
    padding: 30px 22px 22px;
    box-shadow: var(--wf-shadow);
    border-top: 4px solid var(--stage-color, #5d5ad1);
    transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1),
                box-shadow 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wf-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--wf-shadow-hover);
}

/* Step Badge */
.wf-step-badge {
    position: absolute;
    top: -18px;
    right: 20px;
    width: var(--wf-node-size);
    height: var(--wf-node-size);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    z-index: 3;
    transition: transform 0.3s;
}

.wf-card:hover .wf-step-badge {
    transform: scale(1.12);
}

/* Icon */
.wf-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-bottom: 16px;
    transition: transform 0.3s;
}

.wf-card:hover .wf-card-icon {
    transform: rotate(-5deg) scale(1.08);
}

/* Title */
.wf-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px;
}

/* Image */
.wf-card-img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* Description */
.wf-card-desc {
    font-size: 0.92rem;
    color: #6b7280;
    line-height: 1.7;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* ── Sub-stages ── */
.wf-substages-container { margin-top: auto; }

.wf-substages-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 8px 15px;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #495057;
}

.wf-substages-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e9ecef;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    overflow: hidden;
}

.wf-substage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.88rem;
    color: #495057;
    transition: background 0.2s, padding-left 0.2s;
}
.wf-substage-item:last-child { border-bottom: none; }
.wf-substage-item:hover { background: #f8f9fa; padding-left: 20px; }

.wf-substage-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

/* ── Scroll Reveal ── */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.scroll-reveal.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger items within each row */
.wf-snake-item:nth-child(1) { transition-delay: 0s; }
.wf-snake-item:nth-child(2) { transition-delay: 0.12s; }
.wf-snake-item:nth-child(3) { transition-delay: 0.24s; }

/* ── Responsive ── */
@media (max-width: 991px) {
    .wf-snake-row {
        flex-wrap: wrap;
    }
    .wf-snake-row .wf-snake-item {
        flex: 0 0 50%;
    }
    .wf-uturn { display: none; }
    .wf-conn { display: none; }
    .workflow-section { padding: 60px 0; }
}

@media (max-width: 767px) {
    .wf-snake-row .wf-snake-item {
        flex: 0 0 100%;
    }
}

@media (max-width: 575px) {
    .wf-card { padding: 25px 18px 18px; }
    .wf-card-title { font-size: 1.05rem; }
    .workflow-section { padding: 45px 0; }
}
