/*
 * css/pdf-reader.css — §10 Neutral Board Reader (PROTOTYPE).
 * Brand palette: blue #1976D2 / purple #7B1FA2. On-device PDF reader.
 */

.pdfr-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(17, 24, 39, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.pdfr-panel {
  background: #fff; width: min(900px, 100%); height: min(92vh, 100%);
  border-radius: 16px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}
.pdfr-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #eef0f3;
  background: linear-gradient(135deg, rgba(25,118,210,0.08), rgba(123,31,162,0.06));
}
.pdfr-title { font-weight: 700; font-size: 1.05rem; color: #111827; display: flex; align-items: center; gap: 8px; }
.pdfr-proto {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em;
  background: #7B1FA2; color: #fff; padding: 2px 7px; border-radius: 999px;
}
.pdfr-close {
  border: none; background: transparent; font-size: 1.1rem; cursor: pointer;
  color: #6b7280; width: 34px; height: 34px; border-radius: 8px;
}
.pdfr-close:hover { background: #f3f4f6; color: #111827; }
.pdfr-body { flex: 1; overflow: auto; padding: 16px; }

/* Rights gate */
.pdfr-gate { max-width: 560px; margin: 8px auto; }
.pdfr-gate-lead { font-size: 0.98rem; color: #1f2937; line-height: 1.5; }
.pdfr-gate-points { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.pdfr-gate-points li {
  font-size: 0.9rem; color: #374151; background: #f8fafc;
  border: 1px solid #eef0f3; border-radius: 10px; padding: 10px 12px;
}
.pdfr-gate-check {
  display: flex; align-items: flex-start; gap: 8px; font-size: 0.92rem;
  color: #111827; margin: 16px 0; cursor: pointer;
}
.pdfr-gate-check input { margin-top: 3px; width: 18px; height: 18px; }
.pdfr-gate-go {
  width: 100%; padding: 12px; border: none; border-radius: 12px;
  background: #1976D2; color: #fff; font-weight: 700; font-size: 0.98rem;
  cursor: pointer;
}
.pdfr-gate-go:disabled { background: #cbd5e1; cursor: not-allowed; }
.pdfr-gate-go:not(:disabled):hover { background: #0D47A1; }

/* Toolbar */
.pdfr-toolbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  flex-wrap: wrap; position: sticky; top: 0; background: #fff;
  padding-bottom: 8px; border-bottom: 1px solid #f1f5f9;
}
.pdfr-nav {
  border: 1px solid #d1d5db; background: #fff; width: 36px; height: 36px;
  border-radius: 9px; font-size: 1.1rem; cursor: pointer; color: #111827;
}
.pdfr-nav:hover { background: #f3f4f6; }
.pdfr-pageinfo { font-size: 0.85rem; color: #374151; min-width: 96px; text-align: center; }
.pdfr-fname {
  font-size: 0.78rem; color: #6b7280; flex: 1; min-width: 80px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pdfr-speakpage {
  border: none; background: #7B1FA2; color: #fff; font-weight: 600;
  padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 0.85rem;
}
.pdfr-speakpage:hover { background: #4A148C; }

/* Page stage */
.pdfr-stage { display: flex; flex-direction: column; align-items: center; }
.pdfr-page { position: relative; box-shadow: 0 2px 12px rgba(0,0,0,0.12); border-radius: 4px; overflow: hidden; }
.pdfr-canvas { display: block; }
.pdfr-layer { position: absolute; inset: 0; }

/* Transparent tappable word over the rendered page */
.pdfr-hotspot {
  position: absolute; border: none; background: rgba(25,118,210,0.0);
  border-radius: 4px; cursor: pointer; padding: 0; margin: 0;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}
.pdfr-hotspot:hover, .pdfr-hotspot:focus-visible {
  background: rgba(25,118,210,0.18); box-shadow: 0 0 0 2px rgba(25,118,210,0.45);
  outline: none;
}
.pdfr-hotspot--spoken { background: rgba(76,175,80,0.30) !important; }

/* Scanned-page chip grid */
.pdfr-scan-note, .pdfr-hint {
  font-size: 0.85rem; color: #374151; background: #f8fafc;
  border: 1px solid #eef0f3; border-radius: 10px; padding: 10px 12px;
  margin-top: 12px; max-width: 640px; line-height: 1.45;
}
.pdfr-hint { color: #1976D2; background: rgba(25,118,210,0.06); border-color: rgba(25,118,210,0.18); text-align: center; }
.pdfr-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 12px; margin-top: 12px; }
.pdfr-loading { color: #6b7280; padding: 24px; text-align: center; font-size: 0.92rem; }

.pdfr-chips { width: 100%; max-width: 720px; margin-top: 12px; display: grid; gap: 8px; }
.pdfr-chip-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pdfr-chip-line-speak {
  border: none; background: #7B1FA2; color: #fff; width: 28px; height: 28px;
  border-radius: 7px; cursor: pointer; font-size: 0.7rem; flex-shrink: 0;
}
.pdfr-chip-line-speak:hover { background: #4A148C; }
.pdfr-chip {
  border: 1px solid #d1d5db; background: #fff; color: #111827;
  padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 0.95rem;
}
.pdfr-chip:hover, .pdfr-chip:focus-visible {
  border-color: #1976D2; background: rgba(25,118,210,0.08); outline: none;
}
.pdfr-chip--spoken { background: rgba(76,175,80,0.22) !important; border-color: #4CAF50 !important; }

@media (max-width: 640px) {
  .pdfr-panel { height: 100%; border-radius: 0; }
  .pdfr-overlay { padding: 0; }
}
