/* ============================================================
   Roadmap Page — FarmBrawl
   Premium Dark timeline with scroll animations
   ============================================================ */

/* --- Page foundation --- */
.roadmap-page {
    background: #0f172a;
    min-height: 100vh;
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    color: #f8fafc;
    overflow-x: hidden;
}

/* --- Topbar (shared with help center) --- */
.rm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
}

.rm-topbar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.rm-topbar-links a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.rm-topbar-links a:hover,
.rm-topbar-links a.is-active {
    color: #10b981;
}

/* --- Hero --- */
.rm-hero {
    text-align: center;
    padding: 5rem 1.5rem 3rem;
    position: relative;
}

.rm-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
    animation: rmFadeDown 0.6s ease both;
}

.rm-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin: 0 0 1rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #f8fafc 0%, #34d399 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rmFadeDown 0.6s ease 0.1s both;
}

.rm-hero p {
    font-size: 1.05rem;
    color: #94a3b8;
    max-width: 540px;
    margin: 0 auto;
    line-height: 1.6;
    animation: rmFadeDown 0.6s ease 0.2s both;
}

@keyframes rmFadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Timeline container --- */
.rm-timeline {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 6rem;
}

/* Vertical center line */
.rm-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #059669, #34d399, #a78bfa, #334155);
    border-radius: 3px;
    transform: translateX(-50%);
}

/* --- Phase card --- */
.rm-phase {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 4rem;
    /* scroll animation initial state */
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.rm-phase.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay per card */
.rm-phase:nth-child(1) { transition-delay: 0s; }
.rm-phase:nth-child(2) { transition-delay: 0.08s; }
.rm-phase:nth-child(3) { transition-delay: 0.16s; }
.rm-phase:nth-child(4) { transition-delay: 0.24s; }
.rm-phase:nth-child(5) { transition-delay: 0.32s; }

/* Zigzag: even cards go left, odd go right */
.rm-phase:nth-child(odd) {
    flex-direction: row;
    padding-right: calc(50% + 2.5rem);
}

.rm-phase:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: calc(50% + 2.5rem);
}

/* --- Timeline dot (center node) --- */
.rm-dot {
    position: absolute;
    left: 50%;
    top: 0.5rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #1e293b;
    border: 3px solid #475569;
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.3s ease;
}

/* Connector line from dot to card */
.rm-phase:nth-child(odd) .rm-connector,
.rm-phase:nth-child(even) .rm-connector {
    position: absolute;
    top: 0.6rem;
    height: 2px;
    background: #334155;
    z-index: 1;
}
.rm-phase:nth-child(odd) .rm-connector {
    left: 50%;
    width: calc(50% - 2.5rem + 10px);
}
.rm-phase:nth-child(even) .rm-connector {
    right: 50%;
    width: calc(50% - 2.5rem + 10px);
}

/* --- Card body --- */
.rm-card {
    flex: 1;
    background: linear-gradient(135deg, #1e293b 0%, #162032 100%);
    border: 1px solid #334155;
    border-radius: 1rem;
    padding: 1.5rem 1.75rem;
    position: relative;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.rm-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.rm-phase-num {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    background: rgba(100, 116, 139, 0.1);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.rm-card h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: #f8fafc;
}

.rm-card-period {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 1rem;
}

.rm-card-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rm-card-items li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.5rem;
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.rm-card-items li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #475569;
}

/* Status badge */
.rm-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-top: 1rem;
}

/* --- States --- */

/* DONE */
.rm-phase--done .rm-dot {
    border-color: #059669;
    background: #059669;
    box-shadow: 0 0 8px rgba(5, 150, 105, 0.4);
}

.rm-phase--done .rm-card {
    border-color: rgba(5, 150, 105, 0.25);
}

.rm-phase--done .rm-card-items li::before {
    background: #34d399;
}

.rm-phase--done .rm-status {
    color: #34d399;
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.rm-phase--done .rm-connector {
    background: linear-gradient(90deg, transparent, #059669);
}
.rm-phase--done:nth-child(even) .rm-connector {
    background: linear-gradient(270deg, transparent, #059669);
}

/* ACTIVE — neon glow */
.rm-phase--active .rm-dot {
    border-color: #34d399;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
    animation: rmDotPulse 2s ease-in-out infinite;
}

.rm-phase--active .rm-card {
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow:
        0 0 20px rgba(52, 211, 153, 0.15),
        0 0 40px rgba(124, 58, 237, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: rmNeonGlow 3s ease-in-out infinite;
}

.rm-phase--active .rm-card h3 {
    background: linear-gradient(90deg, #f8fafc, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rm-phase--active .rm-card-items li::before {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.rm-phase--active .rm-status {
    color: #f8fafc;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid rgba(52, 211, 153, 0.3);
    animation: rmStatusPulse 2s ease-in-out infinite;
}

.rm-phase--active .rm-connector {
    background: linear-gradient(90deg, transparent, #34d399);
}
.rm-phase--active:nth-child(even) .rm-connector {
    background: linear-gradient(270deg, transparent, #34d399);
}

/* PENDING */
.rm-phase--pending .rm-dot {
    border-color: #475569;
    background: #1e293b;
}

.rm-phase--pending .rm-card {
    border-color: rgba(71, 85, 105, 0.4);
    opacity: 0.75;
}

.rm-phase--pending .rm-card-items li::before {
    background: #475569;
}

.rm-phase--pending .rm-status {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

/* --- Keyframes --- */
@keyframes rmNeonGlow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(52, 211, 153, 0.15),
            0 0 40px rgba(124, 58, 237, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }
    50% {
        box-shadow:
            0 0 30px rgba(52, 211, 153, 0.25),
            0 0 60px rgba(124, 58, 237, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }
}

@keyframes rmDotPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(52, 211, 153, 0.4); }
    50%      { box-shadow: 0 0 16px rgba(52, 211, 153, 0.7), 0 0 24px rgba(124, 58, 237, 0.3); }
}

@keyframes rmStatusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.2); }
    50%      { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

/* --- Footer --- */
.rm-footer {
    text-align: center;
    padding: 2rem 1.5rem 3rem;
    color: #475569;
    font-size: 0.8rem;
    border-top: 1px solid rgba(51, 65, 85, 0.3);
}

.rm-footer a {
    color: #34d399;
    text-decoration: none;
}

.rm-footer a:hover {
    color: #6ee7b7;
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .rm-timeline::before {
        left: 1.25rem;
    }

    .rm-phase,
    .rm-phase:nth-child(odd),
    .rm-phase:nth-child(even) {
        flex-direction: row;
        padding-left: 3.5rem;
        padding-right: 0;
    }

    .rm-dot {
        left: 1.25rem;
    }

    .rm-phase:nth-child(odd) .rm-connector,
    .rm-phase:nth-child(even) .rm-connector {
        left: 1.25rem;
        right: auto;
        width: calc(1.25rem - 10px);
    }
    .rm-phase:nth-child(odd) .rm-connector {
        background: linear-gradient(90deg, transparent, #059669);
    }
    .rm-phase:nth-child(even) .rm-connector {
        background: linear-gradient(90deg, transparent, #059669);
    }

    .rm-hero {
        padding: 4rem 1rem 2rem;
    }

    .rm-card {
        padding: 1.25rem;
    }

    .rm-topbar {
        padding: 0.75rem 1rem;
    }

    .rm-topbar-links {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .rm-hero h1 {
        font-size: 1.6rem;
    }

    .rm-card h3 {
        font-size: 1.05rem;
    }

    .rm-timeline {
        padding: 1rem 0.75rem 4rem;
    }
}
