/* GuideMate Brain — "Analyze Me" dashboard.
 * Follows the site's control-panel-left / info-right convention: the shell,
 * navy control panel (lc-control), and cream reading pane (lc-display) all come
 * from learning-center.css. The pg-* donut / buckets / chips / heatmap / mistakes
 * classes come from there too. This file adds only the subject-scope pieces:
 * the single card wrapper, the IB-skill ladder, chapter rows, the mastery-band
 * legend, and the clickable-donut concept breakdown. */

/* The single dashboard card — inherits the pg-* type/colour that the LC wrapper
   normally sets on .lc-brain-panel--pg. */
.brain-content {
    max-width: 900px;
    margin: 0 auto;          /* stay centered in the pane */
    color: #1B3A4B;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Focus mode — collapsed control panel: keep centered, breathe wider */
.lc-shell.is-collapsed .brain-content { max-width: 1080px; }

/* Loading (inside the cream display) */
.brain-loading {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Hanken Grotesk', system-ui, sans-serif;
    font-size: 13px; color: #A69D89;
    padding-bottom: 18px;
}
.brain-spinner {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(27, 58, 75, 0.14);
    border-top-color: #B08A3A;
    animation: brain-spin 0.8s linear infinite;
}
@keyframes brain-spin { to { transform: rotate(360deg); } }

/* ── Analyze Me sizing overrides (scoped; LC progress screen unaffected) ── */
.brain-content .pg-title { font-size: 30px; }
.brain-content .pg-sub { font-size: 15px; }
.brain-content .pg-stat-num { font-size: 27px; }
.brain-content .pg-stat-label { font-size: 12px; }
.brain-content .pg-step-num { font-size: 15px; }
.brain-content .pg-step-title { font-size: 22px; }
.brain-content .pg-step-hint { font-size: 15px; }
.brain-content .pg-bd-toggle { font-size: 17px; padding: 8px 2px; }
.brain-content .pg-bd-caret { font-size: 15px; }

/* ── STEP 02 signature: IB-skill radar (spider) chart ── */
.pg-radar { max-width: 740px; margin: 26px auto 8px; }
.pg-radar-svg { width: 100%; height: auto; display: block; overflow: visible; }
.pg-radar-name { font-family: 'Space Grotesk'; font-size: 15px; font-weight: 600; fill: #1B3A4B; }
.pg-radar-pct { font-family: 'Space Grotesk'; font-size: 20px; font-weight: 600; }

/* ── Insight line: strongest + focus-next skill ── */
.pg-insight { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.pg-insight-item { display: flex; align-items: baseline; gap: 9px; flex: 1; min-width: 210px; padding: 10px 14px; border-radius: 8px; }
.pg-insight-item--strong { background: rgba(62, 142, 90, 0.09); border-left: 2px solid #3E8E5A; }
.pg-insight-item--focus { background: rgba(206, 107, 90, 0.09); border-left: 2px solid #CE6B5A; }
.pg-insight-dot { width: 8px; height: 8px; border-radius: 2px; align-self: center; flex: none; }
.pg-insight-item--strong .pg-insight-dot { background: #3E8E5A; }
.pg-insight-item--focus .pg-insight-dot { background: #CE6B5A; }
.pg-insight-label { font-family: 'Space Grotesk'; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.pg-insight-item--strong .pg-insight-label { color: #3E8E5A; }
.pg-insight-item--focus .pg-insight-label { color: #CE6B5A; }
.pg-insight-skill { font-family: 'Space Grotesk'; font-size: 15px; font-weight: 600; color: #1B3A4B; }
.pg-insight-val { font-family: 'Space Grotesk'; font-size: 13.5px; font-weight: 600; color: #514B3B; margin-left: auto; }

/* ── Mastery-band legend (explains the donut, incl. Provisional) ── */
.pg-legend { margin-top: 22px; display: grid; gap: 11px; }
.pg-legend-lead { font-size: 12.5px; color: #A69D89; margin: 0 0 2px; }
.pg-legend-row { display: flex; align-items: baseline; gap: 11px; }
.pg-legend-dot { width: 9px; height: 9px; border-radius: 2px; flex: none; align-self: center; }
.pg-legend-name { font-family: 'Space Grotesk'; font-size: 13px; font-weight: 600; color: #1B3A4B; min-width: 104px; flex: none; }
.pg-legend-desc { font-size: 12.5px; line-height: 1.45; color: #948C79; }

/* ── Clickable-donut concept breakdown ── */
.pg-donut--clickable { cursor: pointer; }
.pg-bd-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    margin-top: 22px;
    background: transparent; border: none; padding: 4px 2px; cursor: pointer;
    font-family: 'Hanken Grotesk'; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: #B08A3A;
}
.pg-bd-toggle:hover { color: #8A6A22; }
.pg-bd-caret { font-family: 'Space Grotesk'; font-size: 12px; transition: transform 0.2s; }
.pg-bd-toggle[aria-expanded="true"] .pg-bd-caret { transform: rotate(180deg); }
.pg-bd { margin-top: 18px; }
.pg-bd-hover { min-height: 24px; margin-bottom: 16px; display: flex; align-items: center; }
.pg-bd-idle { font-size: 13px; color: #A69D89; }
.pg-bd-group { margin-top: 26px; }
.pg-bd-group:first-of-type { margin-top: 0; }
.pg-bd-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pg-bd-group-name { font-family: 'Space Grotesk'; font-size: 14px; font-weight: 600; color: #1B3A4B; }
.pg-bd-group-meta { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #A69D89; }
.pg-bd-empty { font-size: 13px; color: #A69D89; margin: 4px 0 0; }

/* ── STEP 03: chapter (or textbook) rows ── */
.pg-chapters { margin-top: 20px; display: flex; flex-direction: column; }
.pg-chapter {
    display: flex; align-items: center; gap: 16px;
    width: 100%; text-align: left;
    padding: 15px 12px;
    background: transparent; border: none; border-bottom: 1px solid rgba(27, 58, 75, 0.07);
    cursor: pointer; font-family: inherit;
    transition: background 0.18s, padding-left 0.18s;
}
.pg-chapter:last-child { border-bottom: none; }
.pg-chapter:hover { background: rgba(27, 58, 75, 0.035); padding-left: 16px; }
.pg-chapter:focus-visible { outline: 2px solid #B08A3A; outline-offset: -2px; border-radius: 6px; }
.pg-chapter--static, .pg-chapter--static:hover { cursor: default; background: transparent; padding-left: 12px; }
.pg-chapter-idx { font-family: 'Space Grotesk'; font-size: 15px; font-weight: 600; color: #B08A3A; min-width: 28px; flex: none; }
.pg-chapter-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pg-chapter-name { font-size: 15px; font-weight: 600; color: #1B3A4B; line-height: 1.35; }
.pg-chapter-meta { font-size: 12.5px; color: #A69D89; }
.pg-chapter-arrow { font-family: 'Space Grotesk'; font-size: 16px; color: #B08A3A; flex: none; opacity: 0; transform: translateX(-4px); transition: opacity 0.18s, transform 0.18s; }
.pg-chapter:hover .pg-chapter-arrow, .pg-chapter:focus-visible .pg-chapter-arrow { opacity: 1; transform: translateX(0); }

/* ── Back link (chapter drill-down → subject) ── */
.pg-back {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent; border: none; padding: 0 0 20px;
    font-family: 'Hanken Grotesk'; font-size: 13px; font-weight: 600; letter-spacing: 0.01em; color: #B08A3A; cursor: pointer;
    transition: color 0.18s;
}
.pg-back:hover { color: #8A6A22; }
.pg-back-arrow { font-family: 'Space Grotesk'; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
    .pg-chapter, .pg-chapter-arrow, .pg-bd-caret { transition: none; }
    .brain-spinner { animation-duration: 1.6s; }
}
