/* ==========================================================================
   Shared tool-site design system.
   Theme is controlled entirely by the :root accent variables below, so this
   exact file is reused across all three repos with only the accent changed.
   ========================================================================== */

:root {
  --accent: #e23b3b;        /* File Format Converter = crimson (Documents) */
  --accent-dark: #b91c1c;
  --accent-soft: #fdecec;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1c2230;
  --muted: #5b6472;
  --border: #e4e7ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --maxw: 1180px;
  --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.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; height: auto; }

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

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 800;
}
/* Image brand mark: no gradient chip, just the transparent logo. */
.brand .logo-img {
  background: none; border-radius: 0; width: auto; height: 48px;
}
.brand .logo-img img { display: block; width: auto; height: 48px; }
.brand .accent { color: var(--accent); }
/* Navigation lives in a hamburger dropdown at every screen size. */
.nav-toggle { display: block; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--text); line-height: 1; }
.main-nav {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 20px;
  min-width: 240px;
  background: var(--surface);
  flex-direction: column;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
  gap: 2px;
}
.main-nav.open { display: flex; }
.main-nav a { color: var(--muted); font-weight: 600; font-size: 15px; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.main-nav a:last-child { border-bottom: 0; }
.main-nav a:hover { color: var(--accent-dark); text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 44px); margin: 0 0 12px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--muted); max-width: 680px; margin: 0 auto; }

/* ---------- Tool grid ---------- */
.section-title { font-size: 22px; margin: 36px 0 16px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: block; transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.tool-card .ico { font-size: 24px; }
.tool-card h3 { margin: 10px 0 4px; font-size: 17px; color: var(--text); }
.tool-card p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Tool page layout ---------- */
.tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 28px 0 60px; align-items: start; }
@media (max-width: 980px) { .tool-layout { grid-template-columns: 1fr; } .sidebar { display: none; } }

.breadcrumbs { font-size: 13px; color: var(--muted); padding: 14px 0 0; }
.breadcrumbs a { color: var(--muted); }

.tool-main h1 { font-size: clamp(24px, 4vw, 34px); margin: 6px 0 8px; letter-spacing: -0.02em; }
.tool-intro { color: var(--muted); font-size: 17px; margin: 0 0 22px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px;
}

/* Tool-page enhancements (injected by main.js) */
.privacy-note {
  display: flex; gap: 12px; align-items: flex-start;
  background: #effaf3; border: 1px solid #c6ebd4; border-radius: 12px;
  padding: 14px 16px; margin: 0 0 24px;
}
.privacy-note__icon { font-size: 18px; line-height: 1.5; }
.privacy-note p { margin: 0; font-size: 14px; color: #285c3c; }
.privacy-note strong { color: #1d4d31; }
.back-to-tool { margin: 6px 0 8px; }
.back-to-tool a { font-weight: 600; font-size: 14px; }

/* Feedback widget (injected by main.js inside the tool card, revealed after a tool runs) */
.feedback {
  border-top: 1px solid var(--border);
  margin: 20px 0 0; padding: 20px 0 0;
  animation: feedback-in .25s ease both;
}
@keyframes feedback-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.feedback__title { margin: 0 0 12px; font-size: 17px; }
.feedback__stars { display: flex; gap: 4px; margin-bottom: 14px; }
.feedback__star {
  background: none; border: 0; padding: 0 2px; cursor: pointer; line-height: 1;
  font-size: 30px; color: #d4d8e0; transition: color .12s, transform .12s;
}
.feedback__star:hover { transform: scale(1.1); }
.feedback__star.on { color: #f5b50a; }
.feedback__star:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.feedback__label { font-weight: 600; font-size: 14px; }
.feedback__text { margin-top: 6px; min-height: 78px; }
.feedback__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.feedback__row { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.feedback__msg { font-size: 14px; color: var(--muted); }

/* Offset anchored sections so the sticky header doesn't cover them */
#tool, #how-to-use { scroll-margin-top: 84px; }

/* ---------- Form controls ---------- */
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
input[type=text], input[type=number], input[type=url], input[type=email], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 15px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 20px; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .12s;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn.secondary { background: #eef0f4; color: var(--text); }
.btn.secondary:hover { background: #e2e6ec; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px 20px;
  text-align: center; color: var(--muted); cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { color: var(--accent-dark); }

/* Result / output */
.result { background: var(--accent-soft); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.result .big { font-size: 32px; font-weight: 800; color: var(--accent-dark); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.file-list { list-style: none; padding: 0; margin: 14px 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-size: 14px; background:#fff;}
.file-list button { background: none; border: 0; color: var(--accent-dark); cursor: pointer; font-size: 14px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
table.data th { background: #f1f3f7; }

/* ---------- Content (SEO copy) ---------- */
.content { max-width: 760px; }
.content h2 { font-size: 22px; margin: 34px 0 12px; }
.content h3 { font-size: 18px; margin: 22px 0 8px; }
.content p, .content li { color: #36404f; }
.content ol, .content ul { padding-left: 22px; }
.faq dt { font-weight: 700; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: #36404f; }

.related { margin-top: 8px; }
.related a { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); font-weight: 600; }

/* ---------- Ad slots (CLS-safe: reserve space) ---------- */
.ad {
  display: block; margin: 22px auto; text-align: center; overflow: hidden;
  background: #f0f1f4; border: 1px solid var(--border); border-radius: 10px;
}
.ad::before { content: "Advertisement"; display: block; font-size: 11px; color: #9aa3b2; padding: 4px; letter-spacing: .05em; }
.ad-leaderboard { min-height: 114px; }   /* 90 + label/padding */
.ad-rectangle { min-height: 274px; max-width: 336px; }
.ad-inarticle { min-height: 274px; }
.ad-sidebar { min-height: 624px; position: sticky; top: 84px; }
.ad-anchor { position: fixed; bottom: 0; left: 0; right: 0; min-height: 64px; margin: 0; z-index: 60;
  border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.ad-anchor .close { position: absolute; right: 6px; top: 2px; background:none;border:0;font-size:16px;cursor:pointer;color:#9aa3b2;}
@media (min-width: 981px) { .ad-anchor { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; padding: 36px 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.site-footer a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.site-footer .copy { margin-top: 24px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 18px; }
.badge { display:inline-block; background: var(--accent-soft); color: var(--accent-dark); font-size:12px; font-weight:700;
  padding: 3px 10px; border-radius: 999px; }
.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%;
  display:inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
