/*
 * pdf_doctor.css — PDF Doctor's health-report/fix UI. Reuses page_swap.css
 * for the shared dropzone/loading-spinner/privacy-note/small-button
 * pieces (see this page's <head> - both stylesheets are loaded together)
 * and the same shared token contract (--card, --border, --accent,
 * --primary, --success/--warn/--danger families, etc.) from style.css's
 * :root, so it repaints correctly for both themes without redefining any
 * color itself.
 */

.pdc-panel { max-width: none; }

/* --- Password prompt (encrypted PDFs) ---------------------------------- */

.pdc-password-box {
  display: block; background: var(--tint); border: 1px solid var(--tint-border);
  border-radius: 12px; padding: 16px; margin-top: 12px;
}
.pdc-password-box p { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--text); }
.pdc-password-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pdc-password-row input {
  flex: 1; min-width: 180px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; background: var(--card); color: var(--text);
}
.pdc-password-wrong { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; }

/* --- Error box (own convention: plain .hidden toggle, unlike Page
   Swap's .psw-error-box, which uses a dedicated .psw-visible class) ---- */

.pdc-error-box {
  display: flex; align-items: flex-start; gap: 10px; background: var(--danger-bg);
  border: 1px solid var(--danger-border); color: var(--danger); border-radius: 12px;
  padding: 14px 16px; margin-top: 12px;
}
.pdc-error-box button { margin-left: auto; flex-shrink: 0; }

/* --- Report shell -------------------------------------------------------- */

.pdc-report { margin-top: 4px; }

.pdc-report-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.pdc-score-wrap { display: flex; align-items: center; gap: 16px; }

/* The ring itself is a solid circle whose background JS sets to a
   conic-gradient (see renderScore() in pdf_doctor.js) - the donut look
   comes from the smaller, solid-color circle (the actual <span> holding
   the number) sitting centered on top of it via plain flexbox centering. */
.pdc-score-ring {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.4s ease;
}
.pdc-score-ring span {
  background: var(--card); width: 66px; height: 66px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; color: inherit;
}

.pdc-score-label { font-size: 15px; font-weight: 600; color: var(--text); }
.pdc-file-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.pdc-all-good {
  display: flex; align-items: center; gap: 8px; background: var(--success-bg);
  border: 1px solid var(--success-border); color: var(--success); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; font-weight: 500;
}

/* --- Findings ------------------------------------------------------------ */

.pdc-findings { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.pdc-finding {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--card);
}
.pdc-finding-icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.pdc-finding-body { min-width: 0; }
.pdc-finding-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.pdc-finding-head strong { font-size: 14px; color: var(--text); }
.pdc-finding p { margin: 0; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }

.pdc-sev-tag {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 5px; background: var(--tint); color: var(--text-muted);
}
.pdc-fixable-tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px;
  background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border);
}

.pdc-finding.pdc-sev-critical { border-left: 3px solid var(--danger); }
.pdc-finding.pdc-sev-high { border-left: 3px solid var(--danger); }
.pdc-finding.pdc-sev-medium { border-left: 3px solid var(--warn); }
.pdc-finding.pdc-sev-low { border-left: 3px solid var(--accent); }
.pdc-finding.pdc-sev-info { border-left: 3px solid var(--border-strong); }
.pdc-finding.pdc-sev-critical .pdc-sev-tag,
.pdc-finding.pdc-sev-high .pdc-sev-tag { background: var(--danger-bg); color: var(--danger); }
.pdc-finding.pdc-sev-medium .pdc-sev-tag { background: var(--warn-bg); color: var(--warn); }

/* --- Fix Everything -------------------------------------------------------- */

.pdc-fix-section {
  background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
}
.pdc-fix-head h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.pdc-fix-head p { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.pdc-checkbox-row {
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text);
  margin-bottom: 12px; cursor: pointer;
}
.pdc-checkbox-row input { width: 16px; height: 16px; }
.pdc-price-note { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.pdc-price-note a { color: var(--accent-light); }
.pdc-fix-error {
  background: var(--danger-bg); border: 1px solid var(--danger-border); color: var(--danger);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}
.pdc-fix-error a { color: inherit; text-decoration: underline; }

/* --- Fix result -------------------------------------------------------- */

.pdc-fix-result {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
}
.pdc-fix-result-scores {
  display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 16px;
}
.pdc-fix-result-scores > div { display: flex; flex-direction: column; align-items: center; }
.pdc-fix-result-scores span { font-size: 28px; font-weight: 700; color: var(--text); }
.pdc-fix-result-scores label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.pdc-fix-arrow { color: var(--text-muted); }
.pdc-fix-result ul { margin: 0 0 16px; padding-left: 20px; font-size: 13.5px; color: var(--text); line-height: 1.7; }

/* --- Related tools -------------------------------------------------------- */

.pdc-related-tools { margin-bottom: 16px; }
.pdc-related-tools h4 { font-size: 13px; color: var(--text-muted); font-weight: 600; margin: 0 0 8px; }
.pdc-related-tools-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Technical details -------------------------------------------------------- */

.pdc-details { border-top: 1px solid var(--border); padding-top: 12px; }
.pdc-details summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); }
.pdc-tech-details { margin-top: 14px; }
.pdc-tech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.pdc-tech-grid h4 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 4px; }
.pdc-tech-grid p { font-size: 13.5px; color: var(--text); margin: 0; word-break: break-word; }
.pdc-meta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pdc-meta-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.pdc-meta-table td:first-child { color: var(--text-muted); width: 140px; }

@media (max-width: 640px) {
  .pdc-report-top { flex-direction: column; align-items: flex-start; }
  .pdc-fix-result-scores { gap: 12px; }
}
