/* apps/student/static/student/student.css */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&family=Montserrat:wght@400;600;700&display=swap');
@import url('tokens.css');

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  line-height: 1.5;
}

/* ── Header ──────────────────────────────────────────────── */
.s-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.s-header-brand {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--teal);
  letter-spacing: 0.01em;
  text-decoration: none;
}
.s-header-settings {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
}
.s-header-settings:hover { text-decoration: underline; }
.s-header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}
.s-header-signout {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: #e74c3c;
  text-decoration: none;
  cursor: pointer;
}
.s-header-signout:hover { text-decoration: underline; }

/* ── Main ────────────────────────────────────────────────── */
.s-main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

/* ── Login ───────────────────────────────────────────────── */
.s-login-wrap { max-width: 360px; margin: 48px auto; }
.s-login-title {
  font-family: var(--font-ui);
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--teal);
}

/* ── Form ────────────────────────────────────────────────── */
.s-form { display: flex; flex-direction: column; gap: 8px; }


.s-form-error {
  background: #fde8e8;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--danger);
}

/* ── Buttons ─────────────────────────────────────────────── */




/* ── Back link ───────────────────────────────────────────── */
.s-back {
  color: var(--teal);
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 16px;
  font-family: var(--font-body);
  transition: opacity 150ms ease;
}
.s-back:hover { opacity: 0.75; text-decoration: none; }

/* ── Resume card ─────────────────────────────────────────── */
.s-resume-card {
  background: var(--teal);
  color: white;
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  margin-bottom: 24px;
  text-decoration: none;
  display: block;
  transition: background 150ms ease;
}
.s-resume-card:hover { background: var(--teal-dark); }
.s-resume-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.s-resume-title { font-family: var(--font-ui); font-size: 1.4rem; font-weight: 700; }
.s-resume-progress { background: rgba(255,255,255,0.28); height: 4px; border-radius: 2px; margin-top: 12px; }
.s-resume-progress-bar { background: white; height: 4px; border-radius: 2px; transition: width 400ms ease-out; }
.s-resume-meta { font-size: 0.75rem; opacity: 0.8; margin-top: 4px; }

/* ── Section label ───────────────────────────────────────── */
.s-section-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── Unit cards ──────────────────────────────────────────── */
.s-unit-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  text-decoration: none;
  display: block;
  color: inherit;
  background: var(--surface-2);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.s-unit-card.active { border-color: var(--teal-mid); }
.s-unit-card.active:hover { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,126,148,0.1); }
.s-unit-card.locked { opacity: 0.45; pointer-events: none; }
.s-unit-card-row { display: flex; justify-content: space-between; align-items: center; }
.s-unit-title { font-family: var(--font-ui); font-weight: 400; font-size: 0.95rem; }
.s-unit-pct { font-size: 0.75rem; color: var(--teal); font-weight: 600; }
.s-progress-bar-track { background: var(--border); height: 4px; border-radius: 2px; margin-top: 8px; }
.s-progress-bar-fill { background: var(--teal); height: 4px; border-radius: 2px; transition: width 400ms ease-out; }

/* ── Skill rows ──────────────────────────────────────────── */
.s-skill-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
}
.s-skill-row.mastered { border-color: #a3cfbb; background: var(--success-pale); }
.s-skill-row.in-progress { border-color: #ffe082; background: var(--warning-pale); }

.s-skill-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.s-skill-dot.mastered { background: var(--success); color: white; }
.s-skill-dot.in-progress { background: #f59e0b; color: white; }
.s-skill-dot.not-started { background: var(--border); color: var(--text-muted); }

.s-skill-info { min-width: 150px; flex: 1; }
.s-skill-name { font-family: var(--font-ui); font-weight: 400; font-size: 0.95rem; margin-bottom: 2px; }
.s-skill-level { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.s-skill-level.mastered { color: var(--success); }
.s-skill-level.in-progress { color: var(--warning); }
.s-skill-level.not-started { color: var(--text-muted); }

.s-skill-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
@media (min-width: 500px) {
  .s-skill-actions { width: auto; margin-top: 0; border-top: none; padding-top: 0; justify-content: flex-end; }
}

/* ── Player ──────────────────────────────────────────────── */
.s-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.s-player-pos { font-size: 0.75rem; color: var(--text-muted); font-family: var(--font-body); }

.s-player-instruction {
  background: var(--teal-pale);
  border: 1px solid var(--teal-mid);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: #1a4a56;
}

.s-player-dots { display: flex; gap: 4px; justify-content: center; padding: 8px 0; }
.s-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.s-dot.done { background: var(--success); }
.s-dot.current { background: var(--teal); }

@media (max-width: 600px) {
  .s-main { padding: 16px 12px; }
}

/* ── Course panel next-up row and link overrides ── */

/* Panel is now a <div> — suppress link hover lift from inline styles. */
.s-course-panel {
  cursor: default;
}
.s-course-panel:hover {
  box-shadow: none !important;
  transform: none !important;
}

/* "View course →" footer link. */
.s-course-panel-cta {
  text-decoration: none;
}
.s-course-panel-cta:hover {
  text-decoration: underline;
}

/* Arrow inside the next-up row. */
.s-course-next-arrow {
  color: var(--teal);
  font-weight: 600;
  flex-shrink: 0;
}

/* Join success banner — "Start: <name> →" link. */
.s-join-banner-link {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  margin-left: 8px;
  white-space: nowrap;
}
.s-join-banner-link:hover {
  text-decoration: underline;
}

/* ── Top nav + breadcrumb (P1.8) ── */
.s-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 10px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.s-nav-brand { font-family: var(--font-ui); font-weight: 700; font-size: 1.05rem; color: var(--teal); text-decoration: none; }
.s-nav-links { display: flex; gap: 12px; }
.s-nav-link { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
.s-nav-link.active { color: var(--teal); border-bottom-color: var(--teal); }
.s-nav-link:hover { color: var(--teal); }
.s-nav-auth { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.s-nav-settings { font-size: 0.8rem; color: var(--text-muted); text-decoration: none; }
.s-nav-signout { background: none; border: 0; padding: 0; font: inherit; font-size: 0.8rem; color: #e74c3c; cursor: pointer; }
.s-breadcrumb { padding: 8px 20px; font-size: 0.78rem; color: var(--text-muted); max-width: 1200px; margin: 0 auto; }
.s-breadcrumb a { color: var(--teal); text-decoration: none; }
.s-breadcrumb a:hover { text-decoration: underline; }
.s-breadcrumb-sep { margin: 0 6px; }
.s-breadcrumb-current { color: var(--text); }

/* ── Shared components (P4.2 extraction, deduped) ─────────── */
/* These reusable classes were duplicated inline across several templates;
   the most complete definition is kept here. They do not conflict with
   page-specific rules in layout.css, so they may load first. */

/* Due chips — source: curriculum.html inline (most complete) */
.s-due-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-ui);
  background: var(--teal-pale);
  color: var(--teal-dark);
  vertical-align: 1px;
  white-space: nowrap;
}
.s-due-chip.overdue { background: #fdecea; color: var(--danger); }
.s-due-chip.opens { background: var(--warning-pale); color: var(--warning); }

/* Empty state */
.s-empty-state { text-align: center; padding: 48px 16px; }
.s-empty-state h2 { font-family: var(--font-ui); color: var(--text-muted); }

/* Flash messages (django.contrib.messages) */
.s-messages { list-style: none; margin: 0 0 1rem; padding: 0; }
.s-message { padding: 10px 14px; border-radius: 6px; margin-bottom: 6px; font-size: var(--text-sm); }
.s-message-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* My classes — roster management (leave a class) on My Courses */
.s-my-classes { margin: 1.5rem 0; }
.s-my-classes-title { font-family: var(--font-ui); font-size: var(--text-lg); font-weight: 700; margin: 0 0 var(--space-2); }
.s-my-classes-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.s-my-classes-name { font-weight: 600; }
.s-my-classes-teacher { font-size: var(--text-sm); color: var(--text-muted); margin-left: 0.5rem; font-weight: 400; }
.s-leave-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.8rem; color: #e74c3c; cursor: pointer; white-space: nowrap; }
.s-leave-btn:hover { text-decoration: underline; }

/* Page title */
.s-page-title { font-family: var(--font-ui); font-size: 1.3rem; margin: 0 0 16px; }

/* Join-a-class link — source: home.html (styled button variant); my_courses
   had a plain-link duplicate — unified to the styled variant. */
.s-join-link-row { margin-bottom: 1rem; }
.s-join-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--teal) 5%, var(--surface-2, #fff));
  transition: background 150ms ease;
}
.s-join-link:hover {
  background: color-mix(in srgb, var(--teal) 12%, var(--surface-2, #fff));
  text-decoration: none;
}

/* Table */
.s-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.s-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.s-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.s-table tbody tr:nth-child(even) { background: var(--surface); }
