/*
 * tool-ux.css — Phase 4 Tool UX Layer
 * Loaded after improvements.css on every tool-*.html page.
 * Adds dropzone polish, trust badges, FAQ styling, CTA panel,
 * and mobile refinements without touching tool logic.
 */

/* ─────────────────────────────────────────────────────────────
   Tool card — upgrade the default .tool-wrap to premium card
   ───────────────────────────────────────────────────────────── */
.tool-wrap {
  border-top: 3px solid var(--brand);
  box-shadow:
    0 2px 12px rgba(37, 99, 235, 0.07),
    0 1px 3px rgba(37, 99, 235, 0.04);
  margin-top: 28px;
  margin-bottom: 0;
}

/* ─────────────────────────────────────────────────────────────
   File-input dropzone treatment
   We style the native <input type="file"> to look like a
   premium dropzone — dashed border, brand hover, branded button.
   ───────────────────────────────────────────────────────────── */
.tool-wrap .tool-input[type="file"] {
  /* Override improvements.css compact 8px padding */
  padding: 28px 20px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  min-height: 120px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  display: block;
}

.tool-wrap .tool-input[type="file"]:hover {
  border-color: var(--brand);
  background: #eff6ff;
}

.tool-wrap .tool-input[type="file"]:focus-visible {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Drag-over state — class added/removed by tool-ux.js */
.tool-wrap.dz-active {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

.tool-wrap.dz-active .tool-input[type="file"] {
  border-color: var(--brand);
  background: #dbeafe;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* File-selector button within dropzone */
.tool-wrap .tool-input[type="file"]::file-selector-button {
  display: block;
  margin: 0 auto 10px;
  background: var(--brand);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.tool-wrap .tool-input[type="file"]:hover::file-selector-button {
  background: var(--brand-hover, #1d4ed8);
}

/* ─────────────────────────────────────────────────────────────
   Trust badge strip
   ───────────────────────────────────────────────────────────── */
.tool-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
}

.tool-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0;
  white-space: nowrap;
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────
   Tool hero / header refinements
   ───────────────────────────────────────────────────────────── */
.tool-head {
  max-width: 720px;
}

.tool-head .eyebrow {
  margin-bottom: 12px;
}

/* ─────────────────────────────────────────────────────────────
   Images-to-PDF drop zone (override old dark theme styles)
   ───────────────────────────────────────────────────────────── */
#img-drop {
  border: 2px dashed #cbd5e1 !important;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%) !important;
  border-radius: 16px !important;
  transition: border-color 0.2s, background 0.2s;
}

#img-drop:hover,
.tool-wrap.dz-active #img-drop {
  border-color: var(--brand) !important;
  background: #eff6ff !important;
}

#img-drop > div:first-child {
  color: var(--text) !important;
  font-weight: 800;
}

#img-drop > div:last-child {
  color: var(--muted) !important;
}

/* ─────────────────────────────────────────────────────────────
   Info sections below the tool (SEO content area)
   ───────────────────────────────────────────────────────────── */
.section.tool-info-section {
  padding-top: 52px;
}

.section.tool-info-section .section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 10px;
  color: var(--text);
}

.section.tool-info-section .section-subtitle {
  max-width: 760px;
  font-size: 15px;
  line-height: 1.8;
}

/* ─────────────────────────────────────────────────────────────
   FAQ section — turn card grid into a clean accordion list
   ───────────────────────────────────────────────────────────── */
.tool-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-top: 16px;
}

.tool-faq-list .card {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  padding: 18px 20px;
  transition: background 0.15s;
}

.tool-faq-list .card:last-child {
  border-bottom: none;
}

.tool-faq-list .card:hover {
  background: #f8fbff;
  transform: none;
}

.tool-faq-list .card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.tool-faq-list .card-title::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  background: var(--brand);
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

.tool-faq-list .card-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
  padding-left: 28px;
}

/* ─────────────────────────────────────────────────────────────
   Related tools grid — enhance existing .grid / .card pattern
   ───────────────────────────────────────────────────────────── */
.related-tools-section .grid {
  margin-top: 16px;
}

.related-tools-section .card {
  display: flex;
  flex-direction: column;
}

.related-tools-section .card-kicker {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand);
  margin-bottom: 6px;
}

.related-tools-section .card-title {
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text);
}

.related-tools-section .card-desc {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  flex: 1;
}

.related-tools-section .card-arrow {
  margin-top: 14px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.related-tools-section a.card:hover .card-arrow {
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────
   Bottom CTA panel — premium gradient card
   ───────────────────────────────────────────────────────────── */
.tool-bottom-cta {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%) !important;
  border: 1px solid #bfdbfe !important;
  border-radius: 24px !important;
  padding: 36px 32px !important;
  text-align: center;
  margin-top: 40px;
}

.tool-bottom-cta .section-title {
  font-size: 22px !important;
  margin-bottom: 10px;
}

.tool-bottom-cta p {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 22px;
}

.tool-bottom-cta > div:last-child {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─────────────────────────────────────────────────────────────
   Privacy note — green tinted callout
   ───────────────────────────────────────────────────────────── */
.tool-privacy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  color: #059669;
  font-size: 13px;
  font-weight: 600;
  margin-top: 14px;
  line-height: 1.5;
}

/* Override existing .tool-note that has plain privacy text */
.tool-wrap .tool-note:has-text {
  /* No override needed — the new privacy note uses its own class */
}

/* ─────────────────────────────────────────────────────────────
   Tool actions — ensure good spacing and hierarchy
   ───────────────────────────────────────────────────────────── */
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Primary action button — always visually dominant */
.tool-actions .btn.primary {
  min-width: 140px;
}

/* ─────────────────────────────────────────────────────────────
   Tool stats grid (word counter, etc.)
   ───────────────────────────────────────────────────────────── */
.stats-grid .stat {
  border-radius: 16px;
}

.stat-value {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--brand);
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────────
   Mobile optimisations
   ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tool-wrap {
    padding: 20px;
  }

  .tool-wrap .tool-input[type="file"] {
    min-height: 100px;
    padding: 22px 16px 16px;
  }

  .tool-trust-strip {
    gap: 6px;
  }

  .tool-trust-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .tool-bottom-cta {
    padding: 24px 20px !important;
  }

  .tool-bottom-cta > div:last-child {
    flex-direction: column;
  }

  .tool-bottom-cta > div:last-child .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .tool-faq-list .card-title {
    font-size: 13.5px;
  }
}

@media (max-width: 420px) {
  .tool-head .tool-title {
    font-size: clamp(28px, 8vw, 40px);
  }
}
