/* ==========================================================================
   LocalConverter — converters + marketing/SEO content.
   Restyles the pre-existing sections onto the app's design tokens so the
   page reads as one product. Class names are preserved because the GA
   event-tracking code and the FAQ schema both depend on this markup.
   ========================================================================== */

.content-region { max-width: var(--max-width); margin: 0 auto; padding: 0 20px 56px; }

/* Converter landing pages have no analysis workspace between the intro and
   their first section, so keep the Convert divider attached to the intro. */
body[data-page="image-converter"] .app-main,
body[data-page="video-converter"] .app-main { padding-bottom: 0; }
body[data-page="image-converter"] .content-region > .section-divider:first-child,
body[data-page="video-converter"] .content-region > .section-divider:first-child { margin-top: 16px; }

.section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
}

.section-title {
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-lede { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 20px; max-width: 78ch; }

.section-divider {
  display: flex; align-items: center; gap: 14px;
  margin: 40px 0 22px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.09em;
}
.section-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --------------------------------------------------------------------------
   Converters
   -------------------------------------------------------------------------- */

.file-drop-zone {
  display: grid; place-items: center; gap: 3px;
  padding: 30px 20px;
  text-align: center;
  background: var(--surface-2);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop-zone:hover { border-color: var(--accent-line); background: var(--surface-3); }
.file-drop-zone.dragover { border-color: var(--accent); border-style: solid; background: var(--accent-dim); }
.file-drop-zone p { margin: 0; font-size: 14px; }
.file-drop-zone p + p { color: var(--text-muted); font-size: 12.5px; }
.upload-icon { font-size: 28px; line-height: 1; margin-bottom: 6px; opacity: 0.85; }
.batch-upload { margin-top: 9px; font-size: 12px; color: var(--text-muted); }
.file-input { display: none; }

.file-list { display: none; margin-top: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.file-list .file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 13px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-subtle);
}
.file-list .file-item:first-child { border-top: 0; }
.file-details { min-width: 0; flex: 1; }
.file-name { font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.file-remove {
  border: 0; background: transparent; color: var(--text-muted);
  font-size: 18px; line-height: 1; cursor: pointer;
  padding: 3px 7px; border-radius: 4px;
}
.file-remove:hover { color: var(--danger); background: var(--danger-dim); }

.format-selector { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.format-btn {
  padding: 7px 15px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}
.format-btn:hover { color: var(--text); border-color: var(--text-muted); }
.format-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.quality-controls {
  display: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
}
.quality-controls h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 14px; }
.quality-group { margin-bottom: 14px; }
.quality-group:last-child { margin-bottom: 0; }
.quality-group label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; }
.quality-group small { display: block; margin-top: 5px; color: var(--text-muted); font-size: 11.5px; }

.slider-container { display: flex; align-items: center; gap: 13px; }
.quality-slider {
  flex: 1; height: 4px; border-radius: 3px;
  background: var(--border-strong);
  appearance: none; -webkit-appearance: none; outline: none;
}
.quality-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); cursor: pointer;
  border: 2px solid var(--surface-1);
  box-shadow: 0 0 0 1px var(--accent);
}
.quality-slider::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--surface-1);
}
.quality-value {
  min-width: 52px; text-align: center;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 3px 7px;
}

.resolution-select, .number-input {
  width: 100%; max-width: 320px;
  padding: 7px 10px;
  font: inherit; font-size: 13.5px;
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.resolution-select:focus, .number-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.number-input { max-width: 130px; }
.dimension-row { display: flex; gap: 10px; align-items: center; }

.convert-btn {
  position: relative;
  width: 100%;
  padding: 11px 20px;
  font: inherit; font-size: 14.5px; font-weight: 620;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s ease;
}
.convert-btn:hover:not(:disabled) { background: var(--accent-hover); }
.convert-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.convert-btn .btn-loader { display: none; }
.spinner {
  width: 17px; height: 17px; margin: 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-container { display: none; margin-top: 16px; }
.progress-bar { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.25s ease; }
.progress-text { margin-top: 8px; font-size: 13px; color: var(--text-secondary); }
.batch-progress { margin-top: 3px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); }

.result-container {
  display: none; margin-top: 16px;
  background: var(--ok-dim);
  border: 1px solid color-mix(in srgb, var(--ok) 26%, transparent);
  border-radius: var(--radius);
  padding: 15px;
}
.result-container > p { color: var(--ok); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.download-section { display: flex; flex-wrap: wrap; gap: 8px; }
.download-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  font: inherit; font-size: 13px; font-weight: 550;
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
}
.download-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.download-all-btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.download-all-btn:hover { background: var(--accent-hover); color: #fff; }

.size-warning, .error-message {
  display: none;
  margin: 14px 0;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
}
.size-warning { background: var(--warn-dim); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent); color: var(--warn); }
.error-message { background: var(--danger-dim); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); color: var(--danger); }

/* --------------------------------------------------------------------------
   Format reference, steps, notes
   -------------------------------------------------------------------------- */

.format-reference {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
}
.format-reference h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 12px; }
.format-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px 20px; font-size: 13px; }
.format-grid strong { color: var(--text); }
.format-grid div { color: var(--text-secondary); }

.step-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin: 22px 0; }
.step { text-align: center; padding: 4px; }
.step-icon { font-size: 30px; margin-bottom: 10px; line-height: 1; }
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { color: var(--text-secondary); font-size: 13.5px; }

.note {
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 18px;
  margin: 20px 0;
}
.note h3 { font-size: 15px; margin-bottom: 12px; }
.note-ok { border-left-color: var(--ok); }
.note-ok h3 { color: var(--ok); }
.note-warn { border-left-color: var(--warn); background: var(--warn-dim); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; font-size: 13.5px; color: var(--text-secondary); }
.note-grid strong { color: var(--text); }

.pitch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px; }
.pitch-grid h3 { font-size: 15px; margin-bottom: 7px; color: var(--accent); }
.pitch-grid p { color: var(--text-secondary); font-size: 13.5px; }

.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.callout strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */

.stats-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 22px;
}
.stats-section h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.stat-item { text-align: center; }
.stat-number { font-family: var(--font-mono); font-size: 24px; font-weight: 650; color: var(--accent); letter-spacing: -0.02em; }
.stat-item div:last-child { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Feature cards
   -------------------------------------------------------------------------- */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 22px; }
.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.15s ease;
}
.feature-card:hover { border-color: var(--border-strong); }
.feature-icon { font-size: 24px; margin-bottom: 10px; line-height: 1; }
.feature-card h3 { font-size: 15px; margin-bottom: 6px; }
.feature-card p { color: var(--text-secondary); font-size: 13.5px; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-container { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; }

.faq-question {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%;
  padding: 14px 17px;
  font: inherit; font-size: 14px; font-weight: 550; text-align: left;
  color: var(--text);
  background: var(--surface-1);
  border: 0;
  cursor: pointer;
  transition: background 0.12s ease;
}
.faq-question:hover { background: var(--surface-2); }
.faq-toggle { flex-shrink: 0; font-size: 17px; color: var(--text-muted); transition: transform 0.2s ease; line-height: 1; }
.faq-question.active { color: var(--accent); }
.faq-question.active .faq-toggle { transform: rotate(45deg); color: var(--accent); }

.faq-answer { display: none; padding: 0 17px 15px; background: var(--surface-1); }
.faq-answer.active { display: block; }
.faq-answer p { color: var(--text-secondary); font-size: 13.5px; }
.faq-answer strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Offline indicator
   -------------------------------------------------------------------------- */

.offline-indicator {
  display: none;
  position: fixed; top: 12px; right: 12px; z-index: 150;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 550;
  background: var(--surface-3);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}
.offline-indicator.offline { background: var(--warn-dim); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 20px 34px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer p { margin-bottom: 6px; }

.footer-nav {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
}
.footer-nav span { color: var(--text-secondary); font-weight: 550; }

@media (max-width: 620px) {
  .content-region { padding: 0 14px 40px; }
  .section { padding: 18px 16px; }
  .stats-section { padding: 16px; }
  .format-grid { grid-template-columns: 1fr; }

  /* The header runs out of room first; the badge is decorative next to the
     brand and the theme toggle, so it is the one that goes. */
  .header-badge { display: none; }

  /* Anchored top-right, this indicator collided with the brand. Move it
     clear of the header entirely on small screens. */
  .offline-indicator {
    top: auto;
    bottom: 12px;
    left: 12px;
    right: 12px;
    text-align: center;
  }
}
