/* ============================================================
   ROADMAP.CSS  –  Styles for all roadmap views
   (grades, sections, levels, steps)
   ============================================================ */

/* ── Page wrapper ── */
.roadmap-wrapper {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Header ── */
.main-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 1rem 0 2rem;
  margin-bottom: 1rem;
}
.main-logo {
  height: 120px;
  object-fit: contain;
}

/* User info (top-right) */
.user-controls { position: absolute; top: 1rem; right: 0; }
.user-info      { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.avatar-icon    { font-size: 1.5rem; color: white; opacity: 0.9; }
.user-details   { display: flex; flex-direction: column; align-items: center; }
.user-name      { color: white; font-weight: 700; font-size: 1.1rem; }
.logout-link {
  background: none; border: none;
  color: white; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; opacity: 0.8; padding: 0;
}
.logout-link:hover { opacity: 1; text-decoration: underline; }

/* Unsaved indicator (top-left) */
.global-actions { position: absolute; top: 1rem; left: 0; }
.unsaved-status {
  display: flex; align-items: center; gap: 0.5rem;
  background-color: rgba(234,179,8,0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  border: 1px solid rgba(234,179,8,0.3);
}
.unsaved-dot { color: #eab308; font-size: 1.2rem; line-height: 1; }
.save-button {
  background: none; border: none;
  color: #eab308; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; padding: 0;
}
.save-button:hover    { color: white; }
.save-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Error banner */
.error-banner {
  background-color: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  color: #f87171;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  text-align: center;
}

/* ── Shared back button ── */
.back-btn {
  background: none; border: none;
  color: var(--color-text-secondary);
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: color 0.2s, background-color 0.2s;
}
.back-btn:hover { color: var(--color-primary); background-color: var(--white-10); }

/* Shared view header */
.view-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.view-header h2 {
  margin: 0;
  color: var(--color-text-primary);
  font-size: 1.5rem;
  font-family: 'Oswald', inherit;
}

/* ── GRADES VIEW ── */
.grade-container { display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem; }

.grade-card {
  background-color: #7b815f;
  border-radius: 1.5rem;
  padding: 1.5rem 2rem;
  display: flex; align-items: center; gap: 2rem;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  user-select: none;
}
.grade-card:hover { transform: scale(1.02); filter: brightness(1.1); }

/* SVG progress ring */
.grade-icon-container {
  position: relative;
  width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.progress-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-90deg);
  width: 100%; height: 100%;
}
.progress-ring__background-track { opacity: 0.3; }
.progress-ring__circle            { transition: stroke-dashoffset 0.5s ease; stroke-linecap: round; }

.inner-circle {
  width: 76px; height: 76px;
  background-color: #1a261f;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.grade-main-icon  { font-size: 1.75rem; color: var(--color-primary); margin-bottom: 2px; }
.inner-percentage { color: white; font-size: 0.8rem; font-weight: 500; }

.grade-info  { flex: 1; }
.grade-title {
  color: white; margin: 0;
  font-size: 1.5rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px;
  font-family: 'Oswald', inherit;
}
.grade-arrow {
  color: white; font-size: 2rem; opacity: 0.8;
  transition: all 0.2s;
}
.grade-card:hover .grade-arrow { opacity: 1; transform: translateX(5px); }

/* ── SECTIONS VIEW ── */
.section-container { display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem; }
.sections-grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; }

.section-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.section-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-color: var(--color-primary);
}
.section-icon {
  width: 40px; height: 40px;
  background-color: var(--white-10);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary); font-size: 1.25rem; flex-shrink: 0;
}
.section-info h3 { margin: 0; color: var(--color-text-primary); font-size: 1.1rem; }
.section-info p  { margin: 0.25rem 0 0; color: var(--color-text-secondary); font-size: 0.875rem; }
.section-arrow   { margin-left: auto; color: var(--color-text-secondary); }

/* ── LEVELS VIEW ── */
.level-select-container { display: flex; flex-direction: column; gap: 1.5rem; padding: 1rem; }
.levels-grid            { display: flex; flex-direction: column; gap: 1rem; }

.level-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-align: left; width: 100%; color: inherit; font-family: inherit;
}
.level-card:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-color: var(--color-primary);
}
.level-card.disabled { opacity: 0.5; cursor: not-allowed; background-color: rgba(0,0,0,0.2); }

.level-icon {
  width: 50px; height: 50px;
  background-color: var(--white-10);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: bold;
  color: var(--color-primary); font-family: serif; flex-shrink: 0;
}
.level-info h3 { margin: 0; color: var(--color-text-primary); font-size: 1.2rem; }
.level-info p  { margin: 0.25rem 0 0; color: var(--color-text-secondary); font-size: 0.875rem; }
.level-arrow, .lock-icon { margin-left: auto; color: var(--color-text-secondary); }

/* ── STEPS VIEW ── */
.steps-view-container { animation: fadeIn 0.3s ease; }
.steps-header         { margin-bottom: 1rem; }

.level-container { margin-bottom: 2rem; margin-top: 3rem; }
.level-header    { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.level-title     { font-size: 1.5rem; font-weight: 700; color: var(--white); font-family: 'Oswald', inherit; }

.stats-pill {
  background-color: var(--aikido-red);
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem; font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
  color: var(--white);
}

/* ── Step Card ── */
.step-container {
  position: relative;
  margin-bottom: 1rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
}
.step-container.locked { opacity: 0.5; pointer-events: none; }

.step-main-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem;
  background-color: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  gap: 1rem;
}

/* Checkboxes */
.checkboxes-col { display: flex; gap: 0.5rem; }
.check-group    { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.check-label    { font-size: 0.65rem; color: var(--white-50); text-transform: uppercase; }
.check-btn {
  width: 2rem; height: 2rem;
  border-radius: 4px;
  border: 1px solid var(--white-20);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: transparent; font-size: 1rem;
}
.check-btn-active-white { background-color: var(--white);  color: var(--black); border-color: var(--white);  }
.check-btn-active-red   { background-color: #22c55e;        color: var(--white); border-color: #22c55e;       }

/* Step code */
.step-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.step-code   {
  font-size: 1.3rem; font-weight: 700;
  color: var(--white-80); margin: 0;
  letter-spacing: 0.05em;
  font-family: 'Oswald', inherit;
}

/* Details button */
.step-right  { flex-shrink: 0; }
.details-btn {
  background-color: var(--white-10);
  border: 1px solid var(--white-20);
  color: var(--white-80);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s; font-family: inherit;
}
.details-btn:hover { background-color: var(--white-20); color: var(--white); }

/* Details box */
.details-box {
  background-color: var(--white); color: var(--black);
  padding: 1rem; margin-top: 0.5rem;
  border-radius: var(--radius-md);
  animation: slideDown 0.2s ease-out;
}
.details-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 0.5rem;
}
.details-header h3 {
  margin: 0; font-size: 1.1rem; color: #1a2f23;
  text-align: right; width: 100%; direction: rtl;
}
.close-details { background: none; border: none; color: #666; cursor: pointer; font-size: 1rem; flex-shrink: 0; }
.details-text  {
  margin: 0; font-size: 0.9rem; line-height: 1.7;
  color: #4a4a4a; text-align: right; direction: rtl; white-space: pre-line;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .grade-container    { gap: 1rem; padding: 0.5rem; }
  .grade-card         { padding: 1rem 1.25rem; gap: 1.25rem; border-radius: 1rem; }
  .grade-icon-container { width: 70px; height: 70px; }
  .inner-circle       { width: 52px; height: 52px; }
  .grade-main-icon    { font-size: 1.2rem; }
  .inner-percentage   { font-size: 0.65rem; }
  .grade-title        { font-size: 1.1rem; letter-spacing: 1px; }
  .grade-arrow        { font-size: 1.5rem; }
  .sections-grid      { grid-template-columns: 1fr; }
}
