/* ==========================================================================
   نمودار تعاملی و اسکرول‌محور مسیر یادگیری هوش مصنوعی (/learn)
   مسیر S-Curve در دسکتاپ + خط مترو درخشان در موبایل (RTL بومی)
   ========================================================================== */

.rmap-wrap {
  position: relative;
  border-radius: 24px;
  padding: clamp(18px, 3vw, 28px);
  background:
    radial-gradient(520px 260px at 88% 8%, rgba(15, 118, 110, .1), transparent 65%),
    radial-gradient(460px 240px at 12% 92%, rgba(217, 119, 6, .09), transparent 65%),
    linear-gradient(180deg, #FFFFFF 0%, #F7FAF9 100%);
  border: 1px solid rgba(15, 118, 110, .2);
  box-shadow: var(--shadow-sm);
}

.rmap-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px dashed rgba(15, 118, 110, .22);
}
.rmap-progress-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: var(--ink);
}
.rmap-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0F766E;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .18);
}
.rmap-bar-mini {
  flex: 1 1 180px;
  max-width: 280px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .12);
  overflow: hidden;
}
.rmap-bar-mini > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0F766E, #14B8A6, #D97706);
  transition: width .4s cubic-bezier(.22, 1, .36, 1);
}

.rmap-canvas {
  position: relative;
  padding: 12px 0;
}

/* مسیر SVG مرکزی در دسکتاپ */
.rmap-spine-svg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 110px;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

.rmap-stations {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
}

/* چیدمان زیگزاگ معماری در دسکتاپ */
.rmap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr);
  align-items: center;
  opacity: .92;
  transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}
.rmap-row.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.rmap-row-main .rmap-card { grid-column: 1; grid-row: 1; }
.rmap-row-main .rmap-orb-col { grid-column: 2; grid-row: 1; }
.rmap-row-alt .rmap-card { grid-column: 3; grid-row: 1; }
.rmap-row-alt .rmap-orb-col { grid-column: 2; grid-row: 1; }

.rmap-orb-col {
  position: relative;
  display: grid;
  place-items: center;
}
.rmap-orb {
  position: relative;
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #FFFFFF;
  background: linear-gradient(135deg, #0F766E, #134E4A);
  color: #FEF3C7;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 0 5px rgba(15, 118, 110, .14), 0 10px 22px rgba(15, 23, 42, .16);
  transition: transform .2s ease, background .25s ease, box-shadow .25s ease;
}
.rmap-orb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 8px rgba(15, 118, 110, .2), 0 12px 24px rgba(15, 23, 42, .2);
}
.rmap-orb-check { display: none; font-size: 1.25rem; }

.rmap-row.is-done .rmap-orb {
  background: linear-gradient(135deg, #D97706, #B45309);
  box-shadow: 0 0 0 6px rgba(217, 119, 6, .2), 0 10px 22px rgba(217, 119, 6, .26);
}
.rmap-row.is-done .rmap-orb-num { display: none; }
.rmap-row.is-done .rmap-orb-check { display: block; }

.rmap-connector {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 2px;
  background: linear-gradient(90deg, rgba(15, 118, 110, .45), rgba(217, 119, 6, .45));
}
.rmap-row-main .rmap-connector { inset-inline-start: -10px; }
.rmap-row-alt .rmap-connector { inset-inline-end: -10px; }

.rmap-card {
  position: relative;
  padding: 18px 20px;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1.5px solid rgba(15, 118, 110, .16);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.rmap-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, .42);
  box-shadow: 0 14px 32px rgba(15, 118, 110, .11);
}
.rmap-row.is-done .rmap-card {
  border-color: rgba(217, 119, 6, .42);
  background: linear-gradient(145deg, #FFFDF7, #FFFFFF);
}

.rmap-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.rmap-level {
  font-size: .74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft, #CCFBF1);
  color: var(--brand-deeper, #115E59);
}
.rmap-time {
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-mute);
}
.rmap-card h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
  color: var(--ink);
}
.rmap-goal {
  font-size: .84rem;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 10px;
}
.rmap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.rmap-chips a {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-soft, #F5F3EE);
  color: var(--brand-deeper, #115E59);
  border: 1px solid rgba(15, 118, 110, .14);
}
.rmap-chips a:hover {
  background: #0F766E;
  color: #FFFFFF;
}
.rmap-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.rmap-done-btn {
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  cursor: pointer;
  transition: all .15s ease;
}
.rmap-done-btn:hover {
  border-color: #0F766E;
  color: #0F766E;
}
.rmap-row.is-done .rmap-done-btn {
  background: rgba(217, 119, 6, .14);
  border-color: rgba(217, 119, 6, .4);
  color: #92400E;
}

/* --- نمای موبایل: خط متروی درخشان در سمت راست (RTL بومی) --- */
@media (max-width: 860px) {
  .rmap-spine-svg {
    left: auto;
    right: 6px;
    width: 44px;
    transform: none;
  }
  .rmap-row,
  .rmap-row-main,
  .rmap-row-alt {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }
  .rmap-row-main .rmap-orb-col,
  .rmap-row-alt .rmap-orb-col {
    grid-column: 1;
    grid-row: 1;
    padding-top: 12px;
  }
  .rmap-row-main .rmap-card,
  .rmap-row-alt .rmap-card {
    grid-column: 2;
    grid-row: 1;
  }
  .rmap-orb {
    width: 44px;
    height: 44px;
    font-size: .92rem;
  }
  .rmap-connector { display: none; }
}
