/* authoring.css — additions for the instructor authoring UI.
   Loaded on top of style.css. */

.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row input[type="text"], .row input[type="password"] { flex: 1; min-width: 220px; }

.help { color: var(--muted); font-size: 0.9em; margin: 0.25rem 0 0.6rem; }
.status { color: var(--muted); font-size: 0.9rem; }
.status.ok { color: var(--success-fg); }
.status.err { color: var(--critical-fg); }

.field { display: block; margin: 0.7rem 0; }
.field > span { display: block; font-weight: 600; font-size: 0.92em; margin-bottom: 0.25rem; }
.field small { font-weight: 400; color: var(--muted); }

.field input[type="text"], .field textarea, .row input {
  width: 100%; padding: 0.45rem 0.7rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.92rem; border: 1px solid var(--border); border-radius: 4px;
}
.field textarea { resize: vertical; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

button {
  background: #f1f1f1; color: var(--fg); border: 1px solid var(--border);
  padding: 0.45rem 0.9rem; border-radius: 4px; cursor: pointer;
  font-size: 0.92rem;
}
button:hover { filter: brightness(0.97); }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: var(--critical-fg); color: #fff; border-color: var(--critical-fg); }
button:disabled { opacity: 0.6; cursor: wait; }

#authoring-problem-list { list-style: none; padding-left: 0; margin-top: 0.75rem; }
#authoring-problem-list li {
  display: flex; gap: 0.6rem; align-items: baseline;
  padding: 0.45rem 0; border-bottom: 1px solid var(--border);
}
#authoring-problem-list li:last-child { border-bottom: none; }
#authoring-problem-list a { color: var(--accent); text-decoration: none; }
#authoring-problem-list a:hover { text-decoration: underline; }
#authoring-problem-list .pid {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.85em;
  color: var(--muted);
}

/* Catalog sync controls */
.inline-check {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.92rem; white-space: nowrap;
}
.inline-check input[type="checkbox"] {
  width: auto; min-width: 0; flex: none; margin: 0;
}
#sync-result { margin-top: 0.6rem; }
.sync-group { margin: 0.4rem 0; }
.sync-group .sync-ids {
  list-style: none; padding-left: 0; margin: 0.3rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem;
  max-height: 8rem; overflow-y: auto;
}
.sync-group .sync-ids .pid {
  font-family: ui-monospace, Menlo, monospace; font-size: 0.82em;
  color: var(--muted);
}

.distractor {
  border: 1px solid var(--border); border-left: 4px solid var(--major-fg);
  border-radius: 4px; padding: 0.75rem 0.9rem; margin: 0.6rem 0;
  background: #fffdf7;
}
.distractor .drow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 0.5rem; }
.distractor label { font-size: 0.85em; font-weight: 600; display: block; }
.distractor input, .distractor textarea, .distractor select {
  width: 100%; padding: 0.35rem 0.55rem;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.88rem;
  border: 1px solid var(--border); border-radius: 4px;
}
.distractor .full { grid-column: 1 / -1; }
.distractor .dactions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.distractor .dactions button { font-size: 0.82rem; padding: 0.3rem 0.7rem; }
.ri-actions {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.35rem;
}
.ri-actions button { font-size: 0.82rem; padding: 0.3rem 0.65rem; }

.capture-row {
  display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
}
.capture-row input { flex: 1 1 8rem; min-width: 0; }
.capture-row button { font-size: 0.78rem; padding: 0.25rem 0.55rem; white-space: nowrap; }

#preview-result { margin-top: 0.75rem; }
#preview-hits { list-style: none; padding-left: 0; }

.actions { margin-top: 1.25rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }

.mono { font-family: ui-monospace, Menlo, monospace; }

.analytics-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; font-size: 0.9rem; }
.analytics-table th, .analytics-table td {
  text-align: left; padding: 0.4rem 0.55rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.analytics-table th { font-weight: 600; white-space: nowrap; }
.analytics-table td.pid { font-family: ui-monospace, Menlo, monospace; font-size: 0.82rem; }
.analytics-table td.mono { font-size: 0.82rem; }
.analytics-table tbody tr:hover { background: rgba(0,0,0,0.03); }
