/* ════════════════════════════════════════════════════════════════════
   PDFOne — Shared Tool Page Styles
   ════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:        #E5252A;
  --red-dark:   #B71C1C;
  --red-light:  #FFEBEE;
  --text:       #1a1a1a;
  --text-dark:  #2B2D33;
  --muted:      #6b7280;
  --border:     #E0E0E0;
  --bg:         #ffffff;
  --bg-alt:     #F9FAFB;
  --green:      #059669;
  --green-light:#ECFDF5;
  --radius:     16px;
  --shadow:     0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
  max-width: 880px;
}
.nav-logo { display: flex; align-items: center; gap: 9px; }
.nav-logo img { width: 30px; height: 30px; border-radius: 7px; }
.nav-logo span { font-weight: 800; font-size: 16px; color: var(--text-dark); }
.nav-logo span em { color: var(--red); font-style: normal; }
.nav-back {
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
}
.nav-back:hover { color: var(--red); }
.nav-back svg { width: 16px; height: 16px; }

/* ── Tool header ────────────────────────────────────────────────────── */
.tool-header { text-align: center; padding: 40px 20px 8px; }
.tool-icon {
  width: 60px; height: 60px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 16px;
}
.tool-header h1 { font-size: 26px; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; }
.tool-header p { font-size: 14.5px; color: var(--muted); max-width: 460px; margin: 0 auto; }

/* ── Card / workspace ───────────────────────────────────────────────── */
.workspace { padding: 32px 20px 64px; }
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px; max-width: 640px; margin: 0 auto;
}

/* ── Dropzone ───────────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  background: var(--bg-alt);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--red);
  background: var(--red-light);
}
.dropzone svg { width: 44px; height: 44px; color: var(--red); margin-bottom: 14px; }
.dropzone h3 { font-size: 15.5px; font-weight: 700; color: var(--text-dark); margin-bottom: 5px; }
.dropzone p { font-size: 12.5px; color: var(--muted); }
.dropzone input[type=file] { display: none; }

/* ── File list ──────────────────────────────────────────────────────── */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px;
}
.file-row.dragging { opacity: 0.4; }
.file-icon {
  width: 36px; height: 36px; border-radius: 9px; background: var(--red-light);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13.5px; font-weight: 600; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 11.5px; color: var(--muted); }
.file-remove {
  width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s ease, color .15s ease;
}
.file-remove:hover { background: #FEE2E2; color: var(--red); }
.drag-handle { cursor: grab; color: var(--muted); flex-shrink: 0; }
.drag-handle:active { cursor: grabbing; }

/* ── Options panel ──────────────────────────────────────────────────── */
.options { margin-top: 22px; display: flex; flex-direction: column; gap: 16px; }
.option-label { font-size: 13px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; display: block; }
.option-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip-option {
  padding: 9px 16px; border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 600; color: var(--text-dark);
  cursor: pointer; transition: all .15s ease;
}
.chip-option:hover { border-color: var(--red); }
.chip-option.selected { background: var(--red); border-color: var(--red); color: #fff; }
.text-input, .num-input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--border);
  font-size: 14px; font-family: inherit; color: var(--text-dark); outline: none;
}
.text-input:focus, .num-input:focus { border-color: var(--red); }
.range-row { display: flex; gap: 10px; align-items: center; }
.range-row .num-input { width: 90px; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--red); }
.slider-val { font-size: 13px; font-weight: 700; color: var(--red); width: 50px; text-align: right; }

/* ── Page picker grid (for extract/remove pages) ───────────────────── */
.page-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  max-height: 280px; overflow-y: auto; padding: 4px;
}
.page-thumb {
  aspect-ratio: 0.75; border-radius: 8px; border: 2px solid var(--border);
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-dark); cursor: pointer;
  transition: all .12s ease; position: relative;
}
.page-thumb:hover { border-color: var(--red); }
.page-thumb.selected { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 24px; border-radius: 14px;
  font-weight: 700; font-size: 15px; cursor: pointer; border: none;
  transition: transform .15s ease, opacity .15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(229,37,42,0.25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-outline { background: #fff; color: var(--text-dark); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-secondary { background: var(--bg-alt); color: var(--text-dark); }
.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-row .btn { width: auto; flex: 1; }

/* ── Progress ───────────────────────────────────────────────────────── */
.progress-wrap { text-align: center; padding: 40px 20px; }
.spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid var(--red-light); border-top-color: var(--red);
  margin: 0 auto 20px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-wrap h3 { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.progress-wrap p { font-size: 13px; color: var(--muted); }
.progress-bar-track {
  width: 100%; max-width: 280px; height: 6px; border-radius: 3px;
  background: var(--border); margin: 16px auto 0; overflow: hidden;
}
.progress-bar-fill { height: 100%; background: var(--red); border-radius: 3px; transition: width .2s ease; width: 0%; }

/* ── Result state ───────────────────────────────────────────────────── */
.result-wrap { text-align: center; padding: 20px; }
.result-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--green-light);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  margin: 0 auto 18px; color: var(--green);
}
.result-wrap h3 { font-size: 19px; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; }
.result-wrap p.filename { font-size: 13.5px; color: var(--muted); margin-bottom: 24px; word-break: break-all; }
.result-stats {
  display: flex; justify-content: center; gap: 24px; margin-bottom: 24px;
  font-size: 12.5px; color: var(--muted);
}
.result-stats strong { display: block; font-size: 16px; color: var(--text-dark); }

/* ── Error banner ───────────────────────────────────────────────────── */
.error-banner {
  background: #FEF2F2; border: 1px solid #FECACA; color: #B91C1C;
  border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 14px;
  display: none; align-items: flex-start; gap: 8px;
}
.error-banner.show { display: flex; }

/* ── Privacy note ───────────────────────────────────────────────────── */
.privacy-note {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-top: 24px;
}
.privacy-note svg { width: 14px; height: 14px; color: var(--green); }

/* ── Footer ─────────────────────────────────────────────────────────── */
footer {
  text-align: center; padding: 32px 20px; color: var(--muted); font-size: 12.5px;
  border-top: 1px solid var(--border); background: #fff;
}
footer a { color: var(--red); }

/* ── FAQ section (SEO content block) ──────────────────────────────── */
.faq-section {
  max-width: 640px; margin: 0 auto; padding: 8px 20px 48px;
}
.faq-section h2 {
  font-size: 20px; font-weight: 800; color: var(--text-dark);
  text-align: center; margin-bottom: 22px;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 4px;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  font-size: 14.5px; font-weight: 700; color: var(--text-dark);
  margin-bottom: 6px;
}
.faq-a {
  font-size: 13.5px; color: var(--muted); line-height: 1.65;
}

@media (max-width: 560px) {
  .card { padding: 22px; }
  .tool-header h1 { font-size: 22px; }
  .page-grid { grid-template-columns: repeat(4, 1fr); }
  .result-stats { gap: 16px; }
}
