/* SNAKE TIMELINE LAYOUT */
.process-snake-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

/* The Central Line */
.snake-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: rgba(0, 0, 0, 0.06);
    z-index: 0;
}

.snake-line-fill {
    width: 100%;
    height: 0%;
    background: #0071e3;
    transition: height 0.5s ease;
}

/* Rows */
.snake-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.snake-row.center {
    justify-content: center;
    margin-bottom: 0;
}

.snake-spacer {
    flex: 1;
}

/* Markers */
.snake-marker {
    width: 12px;
    height: 12px;
    background: #fff;
    border: 3px solid #d2d2d7;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0 40px;
}

/* Cards */
.snake-card {
    flex: 1;
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    /* Performance Optimization: limit transition properties and use will-change */
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    will-change: transform;
    max-width: 400px;
}

.snake-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Reduced shadow spread */
}

.snake-card.left {
    text-align: right;
    /* Content aligns towards center */
    margin-right: -20px;
    /* Slight pull towards line */
}

.snake-card.right {
    text-align: left;
    margin-left: -20px;
}

.snake-card.center {
    text-align: center;
    max-width: 500px;
}

/* Content Inside Card */
.snake-number {
    position: absolute;
    top: 20px;
    font-size: 60px;
    font-weight: 800;
    color: #f5f5f7;
    line-height: 1;
    z-index: 0;
}

.snake-card.left .snake-number {
    left: 20px;
}

.snake-card.right .snake-number {
    right: 20px;
}

.snake-card.center .snake-number {
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    opacity: 0.5;
}

.snake-card .step-icon-area {
    width: 60px;
    height: 60px;
    display: inline-flex;
    margin-bottom: 16px;
    border-radius: 16px;
    font-size: 24px;
}

.snake-card.left .step-icon-area {
    margin-left: auto;
}

.snake-card.center .step-icon-area {
    margin: 0 auto 16px;
}

/* Active States */
.snake-card.active {
    border-color: #0071e3;
    transform: scale(1.02);
}

.snake-card.active .step-icon-area {
    background: #0071e3;
    color: #fff;
}

.snake-card.active .step-title {
    color: #0071e3;
}

.snake-card.active~.snake-marker,
.snake-row:hover .snake-marker {
    /* Highlight marker when hovering row */
    background: #0071e3;
    border-color: #0071e3;
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.2);
}

/* Arrow Connector (Pseudo-elements) */
.snake-card::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    /* transition: width 0.3s; */
}

.snake-card.left::after {
    right: -20px;
}

.snake-card.right::after {
    left: -20px;
}

.snake-card.center::after {
    display: none;
}

.snake-card.active::after {
    background: #0071e3;
    height: 2px;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 800px) {

    /* Bring line back onto screen */
    .snake-line {
        left: 6px;
        width: 2px;
    }

    .process-snake-container {
        padding-left: 0;
        padding-right: 0;
    }


    .snake-row {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 20px;
        /* Space for the dot */
        /* Make space for line */
        margin-bottom: 40px;
        width: calc(100% - 24px);
        /* Full width minus left margin & small right gap */
        padding-right: 0px;
    }

    .snake-row.center {
        margin-left: 20px;
    }

    .snake-spacer,
    .snake-marker {
        display: none;
        /* Hide default markers, build new mobile ones if needed or rely on cards */
    }

    /* Re-add dots on the line for mobile */
    .snake-row::before {
        content: '';
        position: absolute;
        left: -21px;
        /* Positions dot centered on the line at 6px. (20 (margin) - 21 (left) + 7 (radius) = 6px) */
        top: 30px;
        width: 10px;
        height: 10px;
        background: #fff;
        border: 2px solid #d2d2d7;
        border-radius: 50%;
        z-index: 2;
    }

    .snake-card {
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        text-align: left !important;
    }

    .snake-card::after {
        display: none;
    }

    .snake-card .step-icon-area {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .snake-number {
        right: 20px !important;
        left: auto !important;
    }
}