/* ── CHECK PLAGIARISM PANEL ───────────────────────────────────────────────────
   Palette matches the teachers hub (.ts-*) in styles.css: page #0d1017,
   panel #161b28, border #2e3650, accent #4f7ef8.                              */

/* Follows the same pattern as every other screen (#role-screen, #landing-screen,
   #learn-section, #teachers-section): a fixed, full-viewport overlay. It has to
   be fixed rather than a flex child because #main-section has no [hidden] rule
   of its own (styles.css:86) — its display:flex overrides the hidden attribute,
   so the resume builder is ALWAYS laid out and every other screen covers it
   rather than replacing it. A flex child would stack underneath it instead.

   overflow is hidden here, not auto, because the two panes scroll themselves. */
#plagiarism-section {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #080a10;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* A CSS display value beats the [hidden] attribute — without this the panel
   would sit on top of every other screen permanently. */
#plagiarism-section[hidden] { display: none; }

.pl-page {
  width: 100%;
  max-width: 1180px;
  height: 100%;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
}

.pl-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pl-header {
  flex: 1;
  background: #161b28;
  border: 1px solid #2e3650;
  border-radius: 10px;
  padding: 13px 24px;
}

.pl-title {
  color: #d1d9f0;
  font-size: 17px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.pl-title-sub {
  display: block;
  color: #6b7499;
  font-size: 11.5px;
  font-weight: 400;
  margin-top: 3px;
}

.pl-split {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

/* Each pane scrolls on its own so a long result list can never push content
   past the section, and the teacher keeps the input controls in view while
   reading the evidence. */
.pl-pane {
  background: #0d1017;
  border: 1.5px solid #2e3650;
  border-radius: 14px;
  padding: 20px;
  overflow-y: auto;
  min-height: 0;
}

.pl-pane-title {
  color: #f0f4ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  margin-bottom: 14px;
}

/* ── input pane ───────────────────────────────────────────────────────────── */

.pl-textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: #080a10;
  border: 1px solid #2e3650;
  border-radius: 8px;
  color: #d1d9f0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
}
.pl-textarea:focus { outline: none; border-color: #4f7ef8; }

.pl-or {
  text-align: center;
  color: #4a5580;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  margin: 10px 0;
}

.pl-file-label {
  display: block;
  text-align: center;
  border: 1px dashed #2e3650;
  border-radius: 8px;
  padding: 11px;
  color: #6b7499;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.pl-file-label:hover { border-color: #4f7ef8; color: #a0aacc; }

.pl-pane-title-2 { margin-top: 24px; }

.pl-hint {
  color: #6b7499;
  font-size: 11.5px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  margin: -8px 0 11px;
}

.pl-corpus-list { margin-top: 9px; }

.pl-corpus-row {
  color: #8892b5;
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  padding: 3px 0;
}
.pl-corpus-row em { color: #4a5580; font-style: normal; }

.pl-corpus-report { margin-top: 8px; }
.pl-ok   { color: #4ade80; font-weight: 700; }
.pl-skip { color: #4a5580; font-weight: 700; }

.pl-fields { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

.pl-input {
  width: 100%;
  background: #080a10;
  border: 1px solid #2e3650;
  border-radius: 7px;
  color: #d1d9f0;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  padding: 9px 11px;
}
.pl-input:focus { outline: none; border-color: #4f7ef8; }
.pl-input::placeholder { color: #4a5580; }

.pl-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8892b5;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  margin-top: 11px;
  cursor: pointer;
}
.pl-check input { accent-color: #4f7ef8; }

.pl-run-btn {
  width: 100%;
  margin-top: 18px;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  padding: 12px;
  cursor: pointer;
  transition: background .15s;
}
.pl-run-btn:hover:not(:disabled) { background: #2563eb; }
.pl-run-btn:disabled { opacity: .5; cursor: default; }

.pl-error {
  margin-top: 12px;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.35);
  border-radius: 7px;
  color: #fca5a5;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 9px 11px;
}

/* ── results pane ─────────────────────────────────────────────────────────── */

.pl-empty {
  color: #4a5580;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  text-align: center;
  padding: 60px 20px;
}

.pl-band-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

.pl-band {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 6px 14px;
}
.pl-band-low    { background: rgba(34,197,94,.14);  color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.pl-band-review { background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.4); }
.pl-band-high   { background: rgba(239,68,68,.14);  color: #f87171; border: 1px solid rgba(239,68,68,.4); }

.pl-band-note {
  color: #4a5580;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
}

.pl-scores { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }

.pl-score-tile {
  background: #080a10;
  border: 1px solid #2e3650;
  border-radius: 9px;
  padding: 12px 10px;
  text-align: center;
}
.pl-score-val {
  display: block;
  color: #f0f4ff;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
}
.pl-score-lbl {
  display: block;
  color: #6b7499;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: .7px;
  text-transform: uppercase;
  margin-top: 3px;
}

.pl-section-title {
  color: #8892b5;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #1e2536;
}

.pl-highlight {
  background: #080a10;
  border: 1px solid #2e3650;
  border-radius: 9px;
  padding: 15px;
  color: #b8c2de;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  line-height: 1.75;
  max-height: 45vh;
  overflow-y: auto;
  white-space: pre-wrap;
}

.pl-hl { border-radius: 3px; padding: 1px 2px; color: #f0f4ff; }
.pl-hl-red   { background: rgba(239,68,68,.30); box-shadow: inset 0 -2px 0 rgba(239,68,68,.7); }
.pl-hl-amber { background: rgba(245,158,11,.26); box-shadow: inset 0 -2px 0 rgba(245,158,11,.65); }

.pl-legend {
  display: flex;
  gap: 16px;
  margin-top: 9px;
  color: #6b7499;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
}
.pl-legend span { display: flex; align-items: center; gap: 6px; }
.pl-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.pl-match {
  background: #080a10;
  border: 1px solid #2e3650;
  border-radius: 9px;
  padding: 13px;
  margin-bottom: 10px;
}

.pl-match-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }

.pl-match-type {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 7px;
}
.pl-type-peer      { background: rgba(79,126,248,.16); color: #93b4ff; }
.pl-type-self      { background: rgba(168,85,247,.16); color: #c4b5fd; }
.pl-type-reference { background: rgba(20,184,166,.16); color: #5eead4; }

.pl-match-who   { flex: 1; color: #d1d9f0; font-size: 12.5px; font-family: 'Inter', sans-serif; }
.pl-match-score { color: #f0f4ff; font-size: 13px; font-weight: 700; font-family: 'Inter', sans-serif; }

.pl-span { border-top: 1px solid #1e2536; padding-top: 10px; margin-top: 10px; }
.pl-span-head { display: flex; justify-content: space-between; margin-bottom: 7px; }

.pl-engine {
  color: #4a5580;
  font-size: 10px;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}
.pl-span-score { color: #8892b5; font-size: 11px; font-family: 'Inter', sans-serif; }

.pl-side { margin-bottom: 8px; }
.pl-side-label {
  color: #4a5580;
  font-size: 9.5px;
  letter-spacing: .7px;
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
  margin-bottom: 3px;
}
.pl-side-text {
  color: #a8b2d0;
  font-size: 12px;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  background: #0d1017;
  border-left: 2px solid #2e3650;
  border-radius: 0 5px 5px 0;
  padding: 7px 10px;
}

.pl-note { margin-bottom: 11px; }
.pl-note-head { display: flex; justify-content: space-between; margin-bottom: 5px; }
.pl-note-name {
  color: #d1d9f0;
  font-size: 11.5px;
  font-family: 'Inter', sans-serif;
  text-transform: capitalize;
}
.pl-note-score { color: #8892b5; font-size: 11.5px; font-family: 'Inter', sans-serif; }
.pl-note-bar { height: 4px; background: #1e2536; border-radius: 2px; overflow: hidden; }
.pl-note-fill { height: 100%; background: #4f7ef8; border-radius: 2px; }
.pl-note-exp {
  color: #6b7499;
  font-size: 11px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}

.pl-report {
  color: #b8c2de;
  font-size: 12.5px;
  line-height: 1.7;
  font-family: 'Inter', sans-serif;
}
.pl-report-guidance {
  margin-top: 11px;
  background: rgba(79,126,248,.08);
  border-left: 2px solid #4f7ef8;
  border-radius: 0 6px 6px 0;
  padding: 9px 12px;
  color: #a8b2d0;
  font-size: 12px;
}

.pl-finding {
  border-top: 1px solid #1e2536;
  padding-top: 8px;
  margin-top: 8px;
  color: #a8b2d0;
  font-size: 12px;
  line-height: 1.6;
}

.pl-none {
  color: #4a5580;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-style: italic;
}

.pl-disclaimer {
  margin-top: 22px;
  background: rgba(245,158,11,.07);
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 8px;
  padding: 10px 13px;
  color: #d1a55a;
  font-size: 11.5px;
  line-height: 1.55;
  font-family: 'Inter', sans-serif;
}

@media (max-width: 900px) {
  /* Stacked panes can't each own a scrollbar sensibly — hand scrolling back to
     the section as a single column instead. */
  #plagiarism-section { overflow-y: auto; align-items: flex-start; }
  .pl-page   { height: auto; min-height: 100%; }
  .pl-split  { grid-template-columns: 1fr; flex: none; }
  .pl-pane   { overflow: visible; max-height: none; }
  .pl-scores { grid-template-columns: repeat(2, 1fr); }
}
