/* Pixel Creators Academy portal theme.
   Colours come from the branding layer via CSS custom properties set in
   base.html, so rebranding is a configuration change, not a CSS edit. */

:root {
  --jc-primary: #12386b;
  --jc-accent: #0f9d8f;
  --jc-ink: #16202c;
  --jc-muted: #5b6875;
  --jc-line: #dfe4ea;
  --jc-surface: #ffffff;
  --jc-bg: #f4f6f9;
  --jc-danger: #b3261e;
  --jc-warning: #9a6700;
  --jc-success: #1a7f37;
  --jc-radius: 10px;
}

body {
  background: var(--jc-bg);
  color: var(--jc-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.975rem;
}

a { color: var(--jc-primary); }
a:hover { color: var(--jc-accent); }

/* ---------------------------------------------------------------- layout */
.jc-navbar {
  background: var(--jc-primary);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.jc-navbar .navbar-brand,
.jc-navbar .nav-link { color: rgba(255, 255, 255, 0.9); }
.jc-navbar .nav-link:hover,
.jc-navbar .nav-link.active { color: #fff; }
.jc-navbar .nav-link.active { border-bottom: 2px solid var(--jc-accent); }

.jc-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--jc-accent);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 0.6rem;
}

.jc-portal-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  color: #fff;
}

.jc-collector-banner {
  background: #fdf3d8;
  border-bottom: 1px solid #f5e3ae;
  color: #5c3d00;
  padding: 0.6rem 0;
  font-size: 0.92rem;
}
.jc-collector-banner a { color: #5c3d00; font-weight: 650; text-decoration: underline; }
.jc-collector-banner a:hover { color: var(--jc-ink); }

main.jc-main { padding: 1.5rem 0 4rem; }

.jc-page-title { font-size: 1.5rem; font-weight: 650; margin: 0; }
.jc-page-subtitle { color: var(--jc-muted); margin: 0.2rem 0 0; font-size: 0.9rem; }

/* ----------------------------------------------------------------- cards */
.jc-card {
  background: var(--jc-surface);
  border: 1px solid var(--jc-line);
  border-radius: var(--jc-radius);
  padding: 1.1rem 1.25rem;
}
.jc-card + .jc-card { margin-top: 1rem; }
/* A curriculum series: a <details> card that opens to list its weeks. */
.jc-series > summary { cursor: pointer; list-style: none; }
.jc-series > summary::-webkit-details-marker { display: none; }
.jc-series > summary .h6::after { content: " ▸"; color: var(--jc-muted); }
.jc-series[open] > summary .h6::after { content: " ▾"; }
button.jc-badge { cursor: pointer; }
/* A card that is itself a link (via .stretched-link). Controls inside it are
   lifted above the stretched link so they stay clickable. */
.jc-card-link { transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.jc-card-link:hover { border-color: var(--jc-accent); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07); }
.jc-card-link-actions { position: relative; z-index: 2; }
.jc-card-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--jc-muted);
  font-weight: 650;
  margin-bottom: 0.75rem;
}

.jc-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.jc-stat-value { font-size: 1.85rem; font-weight: 680; line-height: 1.1; }
.jc-stat-label { color: var(--jc-muted); font-size: 0.82rem; }

/* --------------------------------------------------------------- badges */
.jc-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.jc-badge-neutral { background: #eef1f5; color: #45505c; border-color: #dde3ea; }
.jc-badge-info    { background: #e6f0fb; color: #10457f; border-color: #cfe0f5; }
.jc-badge-success { background: #e4f5e9; color: var(--jc-success); border-color: #c8e9d2; }
.jc-badge-warning { background: #fdf3d8; color: var(--jc-warning); border-color: #f5e3ae; }
.jc-badge-danger  { background: #fbe6e5; color: var(--jc-danger); border-color: #f3c9c6; }

/* ------------------------------------------------- safeguarding emphasis */
.jc-restriction-alert {
  border: 2px solid var(--jc-danger);
  background: #fdecea;
  border-radius: var(--jc-radius);
  padding: 0.9rem 1rem;
  color: #6d1610;
  font-weight: 600;
}
.jc-restriction-alert .jc-restriction-heading {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  font-weight: 750;
  display: block;
  margin-bottom: 0.3rem;
}
.jc-sensitive-panel {
  border-left: 4px solid var(--jc-warning);
  background: #fffaf0;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--jc-radius) var(--jc-radius) 0;
}

/* ------------------------------------------------------ register (mobile)
   The register is used one-handed on a phone while supervising children, so
   rows are large, actions are immediate, and nothing needs a second page. */
.jc-register-row {
  background: var(--jc-surface);
  border: 1px solid var(--jc-line);
  border-radius: var(--jc-radius);
  padding: 0.85rem 1rem;
  margin-bottom: 0.7rem;
}
.jc-register-row.is-present { border-left: 5px solid var(--jc-success); }
.jc-register-row.is-absent  { border-left: 5px solid var(--jc-muted); opacity: 0.75; }
.jc-register-row.is-collected { border-left: 5px solid var(--jc-primary); background: #f7f9fc; }
.jc-register-row.is-expected { border-left: 5px solid var(--jc-line); }
.jc-register-row.has-restriction { border: 2px solid var(--jc-danger); }

.jc-register-name { font-size: 1.12rem; font-weight: 650; line-height: 1.25; }
.jc-register-meta { color: var(--jc-muted); font-size: 0.82rem; }

.jc-register-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.65rem; }
.jc-register-actions .btn {
  flex: 1 1 auto;
  min-width: 7.5rem;
  min-height: 48px;           /* comfortable touch target */
  font-weight: 650;
  font-size: 0.95rem;
}
.jc-btn-collect {
  background: var(--jc-primary);
  border-color: var(--jc-primary);
  color: #fff;
}
.jc-btn-collect:hover { background: #0d2c56; border-color: #0d2c56; color: #fff; }

@media (min-width: 768px) {
  .jc-register-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
  .jc-register-actions { margin-top: 0; justify-content: flex-end; }
  .jc-register-actions .btn { flex: 0 0 auto; min-width: 6.5rem; }
}

/* ----------------------------------------------------------- data tables */
.jc-table { background: var(--jc-surface); border-radius: var(--jc-radius); overflow: hidden; }
.jc-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jc-muted);
  font-weight: 650;
  border-bottom: 1px solid var(--jc-line);
}
.jc-table td { vertical-align: middle; }
.jc-table-wrap { overflow-x: auto; }

/* -------------------------------------------------------------- utility */
.jc-empty {
  text-align: center;
  color: var(--jc-muted);
  padding: 2.25rem 1rem;
  border: 1px dashed var(--jc-line);
  border-radius: var(--jc-radius);
  background: var(--jc-surface);
}
.jc-muted { color: var(--jc-muted); }
.jc-mono { font-variant-numeric: tabular-nums; }

.jc-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, var(--jc-primary) 0%, #0a1f3d 100%);
}
.jc-auth-card {
  width: 100%;
  max-width: 26rem;
  background: var(--jc-surface);
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.btn-primary {
  background-color: var(--jc-primary);
  border-color: var(--jc-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #0d2c56;
  border-color: #0d2c56;
}

/* Keep keyboard focus obvious for accessibility. */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--jc-accent);
  outline-offset: 2px;
  box-shadow: none;
}

.jc-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 0.6rem 1rem;
  z-index: 1080;
  border-radius: 0 0 var(--jc-radius) 0;
}
.jc-skip-link:focus { left: 0; }

/* ------------------------------------------------ student portal (Code Studio) */
.jc-student .jc-main { font-size: 1.05rem; }
.jc-student-home { max-width: 56rem; margin: 0 auto; }
.jc-student-hello { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.jc-student-lead { font-size: 1.15rem; color: var(--jc-muted); margin-bottom: 1.5rem; }
.jc-student-tile {
  background: var(--jc-surface);
  border: 2px solid var(--jc-line);
  border-radius: 16px;
  padding: 1.5rem;
  min-height: 9rem;
}
.jc-student-tile h2 { font-size: 1.4rem; font-weight: 700; }
.jc-student-tile.is-waiting { border-style: dashed; color: var(--jc-muted); }
.jc-student-button { min-height: 52px; min-width: 10rem; font-weight: 650; }

/* ------------------------------------------------------- coding login cards */
.jc-login-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}
.jc-login-card {
  border: 2px dashed var(--jc-ink);
  border-radius: var(--jc-radius);
  padding: 1rem 1.25rem;
  background: #fff;
  break-inside: avoid;
}
.jc-login-card-name { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.jc-login-card dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--jc-muted);
}
.jc-login-card dd {
  font-size: 1.15rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  margin-bottom: 0.4rem;
  word-break: break-all;
}

@media print {
  .jc-navbar, .jc-no-print { display: none !important; }
  body { background: #fff; }
  .jc-login-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ------------------------------------------------------------ code studio */
.jc-student-wide { max-width: 72rem; }
.jc-student-recent { padding-left: 1.2rem; font-size: 1.1rem; }
.jc-code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}
.jc-code-grid-compact { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem; }
.jc-code-grid-compact .jc-code-card { border-width: 1px; border-radius: 10px; }
.jc-code-card {
  background: var(--jc-surface);
  border: 2px solid var(--jc-line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.jc-code-card-thumb {
  display: block;
  aspect-ratio: 4 / 3;
  background: #eef2f7;
}
.jc-code-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jc-code-card-blank {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #eef2f7, #eef2f7 12px, #e3e8f0 12px, #e3e8f0 24px);
}
.jc-code-card-body { padding: 0.75rem 1rem 1rem; }
.jc-code-card-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.25rem; overflow-wrap: anywhere; }
.jc-code-card-meta { color: var(--jc-muted); font-size: 0.9rem; margin: 0; }
.jc-code-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.jc-code-card-actions form { margin: 0; }
/* The player stage is a fixed 480x360 plus its green flag bar. */
.jc-code-player-wrap { display: flex; justify-content: center; background: #e9eef5; }
.jc-code-player { width: 482px; max-width: 100%; height: 410px; border: 0; display: block; }
.jc-pre-line { white-space: pre-line; }

/* Staff "Delete" on coding projects: a summary button opening a small form. */
.jc-delete-project > summary { list-style: none; }
.jc-delete-project > summary::-webkit-details-marker { display: none; }
.jc-delete-project[open] > summary { margin-bottom: 0; }
.jc-delete-project > form { min-width: 15rem; }

/* Admin viewing the portal as a parent (read-only). */
.jc-view-as-banner {
  background: #7a2e0e;
  color: #fff;
  padding: 0.5rem 0;
  font-size: 0.92rem;
  position: sticky;
  top: 0;
  z-index: 1031;
}
