/* LUMI Video QC — visual language tuned to feel native to the existing
   video-judge.6037.io tool: muted neutrals, rounded chips, accent on score. */

:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --good: #16a34a;
  --bad:  #dc2626;
  --warn: #d97706;
  --neutral: #9ca3af;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }

nav { display: flex; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
nav a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; }
nav a.active { color: var(--text); background: var(--accent-soft); }
nav a:hover { color: var(--text); }

header h1 { margin: 0 0 6px; font-size: 26px; }
header .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }

.region {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.region h2 { font-size: 16px; margin: 0 0 14px; color: var(--text); }

form { display: flex; flex-direction: column; gap: 14px; }
.fileLabel { display: flex; flex-direction: column; gap: 6px; }
.fileTitle { font-size: 13px; color: var(--muted); }
.fileNameDisplay { color: var(--text); font-size: 14px; }

fieldset.brief {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; margin: 4px 0;
}
fieldset.brief legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
fieldset.brief label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
fieldset.brief label span { font-size: 12px; color: var(--muted); font-weight: 500; }
fieldset.brief textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  resize: vertical; background: #fff;
}
fieldset.brief textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

button { font: inherit; padding: 10px 16px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; align-self: flex-start; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:hover:not(:disabled) { filter: brightness(0.95); }

.uploadMsg { color: var(--muted); font-size: 13px; }

.statusRow { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.statusPill {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px;
  font-weight: 600; letter-spacing: 0.04em; background: #e5e7eb; color: #374151;
}
.statusPill.queued     { background: #fef3c7; color: #92400e; }
.statusPill.processing { background: #dbeafe; color: #1d4ed8; }
.statusPill.succeeded  { background: #dcfce7; color: #166534; }
.statusPill.failed     { background: #fee2e2; color: #991b1b; }

.progressTrack { width: 100%; height: 6px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progressBar { width: 0; height: 100%; background: var(--accent); transition: width 0.3s ease; }

.queueList { display: flex; flex-direction: column; gap: 6px; }
.queueRow { display: grid; grid-template-columns: 70px 110px 1fr 40px 70px; gap: 10px; align-items: center; font-size: 13px; }
.queueRow.queueRowMe .queueLabel { color: var(--accent); font-weight: 600; }
.queueBarWrap { width: 100%; height: 4px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.queueBar { height: 100%; background: var(--accent); }
.queueYouBadge { color: var(--accent); font-size: 11px; }

/* RESULT */
.summaryBox {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid #c7d2fe; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.scoreBadge {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 16px; min-width: 110px; text-align: center;
  font-weight: 700; font-size: 28px; color: var(--accent);
}
.scoreBadge .scoreOf { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
#summaryText { margin: 0; line-height: 1.5; font-size: 14px; color: var(--text); }

.sectionGroup { margin-bottom: 18px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sectionHead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #fafafa; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.sectionHead .sectionScore {
  font-variant-numeric: tabular-nums; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 2px 10px; font-size: 13px;
}
.criterionTable { width: 100%; border-collapse: collapse; font-size: 13px; }
.criterionTable td { padding: 8px 14px; vertical-align: top; border-top: 1px solid var(--border); }
.criterionTable tr:first-child td { border-top: 0; }
.criterionTable .col-id      { width: 50px; color: var(--muted); font-variant-numeric: tabular-nums; }
.criterionTable .col-ans     { width: 60px; }
.criterionTable .col-comment { color: var(--muted); }
.ansChip {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}
.ansChip.yes { background: #dcfce7; color: var(--good); }
.ansChip.no  { background: #fee2e2; color: var(--bad); }

.collapsible { background: #fafafa; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-top: 12px; }
.collapsible summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.collapsible pre { white-space: pre-wrap; word-wrap: break-word; font-size: 12px; max-height: 360px; overflow: auto; margin: 8px 0 0; }

/* HISTORY */
.historyList { display: flex; flex-direction: column; gap: 4px; }
.historyRow {
  display: grid; grid-template-columns: 60px 110px 140px 80px 1fr 60px 1fr;
  gap: 8px; align-items: center; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--border);
}
.historyRow.historyHeader { font-weight: 600; color: var(--muted); }
.historyId { font-variant-numeric: tabular-nums; }
.historyLink { color: var(--accent); cursor: pointer; }
.historyLink:hover { text-decoration: underline; }
.historyTime, .historyFrames, .historyStage, .historyFileName { color: var(--muted); }
.scoreBarWrap { display: inline-flex; align-items: center; gap: 6px; }
.scoreBar { width: 80px; height: 5px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.scoreBarFill { height: 100%; background: var(--good); }
.scoreBarFill.low    { background: var(--bad); }
.scoreBarFill.mid    { background: var(--warn); }
.scoreBarFill.high   { background: var(--good); }
.scoreLabel { font-variant-numeric: tabular-nums; font-size: 12px; }

.loadMoreBtn { background: transparent; color: var(--accent); border: 1px solid var(--border); padding: 6px 12px; align-self: center; }
