/* ============================================================
   Mathagram.org — Learning Path (Duolingo-style)
   Smooth S-curve winding path with side-by-side nodes
   ============================================================ */

.path-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 0 20px 64px;
  position: relative;
}

/* ─── Row of nodes ─── */
.path-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 6px 0;
  position: relative;
}

/* S-curve: rows shift left/right in a smooth wave */
.path-row:nth-child(4n+1 of .path-row) { justify-content: flex-start; margin-left: 0; margin-right: auto; }
.path-row:nth-child(4n+2 of .path-row) { justify-content: center; margin-left: 30px; }
.path-row:nth-child(4n+3 of .path-row) { justify-content: flex-end; margin-left: auto; margin-right: 0; }
.path-row:nth-child(4n+4 of .path-row) { justify-content: center; margin-left: 30px; }

/* ─── Single node ─── */
.path-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  position: relative;
  z-index: 1;
}

/* ─── Circle node ─── */
.path-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  border: 3px solid transparent;
}

.path-circle:hover { transform: scale(1.1); }

/* ─── Completed ─── */
.path-circle.completed {
  background: #58cc02;
  border-color: #46a302;
  color: #fff;
  box-shadow: 0 4px 0 #46a302;
}
.path-circle.completed::after {
  content: '✓';
  font-size: 1.4rem;
}

/* ─── Current ─── */
.path-circle.current {
  background: #1cb0f6;
  border-color: #1899d6;
  color: #fff;
  box-shadow: 0 4px 0 #1899d6, 0 0 0 6px rgba(28, 176, 246, 0.2);
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ─── Locked ─── */
.path-circle.locked {
  background: #e5e5e5;
  border-color: #cecece;
  color: #afafaf;
  cursor: default;
  box-shadow: 0 4px 0 #cecece;
}
.path-circle.locked:hover { transform: none; }

/* ─── Label ─── */
.path-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #777;
  text-align: center;
  max-width: 76px;
  line-height: 1.25;
  min-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.path-node.completed .path-label { color: #58cc02; }
.path-node.current .path-label { color: #1899d6; font-weight: 700; }
.path-node.locked .path-label { color: #afafaf; }

/* ─── Practice nodes (💪) ─── */
.path-circle.practice {
  background: transparent;
  border: 3px dashed #cecece;
  box-shadow: none;
}
.path-circle.practice.completed {
  border-color: #58cc02;
  background: rgba(88, 204, 2, 0.08);
  color: #58cc02;
  box-shadow: none;
}
.path-circle.practice.completed::after { content: '🎧'; font-size: 1.1rem; }
.path-circle.practice.current {
  border-color: #1cb0f6;
  background: rgba(28, 176, 246, 0.08);
  color: #1cb0f6;
  box-shadow: none;
  animation: none;
}
.path-circle.practice.locked {
  border-color: #e5e5e5;
  box-shadow: none;
}

/* ─── Reading nodes (📖) ─── */
.path-circle.reading {
  border-radius: 14px;
  width: 54px;
  height: 54px;
}
.path-circle.reading.completed {
  background: #ce82ff;
  border-color: #a855f7;
  box-shadow: 0 4px 0 #a855f7;
}
.path-circle.reading.completed::after { content: '📖'; font-size: 1rem; }
.path-circle.reading.current {
  background: #ce82ff;
  border-color: #a855f7;
  box-shadow: 0 4px 0 #a855f7, 0 0 0 6px rgba(168, 85, 247, 0.2);
}
.path-circle.reading.locked {
  background: #e5e5e5;
  border-color: #cecece;
  border-radius: 14px;
  box-shadow: 0 4px 0 #cecece;
}

/* ─── Checkpoint nodes (⭐ / 👑) ─── */
.path-circle.checkpoint {
  width: 68px;
  height: 68px;
  font-size: 1.2rem;
}
.path-circle.checkpoint.locked {
  background: linear-gradient(180deg, #e5e5e5, #d4d4d4);
  border-color: #bebebe;
  box-shadow: 0 5px 0 #bebebe;
}
.path-circle.checkpoint.current {
  background: linear-gradient(180deg, #ffc800, #ff9600);
  border-color: #e68a00;
  box-shadow: 0 5px 0 #e68a00, 0 0 0 6px rgba(255, 200, 0, 0.25);
}
.path-circle.checkpoint.completed {
  background: linear-gradient(180deg, #ffc800, #ff9600);
  border-color: #e68a00;
  box-shadow: 0 5px 0 #e68a00;
}
.path-circle.checkpoint.completed::after { content: '👑'; font-size: 1.2rem; }

/* ─── Unit header ─── */
.path-unit-header {
  text-align: center;
  padding: 28px 16px 14px;
  position: relative;
  z-index: 1;
  margin: 8px 0;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 16px;
  box-shadow: 0 2px 0 #e5e5e5;
}

.path-unit-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  border-radius: 999px;
  margin-bottom: 6px;
}

.path-unit-badge.math { background: #3b82f6; }
.path-unit-badge.science { background: #22c55e; }
.path-unit-badge.data { background: #ef4444; }
.path-unit-badge.logic { background: #f97316; }
.path-unit-badge.language { background: #92400e; }
.path-unit-badge.programming { background: #8b5cf6; }
.path-unit-badge.others { background: #6b7280; }

.path-unit-name {
  font-size: 1rem;
  font-weight: 800;
  color: #3c3c3c;
  line-height: 1.3;
}

/* ─── Stars ─── */
.path-stars {
  font-size: 0.55rem;
  white-space: nowrap;
  margin-top: -2px;
}

/* ─── Progress bar ─── */
.path-progress {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.path-progress-bar {
  flex: 1;
  height: 12px;
  background: #e5e5e5;
  border-radius: 6px;
  overflow: hidden;
}

.path-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #58cc02, #89e219);
  border-radius: 6px;
  transition: width 0.5s ease;
}

.path-progress-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: #3c3c3c;
  white-space: nowrap;
}

/* ─── Connector line between rows ─── */
.path-connector {
  display: flex;
  justify-content: center;
  height: 16px;
  position: relative;
}

.path-connector::after {
  content: '';
  width: 3px;
  height: 100%;
  background: #e5e5e5;
  border-radius: 2px;
}
.path-connector.completed::after { background: #58cc02; }
.path-connector.current::after { background: #1cb0f6; }

/* Shift connectors to match S-curve */
.path-connector:nth-child(4n+1 of .path-connector) { padding-left: 40px; justify-content: flex-start; }
.path-connector:nth-child(4n+2 of .path-connector) { justify-content: center; padding-left: 60px; }
.path-connector:nth-child(4n+3 of .path-connector) { padding-right: 40px; justify-content: flex-end; }
.path-connector:nth-child(4n+4 of .path-connector) { justify-content: center; padding-left: 60px; }

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .path-container { max-width: 340px; padding: 0 12px 48px; }
  .path-circle { width: 48px; height: 48px; font-size: 0.85rem; }
  .path-circle.checkpoint { width: 56px; height: 56px; }
  .path-circle.reading { width: 44px; height: 44px; }
  .path-label { font-size: 0.55rem; max-width: 60px; }
  .path-node { width: 62px; }
  .path-row { gap: 10px; }
}
