/* ============================================================
   QUESTION BANK — board picker, filter rail, question cards
============================================================ */

/* --- Board picker --- */
.qb-board-grid {
  max-width: 1080px;
  margin: 1.25rem auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.qb-board-card {
  background: #fff;
  border: 2.5px solid #000;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #000;
  padding: 1.4rem 1rem 1.2rem;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
}
.qb-board-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: var(--board-color, var(--primary));
  border-bottom: 1.5px solid #000;
}
.qb-board-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #000;
  background: #fffbe8;
}
.qb-board-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.4rem;
  color: var(--board-color, var(--primary));
}
.qb-board-tagline {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.3;
}
.qb-board-count {
  display: inline-block;
  background: var(--accent);
  border: 1.5px solid #000;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}

/* --- Board view header strip --- */
.qb-boardbar {
  max-width: 1080px;
  margin: 1rem auto 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.qb-board-pill {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000;
  padding: 0.42rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.qb-board-pill:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
.qb-board-pill.on {
  background: var(--board-color, var(--primary));
  color: #fff;
}

/* --- Filter card --- */
.qb-filterbar {
  max-width: 1080px;
  margin: 0.85rem auto 0;
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  box-shadow: 4px 4px 0 #000;
  padding: 0.85rem 1rem;
}
.qb-search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.qb-search {
  flex: 1 1 240px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  padding: 0.55rem 0.85rem;
  border: 2px solid #000;
  border-radius: 8px;
  background: #fffbe8;
  outline: none;
  min-width: 0;
}
.qb-search:focus { background: #fff; box-shadow: 3px 3px 0 var(--primary); }
.qb-result-count {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  color: #334155;
  white-space: nowrap;
}
.qb-clear {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  background: #fff;
  border: 2px solid #000;
  border-radius: 7px;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 #000;
}
.qb-clear:hover { background: var(--red-pen); color: #fff; transform: translate(-1px,-1px); box-shadow: 3px 3px 0 #000; }

.qb-filter-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin: 0.8rem 0 0.4rem;
}
.qb-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.qb-chip {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  background: #f1f5f9;
  border: 1.5px solid #000;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.qb-chip:hover { background: #eff6ff; transform: translateY(-1px); }
.qb-chip.on {
  background: var(--primary);
  color: #fff;
  box-shadow: 2px 2px 0 #000;
}
.qb-chip-count {
  display: inline-block;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0 0.4rem;
  margin-left: 0.3rem;
  font-size: 0.72rem;
}
.qb-chip.on .qb-chip-count { background: rgba(255,255,255,0.25); }

/* --- Question list --- */
.qb-list {
  max-width: 1080px;
  margin: 1rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* --- Question card --- */
.qb-card {
  background: #fff;
  border: 2.5px solid #000;
  border-radius: 14px;
  box-shadow: 6px 6px 0 #000;
  overflow: hidden;
  position: relative;
}
.qb-card-stripe {
  height: 8px;
  border-bottom: 1.5px solid #000;
  background: var(--board-color, var(--primary));
}
.qb-card-head {
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1.5px dashed #cbd5e1;
  background: #fafafa;
}
.qb-card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}
.qb-badge-board {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  background: var(--board-color, var(--primary));
  color: #fff;
  border: 1.5px solid #000;
  border-radius: 6px;
  padding: 0.18rem 0.55rem;
  box-shadow: 2px 2px 0 #000;
}
.qb-badge-round {
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  background: #ecfccb;
  color: #166534;
  border: 1.5px dashed #166534;
  border-radius: 6px;
  padding: 0.05rem 0.55rem;
}
.qb-badge-qno {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
}
.qb-badge-marks {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--accent);
  color: #000;
  border: 1.5px solid #000;
  border-radius: 999px;
  padding: 0.18rem 0.7rem;
}
.qb-badge-dr {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #b45309;
  color: #fff;
  border: 1.5px solid #000;
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
}
.qb-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: #000;
  letter-spacing: -0.01em;
}

.qb-card-body {
  padding: 0.95rem 1.1rem 0.5rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: #1e293b;
}
.qb-card-body p { margin: 0 0 0.65rem; }
.qb-card-body p:last-child { margin-bottom: 0; }
.qb-card-body b, .qb-card-body strong { color: #000; }
.qb-card-body .qb-part-label {
  font-weight: 700;
  margin-right: 0.25rem;
}
.qb-card-body .qb-marks {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  padding: 0 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: #334155;
  margin-left: 0.35rem;
  white-space: nowrap;
}
.qb-card-body .qb-figure {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.02rem;
  color: #475569;
  background: #fffbe8;
  border-left: 4px solid var(--accent);
  padding: 0.4rem 0.65rem;
  border-radius: 0 6px 6px 0;
  margin: 0.55rem 0;
}

/* Proper figures */
.qb-fig {
  background: #fff;
  border: 1.5px solid #000;
  border-radius: 8px;
  box-shadow: 3px 3px 0 #000;
  padding: 0.65rem 0.65rem 0.5rem;
  margin: 0.7rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: stretch;
}
.qb-fig-svg {
  display: flex;
  justify-content: center;
  background:
    linear-gradient(#fff, #fff),
    repeating-linear-gradient(0deg, transparent 0 14px, #f1f5f9 14px 15px);
  border-radius: 5px;
  padding: 0.25rem;
}
.qb-fig-svg svg {
  max-width: 100%;
  height: auto;
  display: block;
}
.qb-fig-caption {
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  color: #475569;
  text-align: center;
}
.qb-fig-caption b {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: #000;
}

.qb-ss-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.92rem;
  background: #fff;
  margin: 0 auto;
  max-width: 360px;
}
.qb-ss-table th, .qb-ss-table td {
  border: 1px solid #94a3b8;
  padding: 0.3rem 0.55rem;
  text-align: center;
}
.qb-ss-table thead th {
  background: #1e293b;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.qb-ss-table tbody th {
  background: #cbd5e1;
  color: #0f172a;
  font-weight: 700;
  width: 36px;
}
.qb-ss-table .qb-ss-empty { background: #fef9c3; color: #78350f; font-style: italic; }
.qb-card-body .qb-dr {
  font-family: 'Patrick Hand', cursive;
  font-style: italic;
  color: #92400e;
  background: #fef3c7;
  border-left: 4px solid #b45309;
  padding: 0.35rem 0.65rem;
  border-radius: 0 6px 6px 0;
  margin: 0.45rem 0;
  font-size: 1rem;
}
.qb-card-body .qb-eq {
  display: block;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--primary);
  border-radius: 0 6px 6px 0;
  padding: 0.45rem 0.7rem;
  margin: 0.5rem 0;
  overflow-x: auto;
}

/* keyword tags strip */
.qb-card-tags {
  padding: 0.45rem 1.1rem 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.qb-card-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  background: #eff6ff;
  color: #4338ca;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  transition: all 0.12s;
}
.qb-card-tag:hover { background: var(--primary); color: #fff; border-color: #000; }

/* Empty state */
.qb-empty {
  max-width: 720px;
  margin: 2rem auto;
  text-align: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.2rem;
  color: #475569;
  background: #fffbe8;
  border: 2px dashed #b45309;
  border-radius: 12px;
  padding: 1.25rem;
}

/* KaTeX adjustments — keep display math from blowing up on phones */
.qb-card-body .katex-display {
  margin: 0.4rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.qb-card-body .katex {
  font-size: 1.05em;
}

@media (max-width: 720px) {
  .qb-board-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .qb-board-card { padding: 1rem 0.5rem; }
  .qb-board-name { font-size: 1.15rem; }
  .qb-board-tagline { font-size: 0.95rem; }
  .qb-card-body { padding: 0.75rem 0.85rem 0.4rem; font-size: 0.95rem; }
  .qb-card-head { padding: 0.7rem 0.85rem 0.55rem; }
  .qb-card-title { font-size: 1rem; }
  .qb-card-body .katex { font-size: 0.98em; }
  .qb-filterbar { padding: 0.7rem 0.75rem; }
}
