/* ==========================================================================
   ToolFlect Image Converter — styles.css
   Modern, responsive SaaS UI. Single source of truth for the tool's look.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --brand: #5b5ce2;
  --brand-600: #4a4bd0;
  --brand-050: #eef0ff;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --good: #16a34a;
  --good-bg: #ecfdf5;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 10px 30px rgba(16, 24, 40, .08);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(180deg, #f7f8ff 0%, #ffffff 260px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

.container { width: min(1080px, 100% - 2rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .82); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--brand); font-size: 1.35rem; line-height: 1; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-size: 1.05rem; font-weight: 700; }
.brand__tag { font-size: .7rem; color: var(--muted); font-weight: 500; letter-spacing: .02em; }
.site-nav { display: flex; gap: 1.25rem; font-size: .9rem; }
.site-nav__link { color: var(--ink-soft); font-weight: 500; }
.site-nav__link:hover { color: var(--brand); text-decoration: none; }
.site-nav__link.is-active { color: var(--brand); font-weight: 700; }
.site-header__cta { margin-left: .5rem; }

/* ---------- Hero ---------- */
.hero { padding: 3.25rem 0 2rem; text-align: center; }
.breadcrumb { display: flex; gap: .4rem; justify-content: center; align-items: center; font-size: .82rem; color: var(--muted); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--muted); }
.crumb-sep { color: var(--line-strong); }
.hero__title { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: .75rem; }
.hero__subtitle { max-width: 640px; margin: 0 auto 1.5rem; color: var(--ink-soft); font-size: 1.06rem; }
.hero__actions { margin-bottom: 1.5rem; }
.hero__trust { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; justify-content: center; padding: 0; margin: 0; color: var(--muted); font-size: .88rem; }

/* ---------- Tool card ---------- */
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.75rem; margin: .75rem 0 3rem; }
.tool-card__head { margin-bottom: 1.25rem; }
.tool-card__title { font-size: 1.4rem; }
.tool-card__sub { color: var(--muted); margin: 0; font-size: .95rem; }

/* ---------- Dropzone ---------- */
.dz {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
  padding: 2.25rem 1rem;
  text-align: center;
}
.dz:hover, .dz--active { border-color: var(--brand); background: var(--brand-050); }
.dz--active { transform: scale(1.005); }
.dz__icon { color: var(--brand); margin-bottom: .5rem; }
.dz__title { margin: 0; font-weight: 600; font-size: 1.05rem; }
.dz__sub { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.dz__browse { color: var(--brand); font-weight: 600; }
.dz__browse:hover { text-decoration: underline; }
.dz__privacy { margin: .75rem 0 0; color: var(--muted); font-size: .78rem; }
/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .05s ease;
}
.btn:hover { background: var(--surface-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-600); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn--ghost:hover { background: var(--surface-soft); }
.btn--lg { padding: .85rem 1.6rem; font-size: 1rem; }
.btn--sm { padding: .4rem .7rem; font-size: .82rem; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-direction: column; gap: 1rem; margin: 1.25rem 0 1rem; }
.toolbar__row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 180px; }
.field--quality { flex: 1 1 220px; }
.field--size { flex: 1 1 260px; }
.field__label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.field__value { color: var(--brand); font-weight: 700; }
.field--quality.is-disabled { opacity: .5; }
.select, .input {
  font: inherit; font-size: .92rem; color: var(--ink);
  padding: .55rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); width: 100%;
}
.select:focus, .input:focus { outline: 2px solid var(--brand-050); border-color: var(--brand); }
.range { width: 100%; accent-color: var(--brand); }
.size-inputs { display: flex; align-items: center; gap: .5rem; }
.size-inputs .input { flex: 1; min-width: 0; }
.size-x { color: var(--muted); }
.lock { display: inline-flex; align-items: center; gap: .25rem; cursor: pointer; font-size: 1.05rem; user-select: none; }
.lock input { accent-color: var(--brand); }
.toolbar__actions { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- List meta ---------- */
.list-meta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 1rem 0 .5rem; min-height: 1.4rem; }
.list-meta__summary { font-weight: 600; color: var(--ink-soft); }
.list-meta__stats { color: var(--muted); font-size: .88rem; }
.list-meta__stats strong { color: var(--good); }

/* ---------- Image list ---------- */
.image-list { display: flex; flex-direction: column; gap: .75rem; }
.il-card {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.il-thumbwrap { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-soft); display: grid; place-items: center; }
.il-thumb { width: 100%; height: 100%; object-fit: cover; }
.il-spinner { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .55); }
.il-spinner::after {
  content: ""; width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.il-body { min-width: 0; }
.il-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.il-badges { display: flex; align-items: center; gap: .4rem; margin: .2rem 0; }
.badge { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .45rem; border-radius: 999px; }
.badge--src { background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line); }
.badge--dst { background: var(--brand-050); color: var(--brand-600); }
.il-arrow { color: var(--line-strong); font-size: .8rem; }
.il-status { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .84rem; color: var(--ink-soft); }
.il-status-text--working { color: var(--brand); }
.il-status-text--good { color: var(--good); }
.il-status-text--bad { color: var(--bad); }
.il-savings { font-weight: 700; font-size: .78rem; padding: .1rem .45rem; border-radius: 999px; }
.il-savings--good { background: var(--good-bg); color: var(--good); }
.il-savings--bad { background: var(--amber-bg); color: var(--amber); }
.il-savings--neutral { background: var(--surface-soft); color: var(--muted); }
.il-error { color: var(--bad); font-size: .78rem; margin-top: .15rem; }
.il-actions { display: flex; align-items: center; gap: .4rem; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 2rem 0; font-size: .92rem; }
.app-error { color: var(--bad); font-weight: 600; }
/* ---------- SEO sections ---------- */
.seo-section { margin: 3rem 0; }
.seo-section__title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 1.25rem; }

/* How-to */
.ht-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.ht-step { display: flex; gap: 1rem; align-items: flex-start; }
.ht-step__num {
  flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 999px;
  background: var(--brand-050); color: var(--brand-600); font-weight: 800;
  display: grid; place-items: center; margin-top: .1rem;
}
.ht-step__title { margin: 0 0 .15rem; font-size: 1.02rem; }
.ht-step__text { margin: 0; color: var(--ink-soft); font-size: .92rem; }

/* Comparison table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.comparison-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 480px; }
.comparison-table th, .comparison-table td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
.comparison-table thead th { background: var(--surface-soft); font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.comparison-table tbody tr:last-child th, .comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody th { font-weight: 600; color: var(--ink); }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.faq-item__q { cursor: pointer; padding: .85rem 1rem; font-weight: 600; font-size: .95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item__q::after { content: "+"; font-size: 1.2rem; color: var(--brand); transition: transform .15s ease; }
.faq-item[open] .faq-item__q::after { transform: rotate(45deg); }
.faq-item__a { padding: 0 1rem 1rem; color: var(--ink-soft); font-size: .9rem; }

/* Related tools */
.related-tools { display: flex; flex-wrap: wrap; gap: .6rem; }
.rt-chip {
  display: inline-block; padding: .5rem .9rem; border: 1px solid var(--line);
  border-radius: 999px; color: var(--ink-soft); font-size: .85rem; font-weight: 500;
  transition: border-color .15s ease, background .15s ease;
}
.rt-chip:hover { border-color: var(--brand); background: var(--brand-050); text-decoration: none; }

/* ---------- Mode panels (social / svg / kb) ---------- */
.mode-panel { margin-top: 1rem; }
.mode-hint { margin: .5rem 0 0; color: var(--muted); font-size: .85rem; }
.preset-bar { display: flex; flex-wrap: wrap; gap: .6rem; }
.preset-chip {
  display: inline-flex; flex-direction: column; align-items: center; gap: .1rem;
  padding: .55rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.preset-chip:hover { border-color: var(--brand); background: var(--brand-050); }
.preset-chip small { font-size: .72rem; color: var(--muted); }

/* ---------- Tools directory grid (landing page) ---------- */
.tools-directory { margin-top: 3rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; margin-top: 1rem; }
.tools-grid__card {
  display: flex; flex-direction: column; gap: .25rem; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tools-grid__card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.tools-grid__card strong { font-size: .92rem; }
.tools-grid__card small { font-size: .76rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.75rem 0; color: var(--muted); font-size: .85rem; text-align: center; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; margin-bottom: .75rem; font-weight: 500; }
.site-footer__nav a { color: var(--ink-soft); }
.site-footer__nav a:hover { color: var(--brand); }
.site-footer__nav--legal { font-size: .8rem; gap: 1rem; }
.site-footer__nav--legal a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .tool-card { padding: 1.1rem; }
  .il-card { grid-template-columns: 48px 1fr; gap: .75rem; }
  .il-thumbwrap { width: 48px; height: 48px; }
  .il-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .toolbar__row { gap: .85rem; }
  .field { min-width: 100%; }
  .hero { padding-top: 2.5rem; }
  .site-header__cta { display: none; }
  .brand__tag { display: none; }
  .site-nav { gap: .9rem; }
}


