/* grading-page.css
 * Styles for the SCA grading report page.
 * Served from Vercel alongside grading-page.js
 * ═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   §1 — Page wrapper: prevent flash
   ═══════════════════════════════════════ */
.gp-page {
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 28px 34px;
}
.gp-page.gp-ready {
  opacity: 1;
}
/* Hide status text once grading results are shown */
.gp-page.gp-ready .gp-status:not(:empty) {
  display: none;
}

/* ═══════════════════════════════════════
   §1b — Content shell (constrained width)
   ═══════════════════════════════════════ */
.gp-shell {
  max-width: 900px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════
   §2 — Logo + meta
   ═══════════════════════════════════════ */
.gp-logo-row {
  margin-bottom: 24px;
}
.gp-logo {
  display: block;
  height: 54px;
  width: auto;
}
.gp-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  flex-wrap: wrap;
}
.gp-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
}
.gp-badge-mode {
  background: #e2e8f0;
  color: #253551;
}
.gp-badge-mode.is-premium {
  background: #253551;
  color: #fff;
}
.gp-badge-case {
  background: #fff;
  color: #253551;
  border: 1.5px solid #d6dde9;
}
.gp-title {
  font-size: 26px;
  font-weight: 800;
  color: #253551;
  margin: 0 0 6px;
  line-height: 1.2;
}
.gp-status {
  font-size: 16px;
  color: #64748b;
  min-height: 20px;
  margin-bottom: 14px;
}
.gp-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 28px 0 24px;
}
/* Hide divider when score header is hidden */
#scoreHeader[style*="display: none"] + .gp-divider,
#scoreHeader:empty + .gp-divider {
  display: none;
}

/* ═══════════════════════════════════════
   §3 — Overall result card
   ═══════════════════════════════════════ */
.gp-overall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 26px;
  border-radius: 16px;
  margin-bottom: 16px;
  border: 1.5px solid transparent;
}
.gp-overall.gp-band-pass  { background: rgba(22,163,74,0.06); border-color: rgba(22,163,74,0.18); }
.gp-overall.gp-band-bp    { background: rgba(101,163,13,0.06); border-color: rgba(101,163,13,0.18); }
.gp-overall.gp-band-bf    { background: rgba(234,88,12,0.06); border-color: rgba(234,88,12,0.18); }
.gp-overall.gp-band-fail  { background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.18); }

.gp-overall-label {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.gp-overall-band {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
}
.gp-band-pass .gp-overall-band { color: #16a34a; }
.gp-band-bp   .gp-overall-band { color: #65a30d; }
.gp-band-bf   .gp-overall-band { color: #ea580c; }
.gp-band-fail .gp-overall-band { color: #dc2626; }

/* Ring (circular percentage) */
.gp-ring {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
}
.gp-ring svg {
  width: 100%;
  height: 100%;
}
.gp-ring-fill {
  transition: stroke-dashoffset 0.8s ease;
}
.gp-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #253551;
}

/* ═══════════════════════════════════════
   §4 — Domain cards (DG / CM / RtO)
   ═══════════════════════════════════════ */
.gp-domains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 6px;
}
.gp-dom {
  padding: 16px 18px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
}
.gp-dom-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2px;
}
.gp-dom-label {
  font-size: 14px;
  font-weight: 700;
  color: #253551;
}
.gp-dom-pct {
  font-size: 20px;
  font-weight: 800;
}
.gp-band-pass .gp-dom-pct { color: #16a34a; }
.gp-band-bp   .gp-dom-pct { color: #65a30d; }
.gp-band-bf   .gp-dom-pct { color: #ea580c; }
.gp-band-fail .gp-dom-pct { color: #dc2626; }

.gp-dom-band {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.gp-band-pass .gp-dom-band { color: #16a34a; }
.gp-band-bp   .gp-dom-band { color: #65a30d; }
.gp-band-bf   .gp-dom-band { color: #ea580c; }
.gp-band-fail .gp-dom-band { color: #dc2626; }

.gp-bar-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
}
.gp-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ═══════════════════════════════════════
   §5 — Premium skill scores (score header)
   ═══════════════════════════════════════ */
.gp-premium-row {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #253551;
  color: #fff;
}
.gp-premium-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gp-premium-label i {
  color: #fbbf24;
  font-size: 16px;
}
.gp-skills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gp-skill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
}
.gp-skill-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}
.gp-skill-info {
  flex: 1;
  min-width: 0;
}
.gp-skill-name {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.gp-skill-dots {
  display: flex;
  gap: 4px;
}
.gp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
}
.gp-dot.gp-dot-on {
  /* color set inline by JS */
}
.gp-skill-num {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.gp-skill-of {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════
   §6 — Markdown output styling
   ═══════════════════════════════════════ */
.gp-output {
  font-size: 16px;
  line-height: 1.7;
  color: #3b4f6b;
}
.gp-output h2 {
  font-size: 20px;
  font-weight: 800;
  color: #253551;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e2e8f0;
}

/* Section cards for each H2 block */
.gp-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}
.gp-section h2 {
  font-size: 20px;
  font-weight: 800;
  color: #253551;
  background: #d6dde9;
  padding: 14px 22px;
  margin: 0;
  border-bottom: none;
}
/* Content area below the H2 header bar */
.gp-section p,
.gp-section blockquote,
.gp-section h3 {
  padding-left: 22px;
  padding-right: 22px;
}
.gp-section ul,
.gp-section ol {
  margin-left: 22px;
  margin-right: 22px;
}
.gp-section > *:last-child {
  padding-bottom: 18px;
}

.gp-output h3 {
  font-size: 16px;
  font-weight: 700;
  color: #253551;
  margin: 14px 0 4px;
}
.gp-output p {
  margin: 0.6em 0;
}
.gp-output ul,
.gp-output ol {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-left: 1.4em;
}
.gp-output li {
  margin: 0.4em 0;
  line-height: 1.65;
}
.gp-output li p {
  margin: 0.3em 0;
}
.gp-output strong {
  color: #253551;
  font-weight: 700;
}
.gp-output em {
  color: #4a6080;
}

/* Blockquotes (clinician quotes etc) */
.gp-output blockquote {
  border-left: 3px solid #d6dde9;
  margin: 0.8em 0;
  padding: 8px 16px;
  background: #f1f5f9;
  border-radius: 0 8px 8px 0;
  color: #3b4f6b;
  font-size: 16px;
}

/* ═══════════════════════════════════════
   §7 — Premium card (in markdown body)
   ═══════════════════════════════════════ */
.premium-card {
  margin-top: 20px;
  border-radius: 16px;
  border: 1.5px solid #d6dde9;
  overflow: hidden;
}

/* Dark header bar — compact, just the title */
.premium-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  background: #253551;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}
.premium-header i {
  color: #fbbf24;
  font-size: 18px;
}

/* Light body area — all the actual reading happens here */
.premium-body {
  padding: 24px 22px 16px;
  background: #f8fafc;
}

/* Intro paragraph */
.premium-intro {
  font-size: 16px;
  line-height: 1.7;
  color: #3b4f6b;
  margin: 0 0 20px;
}

/* Each numbered skill section */
.premium-skill {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}
.premium-skill:last-child {
  margin-bottom: 8px;
}

/* Skill title bar (matches premium-header style but lighter) */
.premium-skill-head {
  font-size: 18px;
  font-weight: 800;
  color: #253551;
  padding: 14px 22px;
  background: #d6dde9;
  line-height: 1.4;
}

/* Main coaching paragraph — plain text, no box */
.premium-skill-text {
  font-size: 16px;
  line-height: 1.75;
  color: #3b4f6b;
  margin: 0;
  padding: 16px 22px 12px;
}

/* Content card — everything after the first coaching paragraph */
.premium-content {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  margin: 0;
  padding: 18px 22px;
  font-size: 16px;
  line-height: 1.75;
  color: #3b4f6b;
}
.premium-content p {
  margin: 0.5em 0;
}
.premium-content strong {
  color: #253551;
}
.premium-content ul {
  padding-left: 1.4em;
  margin: 0.5em 0;
}
.premium-content li {
  margin: 0.5em 0;
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   §8 — Mobile responsive
   ═══════════════════════════════════════ */
@media (max-width: 640px) {
  .gp-page {
    padding: 20px 18px;
  }
  .gp-title {
    font-size: 22px;
  }
  .gp-domains {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .gp-skills {
    grid-template-columns: 1fr;
  }
  .gp-overall {
    padding: 18px 20px;
  }
  .gp-overall-band {
    font-size: 22px;
  }
  .gp-ring {
    width: 64px;
    height: 64px;
  }
  .gp-ring-num {
    font-size: 16px;
  }
  .gp-section {
    padding: 16px 16px;
  }
  /* Premium cue cards stack on mobile */
  .premium-cue-row {
    flex-direction: column;
    gap: 2px;
  }
  .premium-cue-label {
    min-width: unset;
  }
  .premium-skill {
    padding: 16px;
  }
  .premium-body {
    padding: 18px 16px 12px;
  }
}

@media (max-width: 420px) {
  .gp-skill {
    padding: 10px 12px;
    gap: 8px;
  }
  .gp-skill-num {
    font-size: 18px;
  }
}
.gp-badge-mode {
  background: #e2e8f0;
  color: #253551;
}
.gp-badge-mode.is-premium {
  background: #253551;
  color: #fff;
}
.gp-badge-mode.is-marking {
  background: rgba(27, 107, 74, 0.08);
  color: #1b6b4a;
  border: 0.5px solid rgba(27, 107, 74, 0.2);
}
