/* QuizCard AI: styles that exist only in this tool. Shared look: ../../shared/css/style.css */

/* Page shell: a one-screen cockpit on desktop; stacked and scrolling below 1024px. */

html, body { min-height: 100%; }

.app-shell { min-height: 100vh; min-height: 100dvh; }

@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }

  .app-shell { height: 100vh; height: 100dvh; }
}

/* Lesson material: imported files as cards above the text box (same as ScopeLine) */

.well-stack { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

.well-stack > textarea { flex: 1 0 auto; height: auto; }

.well-stack.has-docs > textarea { min-height: 70px; }

.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc-list[hidden] { display: none; }

.doc-card {
  --accent: #6366f1;
  --accent-soft: #eef2ff;
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px 10px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -8px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  animation: doc-card-in 0.28s ease-out;
}

.doc-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #a855f7));
}

.doc-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.doc-card__badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent);
}

.doc-card__kind {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.doc-card__remove {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.doc-card__remove:hover,
.doc-card__remove:focus-visible { background: var(--accent-soft); color: var(--accent); }

.doc-card__body {
  margin: 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card__body.is-open { display: block; }

.doc-card__more {
  margin-top: 4px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

.doc-card__more:hover { text-decoration: underline; }

@keyframes doc-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-card { animation: none; }
}

.crystal-well-3d.is-drop-target {
  border-color: #6366f1;
  border-style: dashed;
  background: #eef2ff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Quiz / Flashcards switch (same as DiePack's IN / MM switch) */

.view-btn { color: #475569; }

.view-btn:hover { color: #0f172a; }

.view-btn.is-active { background: #4f46e5; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }

/* Questions (same card, buttons and pills as HostCheck's rooms and tasks) */

.q-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; }

.q-num {
  flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: 9pt; font-weight: 700; color: #fff; background: #4f46e5;
}

.q-option {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  padding: 5px 8px; border-radius: 10px; border: 1px solid #f1f5f9; background: #f8fafc;
  font-size: 10pt; color: #1e293b; transition: border-color 0.15s, background 0.15s;
}

.q-option:hover { border-color: #c7d2fe; background: #eef2ff; }

.q-letter {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center;
  font-size: 8.5pt; font-weight: 700; color: #475569; background: #fff; border: 1px solid #e2e8f0;
}

.q-tick { flex-shrink: 0; color: #10b981; font-weight: 700; visibility: hidden; }

.q-option.is-correct { border-color: #6ee7b7; background: #f0fdf4; }

.q-option.is-correct .q-letter { color: #fff; background: #10b981; border-color: #10b981; }

.q-option.is-correct .q-tick { visibility: visible; }

.q-why { display: block; width: 100%; text-align: left; margin-top: 6px; font-size: 9pt; color: #64748b; line-height: 1.4; }

.q-why:hover { color: #4f46e5; }

.hide-answers .q-option.is-correct { border-color: #f1f5f9; background: #f8fafc; }

.hide-answers .q-option.is-correct .q-letter { color: #475569; background: #fff; border-color: #e2e8f0; }

.hide-answers .q-tick, .hide-answers .q-why { display: none; }

.prio { font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.prio-standard { background: #f1f5f9; color: #475569; }
.prio-detail { background: #ede9fe; color: #6d28d9; }

.task-btn { color: #94a3b8; font-size: 11pt; line-height: 1; padding: 1px 3px; }
.task-btn:hover { color: #4f46e5; }
.task-btn:disabled { opacity: 0.35; cursor: default; color: #94a3b8; }

.add-task { margin-top: 2px; align-self: flex-start; font-size: 9pt; font-weight: 600; color: #4f46e5; }
.add-task:hover { color: #312e81; text-decoration: underline; }

/* Flashcards */

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }

.flash-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }

.flash-front { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; font-size: 10pt; font-weight: 600; color: #0f172a; border-bottom: 1px dashed #cbd5e1; }

.flash-num { flex-shrink: 0; font-size: 8.5pt; font-weight: 700; color: #94a3b8; font-variant-numeric: tabular-nums; margin-top: 1px; }

.flash-back { flex: 1; padding: 8px 10px; font-size: 9.5pt; color: #475569; line-height: 1.45; background: #f8fafc; }

/* Export window: the file type badge */

.format-ext {
  flex-shrink: 0; width: 2.25rem; height: 2rem; margin-top: 2px; border-radius: 0.5rem;
  display: grid; place-items: center; background: #e0e7ff; color: #4338ca;
  font-size: 7.5pt; font-weight: 700; text-transform: uppercase;
}

/* Print / PDF: the quiz (worksheet or answer key) or flashcards to cut out. */

.print-only { display: none; }

@media print {
  @page { margin: 12mm; size: letter portrait; }

  html, body, main, main > section, main section > div, #quizList {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important; position: static !important; display: block !important;
    background: #fff !important; box-shadow: none !important; border: 0 !important; padding: 0 !important;
  }
  #toolHeader, #outputLockOverlay, #exampleBadge, #countText, #quizSubtitle, .task-btn, .add-task, .no-print { display: none !important; }

  .print-only { display: block !important; white-space: pre-wrap; font-size: 11pt; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
  .q-card { break-inside: avoid; border: 1px solid #cbd5e1 !important; margin-bottom: 8px; padding: 8px 10px !important; }
  .q-option { border: 0 !important; background: transparent !important; padding: 2px 4px !important; }
  .hide-answers .q-letter { color: #334155 !important; }
  .card-grid { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0; }
  .flash-card { break-inside: avoid; border-radius: 0; border: 1px dashed #94a3b8; min-height: 1.6in; }
}

#formatList { max-height: 60vh; }
