/* ============================================================
   Quick Math hub — studio-native styling for math/quick-math/index.jsp.
   Replaces exams.css: supplies the structural + utility classes the hub
   used to borrow from exams.css, re-themed with the math-studio --ms-*
   tokens. (The filter / tag / difficulty UI is styled by the hub's own
   inline <style>; the topic cards are generated by its inline JS.)
   Scoped under .ms-workspace so nothing leaks into the studio chrome.
   ============================================================ */

/* ---- Hero (studio-native — no dark band, left-aligned, serif title) ---- */
.ms-workspace .hero {
    background: transparent;
    padding: 0.25rem 0 1rem;
    text-align: left;
    color: var(--ms-ink);
}
.ms-workspace .hero-title {
    margin: 0 0 0.5rem;
    font-family: var(--ms-font-serif, 'Instrument Serif', Georgia, serif);
    font-size: clamp(1.7rem, 3.2vw, 2.3rem);
    font-weight: 800;
    line-height: 1.12;
    color: var(--ms-ink);
}
.ms-workspace .hero-subtitle {
    margin: 0;
    max-width: 780px;
    font-size: 1.02rem;
    line-height: 1.55;
    color: var(--ms-ink-soft);
    opacity: 1;
}

/* ---- Sections + grid ---- */
.ms-workspace .page-section { padding: 1.1rem 0; }
.ms-workspace .section-title {
    margin: 0 0 0.85rem;
    font-family: var(--ms-font-serif, 'Instrument Serif', Georgia, serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ms-ink);
}
.ms-workspace .grid-3 { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }

/* ---- Topic cards ---- */
.ms-workspace .card-clickable { cursor: pointer; text-decoration: none; display: block; color: inherit; }
.ms-workspace .card-clickable:hover {
    border-color: var(--ms-accent);
    transform: translateY(-2px);
    box-shadow: var(--ms-shadow-lg, 0 8px 22px rgba(28, 25, 23, 0.12));
}
.ms-workspace .set-card { display: flex; flex-direction: column; gap: 0.7rem; height: 100%; }
.ms-workspace .set-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.ms-workspace .set-card-title { font-size: 1.02rem; font-weight: 700; line-height: 1.3; color: var(--ms-ink); }
/* layout only — per-difficulty colours come from the inline .difficulty-* rules */
.ms-workspace .set-card-badge {
    flex-shrink: 0;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 0.18rem 0.5rem; border-radius: 999px; white-space: nowrap;
}
.ms-workspace .set-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; font-size: 0.8rem; color: var(--ms-muted); }
.ms-workspace .set-card-meta-item { display: flex; align-items: center; gap: 0.25rem; }

/* ---- Loading spinner (was Bootstrap .spinner-border) ---- */
.ms-workspace .spinner-border {
    display: inline-block; width: 2rem; height: 2rem;
    border: 3px solid var(--ms-line-strong); border-top-color: var(--ms-accent);
    border-radius: 50%; animation: qm-hub-spin 0.7s linear infinite;
}
@keyframes qm-hub-spin { to { transform: rotate(360deg); } }

/* ---- Utility classes exams.css used to provide ---- */
.ms-workspace .text-lg { font-size: 1.05rem; }
.ms-workspace .text-sm { font-size: 0.85rem; }
.ms-workspace .text-center { text-align: center; }
.ms-workspace .text-primary { color: var(--ms-ink); }
.ms-workspace .text-secondary { color: var(--ms-ink-soft); }
.ms-workspace .text-muted { color: var(--ms-muted); }
.ms-workspace .text-accent { color: var(--ms-accent); }
.ms-workspace .mt-2 { margin-top: 0.5rem; }
.ms-workspace .mt-4 { margin-top: 1rem; }
.ms-workspace .mt-8 { margin-top: 2rem; }

/* ---- Filter controls: the hub's inline styles target the old DARK exams
   theme (light-grey text on white-alpha fills) and are invisible on the
   studio light background. Re-theme the readable base + label states here;
   the colored active/hover states (green/amber/red, per-tag) stay as-is. ---- */
.ms-workspace .filter-label,
.ms-workspace .secondary-label { color: var(--ms-ink-soft); }
.ms-workspace .filter-count,
.ms-workspace .chip-count { color: var(--ms-muted); }

.ms-workspace .diff-btn,
.ms-workspace .filter-btn,
.ms-workspace .filter-chip,
.ms-workspace .toggle-chip {
    background: var(--ms-panel-bg);
    border: 1.5px solid var(--ms-line-strong);
    color: var(--ms-ink-soft);
}

/* "All Levels" / generic active → studio accent (per-difficulty & per-tag
   active colours have higher specificity and are preserved). */
.ms-workspace .diff-btn.active,
.ms-workspace .filter-btn.active {
    background: linear-gradient(135deg, var(--ms-cta-start, #15803d), var(--ms-cta-end, #22c55e));
    border-color: var(--ms-accent);
    color: #fff;
}

/* The difficulty row container reads on the light panel surface */
.ms-workspace .difficulty-filter-row {
    background: var(--ms-panel-bg-soft);
    border: 1px solid var(--ms-line);
}
