/* ==========================================================
   Carry Africa Rail Timeline
   Subtle transport-map style timeline for TrackJob
   Add at the bottom of carry-job.css
   ========================================================== */

.carry-rail-card {
    --rail-ink: #102033;
    --rail-muted: #64748b;
    --rail-border: rgba(15, 118, 110, .16);
    --rail-brand: #0f766e;
    --rail-gold: #f59e0b;
    --rail-track: #dbe5f0;
    position: relative;
    overflow: hidden;
    margin-top: 1.2rem;
    border: 1px solid var(--rail-border);
    border-radius: 30px;
    background:
        radial-gradient(circle at 8% 8%, rgba(15, 118, 110, .11), transparent 28%),
        radial-gradient(circle at 94% 4%, rgba(245, 158, 11, .15), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .09);
}

.carry-rail-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #0f766e, #f59e0b, #0284c7, #7c3aed);
}

.carry-rail-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1.35rem 1.45rem 1.1rem;
    color: #fff;
    background:
        radial-gradient(circle at 86% 10%, rgba(245, 158, 11, .42), transparent 28%),
        radial-gradient(circle at 12% 16%, rgba(14, 165, 233, .22), transparent 30%),
        linear-gradient(135deg, #102033 0%, #0f766e 62%, #064e3b 100%);
}

.carry-rail-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    margin-bottom: .45rem;
    color: rgba(255, 255, 255, .78);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.carry-rail-hero h5 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 950;
    letter-spacing: -.025em;
}

.carry-rail-hero p {
    margin: .22rem 0 0;
    color: rgba(255, 255, 255, .78);
    font-weight: 650;
}

.carry-rail-score {
    min-width: 110px;
    padding: .85rem .95rem;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 16px 34px rgba(0, 0, 0, .12);
    backdrop-filter: blur(12px);
}

.carry-rail-score strong {
    display: block;
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 950;
}

.carry-rail-score span {
    display: block;
    margin-top: .28rem;
    color: rgba(255, 255, 255, .74);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.carry-rail-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1.15rem 1rem 1.25rem;
    scrollbar-width: thin;
}

.carry-rail-map {
    --rail-node-top: 2.15rem;
    position: relative;
    display: grid;
    min-width: calc(var(--rail-count) * 148px);
    isolation: isolate;
}

.carry-rail-track {
    position: absolute;
    z-index: 0;
    top: var(--rail-node-top);
    left: calc(100% / (var(--rail-count) * 2));
    right: calc(100% / (var(--rail-count) * 2));
    height: 9px;
    border-radius: 999px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.65), rgba(255,255,255,0)),
        repeating-linear-gradient(90deg, #dbe5f0 0, #dbe5f0 12px, #cbd5e1 12px, #cbd5e1 18px);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .14);
}

.carry-rail-track span {
    display: block;
    width: var(--rail-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e 0%, #22c55e 38%, #f59e0b 72%, #0284c7 100%);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .08), 0 0 24px rgba(245, 158, 11, .26);
    transition: width .4s ease;
}

.carry-rail-step {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: 74px 1fr;
    min-width: 0;
    padding: 0 .45rem;
}

.carry-station-node {
    display: grid;
    place-items: start center;
    padding-top: .62rem;
}

.carry-station-dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 4px solid #fff;
    border-radius: 999px;
    color: var(--station-color, #0f766e);
    background: #ffffff;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--station-color, #0f766e) 24%, transparent), 0 14px 28px rgba(15, 23, 42, .16);
}

.carry-station-dot i {
    font-size: 1.1rem;
}

.carry-rail-step.is-done .carry-station-dot {
    color: #fff;
    background: var(--station-color, #16a34a);
}

.carry-rail-step.is-current .carry-station-dot {
    color: #102033;
    background: #fbbf24;
    animation: carryRailPulse 1.8s ease-in-out infinite;
}

.carry-rail-step.is-waiting .carry-station-dot {
    color: #94a3b8;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .18), 0 10px 22px rgba(15, 23, 42, .08);
}

@keyframes carryRailPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .26), 0 14px 30px rgba(245, 158, 11, .24); }
    50% { box-shadow: 0 0 0 9px rgba(245, 158, 11, .10), 0 20px 42px rgba(245, 158, 11, .34); }
}

.carry-station-card {
    position: relative;
    min-height: 154px;
    padding: .88rem;
    border: 1px solid rgba(100, 116, 139, .16);
    border-radius: 22px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    backdrop-filter: blur(10px);
}

.carry-station-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    border-radius: 22px 22px 0 0;
    background: var(--station-color, #0f766e);
    opacity: .9;
}

.carry-rail-step.is-current .carry-station-card {
    border-color: rgba(245, 158, 11, .48);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, .15), transparent 34%),
        rgba(255, 255, 255, .96);
    box-shadow: 0 20px 44px rgba(245, 158, 11, .18);
}

.carry-rail-step.is-done .carry-station-card {
    border-color: rgba(22, 163, 74, .22);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.carry-rail-step.is-waiting .carry-station-card {
    opacity: .78;
}

.carry-station-topline {
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    align-items: flex-start;
}

.carry-station-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 24px;
    padding: 0 .45rem;
    border-radius: 999px;
    color: var(--station-color, #0f766e);
    background: color-mix(in srgb, var(--station-color, #0f766e) 12%, #ffffff);
    font-size: .72rem;
    font-weight: 950;
}

.carry-station-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .28rem .5rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
}

.carry-rail-step.is-done .carry-station-state {
    color: #166534;
    background: #dcfce7;
}

.carry-rail-step.is-current .carry-station-state {
    color: #92400e;
    background: #fef3c7;
}

.carry-station-card h6 {
    margin: .68rem 0 .18rem;
    color: var(--rail-ink);
    font-size: .93rem;
    font-weight: 950;
    letter-spacing: -.01em;
}

.carry-station-card p {
    margin: 0;
    color: var(--rail-muted);
    font-size: .78rem;
    line-height: 1.35;
    font-weight: 650;
}

.carry-station-meta {
    display: grid;
    gap: .34rem;
    margin-top: .75rem;
}

.carry-station-meta span {
    display: inline-flex;
    align-items: center;
    gap: .36rem;
    min-width: 0;
    color: #475569;
    font-size: .75rem;
    font-weight: 750;
}

.carry-station-meta i {
    color: var(--station-color, #0f766e);
}

.carry-station-warning {
    margin-top: .55rem;
    padding: .42rem .55rem;
    border: 1px solid #fda4af;
    border-radius: 14px;
    color: #be123c !important;
    background: #fff1f2;
    font-size: .74rem;
    font-weight: 900;
}

.carry-rail-complete-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 1.25rem 0;
    padding: .9rem 1rem;
    border: 1px solid rgba(22, 163, 74, .24);
    border-radius: 20px;
    color: #166534;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
}

.carry-rail-complete-banner i {
    font-size: 1.35rem;
}

.carry-rail-complete-banner span {
    display: block;
    color: #4b5563;
    font-size: .86rem;
}

@media (max-width: 768px) {
    .carry-rail-hero {
        grid-template-columns: 1fr;
    }

    .carry-rail-score {
        width: 100%;
    }

    .carry-rail-scroll {
        overflow: visible;
        padding: 1rem;
    }

    .carry-rail-map {
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr !important;
        gap: .75rem;
        padding-left: 0;
    }

    .carry-rail-track {
        top: 26px;
        bottom: 26px;
        left: 27px;
        right: auto;
        width: 8px;
        height: auto;
    }

    .carry-rail-track span {
        width: 100%;
        height: var(--rail-progress);
        transition: height .4s ease;
    }

    .carry-rail-step {
        grid-template-columns: 58px minmax(0, 1fr);
        grid-template-rows: auto;
        padding: 0;
    }

    .carry-station-node {
        place-items: start center;
        padding-top: .2rem;
    }

    .carry-station-dot {
        width: 46px;
        height: 46px;
    }

    .carry-station-card {
        min-height: 0;
    }
}
