/* ============================================================
   ZeeSharp – Shared Tool Page Styles
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #1a73e8; --blue-dark: #1558b0; --blue-light: #e8f0fe;
  --text: #202124; --text-sec: #5f6368; --border: #dadce0;
  --bg: #ffffff; --bg-alt: #f8f9fa; --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(60,64,67,.15);
  --shadow-md: 0 4px 12px rgba(60,64,67,.15);
  --green: #137333; --green-bg: #e6f4ea;
  --red: #c5221f;   --red-bg: #fce8e6;
  --orange: #b06000; --orange-bg: #fef3e2;
}

html { scroll-behavior: smooth; }
body { font-family: 'Google Sans', 'Segoe UI', Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { text-decoration: none; color: inherit; }

/* ── Navbar (reuse main site) ── */
.navbar { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; }
.nav-logo .logo-icon { width: 30px; height: 30px; background: var(--blue); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .9rem; }
.nav-logo .brand-dot { color: var(--blue); }
.nav-right { display: flex; align-items: center; gap: 8px; }
.nav-link { padding: 7px 14px; font-size: .875rem; color: var(--text-sec); border-radius: 20px; transition: background .2s; }
.nav-link:hover { background: var(--bg-alt); color: var(--text); }

/* ── Breadcrumb ── */
.breadcrumb { padding: 12px 24px; font-size: .82rem; color: var(--text-sec); max-width: 1100px; margin: 0 auto; width: 100%; }
.breadcrumb a { color: var(--blue); }
.breadcrumb span { margin: 0 6px; color: var(--border); }

/* ── Tool Hero ── */
.tool-hero { padding: 28px 24px 24px; max-width: 1100px; margin: 0 auto; width: 100%; display: flex; align-items: center; gap: 18px; }
.tool-hero-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex-shrink: 0; }
.tool-hero-title { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.tool-hero-desc { font-size: .9rem; color: var(--text-sec); margin-top: 5px; }
.tool-badges { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tool-badge { padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-free    { background: var(--green-bg); color: var(--green); }
.badge-browser { background: var(--blue-light); color: var(--blue); }
.badge-fast    { background: var(--orange-bg); color: var(--orange); }

/* ── Main tool area ── */
.tool-body { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 0 24px 48px; }

/* ── Upload zone ── */
.upload-zone {
  border: 2.5px dashed var(--border); border-radius: 16px; padding: 52px 32px;
  text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
  background: var(--bg-alt); position: relative;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); background: var(--blue-light); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-icon { font-size: 3rem; margin-bottom: 12px; }
.upload-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; }
.upload-hint  { font-size: .85rem; color: var(--text-sec); }
.upload-formats { margin-top: 12px; font-size: .75rem; color: var(--text-sec); }

/* ── Settings bar ── */
.settings-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 20px;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin: 16px 0;
}
.setting-group { display: flex; align-items: center; gap: 10px; }
.setting-group label { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.quality-slider { -webkit-appearance: none; appearance: none; width: 140px; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--blue) var(--pct,70%), var(--border) var(--pct,70%)); outline: none; cursor: pointer; }
.quality-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--blue); cursor: pointer; box-shadow: var(--shadow-sm); }
.quality-val { font-size: .82rem; font-weight: 700; color: var(--blue); min-width: 32px; }
.format-select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .82rem; background: var(--bg); cursor: pointer; }
.maxw-input  { width: 80px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: .82rem; }
.compress-btn { margin-left: auto; padding: 9px 24px; background: var(--blue); color: #fff; border: none; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; white-space: nowrap; }
.compress-btn:hover:not(:disabled) { background: var(--blue-dark); }
.compress-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Stats summary bar ── */
.stats-bar { display: flex; gap: 24px; flex-wrap: wrap; margin: 8px 0 20px; padding: 14px 20px; background: var(--green-bg); border-radius: var(--radius); display: none; }
.stats-bar.visible { display: flex; }
.stat-item { font-size: .85rem; }
.stat-item strong { color: var(--green); }
.download-all-btn { margin-left: auto; padding: 7px 18px; background: var(--green); color: #fff; border: none; border-radius: 7px; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; }
.download-all-btn:hover { background: #0d5c28; }

/* ── Results grid ── */
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.result-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.result-card:hover { box-shadow: var(--shadow-md); }

.result-preview { position: relative; background: #f0f0f0; height: 180px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.result-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.result-preview .processing-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-info { padding: 14px 16px; }
.result-name { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.size-row { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-sec); margin-bottom: 6px; }
.size-bar-wrap { height: 6px; background: var(--border); border-radius: 3px; margin-bottom: 10px; overflow: hidden; }
.size-bar { height: 100%; border-radius: 3px; background: var(--blue); transition: width .5s ease; }
.saving-badge { display: inline-block; padding: 3px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700; margin-bottom: 10px; }
.saving-great  { background: var(--green-bg);  color: var(--green); }
.saving-good   { background: var(--blue-light); color: var(--blue); }
.saving-low    { background: var(--orange-bg);  color: var(--orange); }
.result-actions { display: flex; gap: 8px; }
.dl-btn { flex: 1; padding: 8px; background: var(--blue); color: #fff; border: none; border-radius: 6px; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .2s; font-family: inherit; }
.dl-btn:hover { background: var(--blue-dark); }
.dl-btn.outline { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.dl-btn.outline:hover { background: var(--blue-light); }

/* ── How it works section ── */
.how-it-works { margin: 40px 0 0; }
.how-it-works h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.step { padding: 20px; background: var(--bg-alt); border-radius: var(--radius); }
.step-num { width: 28px; height: 28px; background: var(--blue); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 700; margin-bottom: 10px; }
.step h3 { font-size: .875rem; font-weight: 700; margin-bottom: 4px; }
.step p  { font-size: .8rem; color: var(--text-sec); line-height: 1.5; }

/* ── Related tools ── */
.related-tools { margin: 40px 0 0; }
.related-tools h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.related-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; transition: box-shadow .2s, border-color .2s; cursor: pointer; }
.related-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.related-card .ri { font-size: 1.6rem; margin-bottom: 8px; }
.related-card h4 { font-size: .8rem; font-weight: 600; }
.related-card p  { font-size: .72rem; color: var(--text-sec); margin-top: 3px; }

/* ── Footer ── */
footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-text { font-size: .8rem; color: var(--text-sec); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: .8rem; color: var(--text-sec); transition: color .2s; }
.footer-links a:hover { color: var(--blue); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .tool-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .settings-bar { flex-direction: column; align-items: flex-start; }
  .compress-btn { width: 100%; justify-content: center; }
  .results-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   FAQ + Related (injected by tool-seo.js)
   both live inside .tool-body so max-width
   and padding come from there automatically
   ========================================== */
.tool-faq    { margin: 48px 0 0; }
.related-tools { margin-top: 40px; }
.tool-faq h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: border-color .15s;
}
.faq-item[open] { border-color: var(--blue); }
.faq-q {
  padding: 14px 18px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--blue);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] .faq-q::after { content: '−'; }
.faq-q:hover { background: var(--bg-alt); }
.faq-a {
  padding: 0 18px 16px;
  font-size: .875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
