/* ==========================================================================
   qbank.css — Question Bank feature
   ========================================================================== */

#qbank-modal {
  z-index: var(--z-modal);
}

.qbank-card {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100dvh - 40px);
}

.qbank-card .modal-title {
  margin: 0;
}

/* Ensure [hidden] always wins over display: flex rules below */
.qbank-card [hidden] {
  display: none !important;
}

/* ─── Level 2 header (Back + file name) ─────────────────────────────────── */
.qbank-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.qbank-back {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: background var(--dur-fast);
}

.qbank-back:hover,
.qbank-back:focus-visible {
  background: var(--accent-soft);
}

.qbank-header-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── List ──────────────────────────────────────────────────────────────── */
.qbank-list {
  overflow-y: auto;
  min-height: 0;
  max-height: 40dvh;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-surface-2);
}

.qbank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 14px;
  text-align: left;
  background: transparent;
  transition: background var(--dur-fast);
}

.qbank-item:last-child {
  border-bottom: none;
}

.qbank-item:hover,
.qbank-item:focus-visible {
  background: var(--accent-soft);
}

.qbank-item.selected {
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent-light);
  font-weight: 600;
}

/* Level 1 file rows */
.qbank-file {
  padding: 14px 12px;
  font-size: 15px;
}

.qbank-file .qbank-item-name {
  font-weight: 600;
}

.qbank-item-count {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.qbank-status {
  padding: 4px 2px;
  font-size: 13px;
  color: var(--text-muted);
  min-height: 1.2em;
}

.qbank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.qbank-row input[type="number"] {
  width: 90px;
  margin-bottom: 0;
}

.qbank-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.qbank-card .modal-actions {
  flex-wrap: wrap;
}