/* ImageTools — shared styles. Keep it lean, fast, and readable. */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef0f4;
  --border: #e3e6eb;
  --text: #1a1d21;
  --text-muted: #5b6270;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 860px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo { font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.nav a { color: var(--text-muted); font-size: 14px; margin-left: 20px; }
.nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: 32px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { color: var(--text-muted); font-size: 17px; margin: 0 auto; max-width: 620px; }

/* Dropzone */
.dropzone {
  margin: 32px auto 0;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: #eff4ff;
}
.dropzone .dz-icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 600; font-size: 16px; }
.dropzone .dz-hint { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.dropzone input[type="file"] { display: none; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.btn:hover { background: var(--brand-hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface); }

/* Results */
.results { list-style: none; padding: 0; margin: 24px 0 0; }
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--bg);
}
.result-meta { min-width: 0; }
.result-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-status { font-size: 13px; color: var(--text-muted); }
.result-status.ok { color: var(--ok); }
.result-status.err { color: var(--err); }
.result-actions { flex-shrink: 0; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ad slots — placeholders until AdSense is approved */
.ad-slot {
  margin: 32px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: #b6bcc7;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--surface);
}

/* Content sections */
.section { padding: 40px 0; border-top: 1px solid var(--border); }
.section h2 { font-size: 22px; margin: 0 0 16px; letter-spacing: -0.01em; }
.section h3 { font-size: 17px; margin: 24px 0 8px; }
.section p, .section li { color: var(--text-muted); }
.section ul { padding-left: 20px; }
.section li { margin-bottom: 6px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 16px;
  margin-bottom: 10px;
  background: var(--bg);
}
.faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; }

/* Tool grid on homepage */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
  background: var(--bg);
}
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.tool-card .tc-icon { font-size: 26px; }
.tool-card .tc-title { font-weight: 700; color: var(--text); margin-top: 10px; }
.tool-card .tc-desc { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 14px;
}
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--text-muted); margin-left: 16px; }
.site-footer a:hover { color: var(--text); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .dropzone { padding: 40px 16px; }
  .result-item { flex-direction: column; align-items: flex-start; }
  .result-actions { width: 100%; }
  .result-actions .btn { width: 100%; text-align: center; }
}
