/* Courses — only what the main site's stylesheet doesn't already provide.
 *
 * Load AFTER /shared/assets/css/styles.css. Everything general (tokens,
 * .btn/.btn-ghost/.btn-small, .card/.program-card/.program-grid, .section,
 * .eyebrow, inputs, .table-container/.perf-table, header, footer) comes from
 * there — this file must never redefine those.
 *
 * Only genuinely course-specific things live here: video thumbnails, the
 * access badges, the dark player frame, the sign-in gate, and the admin
 * console chrome.
 */

/* ── Page shell ─────────────────────────────────────────────────────────── */
.page-main { min-height: 60vh; }

.page-head { margin-bottom: 2.5rem; }
.page-head h1 { margin-bottom: 0.5rem; }
.page-head p { color: var(--text-soft); max-width: 60ch; }

/* ── Course cards ───────────────────────────────────────────────────────────
   Extends .program-card. That has 2.5rem padding, but a course card needs a
   full-bleed thumbnail, so padding moves inside .course-body. */
.course-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.course-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: #cbd5e1;
  overflow: hidden;
}
.course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.course-duration {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.course-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.course-body h3 { margin: 0; font-size: 1.25rem; }
.course-desc {
  color: var(--text-soft);
  font-size: 0.92rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.course-price {
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: auto;
  color: var(--text);
}
.course-price.is-free { color: #059669; }
.course-price.is-owned { font-size: 0.9rem; font-weight: 500; color: var(--text-soft); }

/* ── Access badges ──────────────────────────────────────────────────────────
   Same shape as .program-card .level (uppercase, tracked) but tinted. */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  align-self: flex-start;
}
.badge-free    { background: #d1fae5; color: #047857; }
.badge-paid    { background: #fff7ed; color: var(--accent-strong); }
.badge-owned   { background: #e2e8f0; color: #0f172a; }
.badge-draft   { background: #f3f4f6; color: #4b5563; }
.badge-live    { background: #d1fae5; color: #047857; }

/* ── Player ─────────────────────────────────────────────────────────────────
   The one deliberately dark element — matches the dark stat cards on the
   homepage rather than sitting the video on white. */
.player-shell {
  background: #0f172a;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  box-shadow: var(--shadow);
}
.player-shell iframe { width: 100%; height: 100%; border: 0; display: block; }

.player-meta { margin-top: 2rem; }
.player-meta h1 { margin-bottom: 0.5rem; }
.player-duration { color: var(--text-soft); font-size: 0.9rem; }
.player-desc {
  margin-top: 1rem;
  color: var(--text-soft);
  white-space: pre-wrap;
  max-width: 70ch;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--accent); }

/* ── Empty / loading / locked states ────────────────────────────────────── */
.state {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.state-icon { font-size: 2.5rem; display: block; margin-bottom: 1rem; }
.state-title { font-weight: 700; font-size: 1.25rem; margin-bottom: 0.5rem; }
.state-msg { color: var(--text-soft); max-width: 46ch; margin: 0 auto 1.25rem; }
.state-msg:last-child { margin-bottom: 0; }

.spinner {
  display: inline-block;
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255, 138, 0, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg { width: 2rem; height: 2rem; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sign-in gate ───────────────────────────────────────────────────────── */
.gate {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}
.gate-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.5rem; }
.gate-msg { color: var(--text-soft); margin-bottom: 1.75rem; }
.gate-actions { display: flex; flex-direction: column; gap: 0.85rem; align-items: center; }
.gate-actions .btn { width: 100%; }
.gate-or {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; color: var(--text-soft);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em;
}
.gate-or::before, .gate-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#google-btn { display: flex; justify-content: center; min-height: 44px; }

/* ── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  display: none;
  font-size: 0.92rem;
}
.alert.show { display: block; }
.alert-error { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.25); color: #b91c1c; }
.alert-ok    { background: #d1fae5; border: 1px solid #a7f3d0; color: #047857; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 1.25rem;
}
.modal-back.show { display: flex; }
.modal {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%; max-width: 760px;
  max-height: 86vh; overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.2rem; font-weight: 700; margin-right: auto; }

/* ── Admin console ──────────────────────────────────────────────────────── */
.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}
.panel-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.5rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field > label { font-weight: 700; font-size: 0.85rem; color: var(--text); }
.field-wide { grid-column: 1 / -1; }
.hint { font-size: 0.8rem; color: var(--text-soft); }
.check { flex-direction: row; align-items: center; gap: 0.6rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check label { font-weight: 500; font-size: 0.95rem; }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem; }
.table-scroll { overflow-x: auto; }

/* Admin's own compact header — it sits behind a password and doesn't need
   the full marketing nav. */
.admin-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.admin-bar .brand { margin-right: auto; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .course-body { padding: 1.35rem; }
  .panel { padding: 1.5rem; }
}
@media (max-width: 480px) {
  .state { padding: 2.5rem 1.25rem; }
  .gate { padding: 1.75rem; }
  .modal { padding: 1.5rem; }
  .course-foot { flex-wrap: wrap; }
}
