/* ============================================================
   SQF Cleaner — tool stylesheet
   dze.armatools.com/sqf-cleaner
   ============================================================ */
:root {
  --bg:          #0d0d0d;
  --bg-panel:    #111111;
  --bg-card:     #1c1c1c;
  --bg-card2:    #222222;
  --border:      #2a2a2a;
  --border-hi:   #3e5a28;
  --accent:      #4e8a2e;
  --accent-hi:   #62ae3a;
  --accent-dim:  #2e5018;
  --text:        #d0d0d0;
  --text-muted:  #5e5e5e;
  --text-hi:     #eaeaea;
  --danger:      #c0392b;
  --danger-hi:   #e74c3c;
  --success:     #27ae60;
  --success-hi:  #2ecc71;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.55);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:        'Consolas', 'Courier New', monospace;
  --max-w:       min(960px, 96vw);
}

/* ============================================================
   LIGHT MODE OVERRIDES
   ============================================================ */
[data-theme="light"] {
  --bg:          #f5f5f4;
  --bg-panel:    #ececea;
  --bg-card:     #ffffff;
  --bg-card2:    #f0f0ee;
  --border:      #cccccc;
  --border-hi:   #5a9e30;
  --accent:      #3d7020;
  --accent-hi:   #2e5818;
  --accent-dim:  #cce4b0;
  --text:        #222222;
  --text-muted:  #666666;
  --text-hi:     #111111;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
}

[data-theme="light"] code {
  background: #eef4e8;
  border-color: #b8d898;
  color: #2e6010;
}

[data-theme="light"] .tool-header {
  background: #e8f2de;
  border-bottom-color: #b8d4a0;
}

[data-theme="light"] .privacy-card {
  background: #e8f4de;
  border-color: #a0c880;
  color: #2e6010;
}
[data-theme="light"] .privacy-card strong { color: #1a4a08; }

[data-theme="light"] .file-list li { border-bottom-color: #e0e0de; }
[data-theme="light"] .file-list li:hover { background: #f0f4ec; }

[data-theme="light"] .ext-sqf { background: #d8f0c8; color: #2a6010; border-color: #98c870; }
[data-theme="light"] .ext-hpp { background: #c8e4f4; color: #1860a0; border-color: #80b8d8; }
[data-theme="light"] .ext-ext { background: #f4e8c8; color: #8a5c10; border-color: #c8a060; }

[data-theme="light"] .option-row:hover { background: #edf6e4; border-color: var(--accent-dim); }

[data-theme="light"] .option-tag { border-color: #90c060; }
[data-theme="light"] .option-tag.recommended { background: #d8f0c0; color: #2a6010; border-color: #80b850; }

[data-theme="light"] .tool-header-link {
  color: #2e6010;
  border-color: #90c060;
}
[data-theme="light"] .tool-header-link:hover {
  background: #d8f0c0;
  color: #1a4008;
  border-color: var(--accent);
}

[data-theme="light"] .drop-zone:hover,
[data-theme="light"] .drop-zone.drag-over {
  background: #edf6e4;
}

[data-theme="light"] .stats-bar {
  background: #e8f4de;
  border-color: #a0c880;
  color: #2e6010;
}

[data-theme="light"] .log-box {
  background: #f0f4ec;
  color: #2a6010;
}

[data-theme="light"] .why-card {
  background: #f4f8f0;
  border-color: #c0d8a8;
}

[data-theme="light"] .dev-tip-card {
  background: #e8f4de;
  border-color: #a0c880;
}
[data-theme="light"] .dev-tip-title { color: #1a4a08; }
[data-theme="light"] .dev-tip-body p { color: #2e6010; }
[data-theme="light"] .dev-tip-body strong { color: #1a4a08; }

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-hi); text-decoration: none; }
a:hover { color: var(--text-hi); }
code {
  font-family: var(--mono);
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: .875em;
  color: #98d66e;
}

/* ============================================================
   SITE NAV
   ============================================================ */
.site-nav {
  background: #0a0a0a;
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-hi);
  letter-spacing: .02em;
  text-decoration: none;
}
.site-brand:hover { color: var(--accent-hi); }
.site-brand-icon { font-size: 1.25rem; }
.site-brand-dim { color: var(--text-muted); font-weight: 400; }
.site-nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.site-nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--accent-hi);
  border-bottom-color: var(--accent);
}

/* ============================================================
   TOOL HEADER
   ============================================================ */
.tool-header {
  background: linear-gradient(160deg, #0e1a09 0%, #0d0d0d 60%);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
}
.tool-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.tool-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-header-icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px var(--accent));
}
.tool-header-title h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-hi);
}
.tool-header-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.tool-header-link {
  font-size: .85rem;
  font-weight: 600;
  color: #62ae3a;
  border: 1px solid #2e5018;
  border-radius: var(--radius);
  padding: .35rem .85rem;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.tool-header-link:hover {
  background: #2e5018;
  color: var(--text-hi);
  border-color: var(--accent);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
main {
  flex: 1;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.privacy-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: #111a09;
  border-color: #2a4010;
  font-size: .85rem;
  color: #9abf7a;
  line-height: 1.55;
}
.privacy-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: .05rem;
}
.privacy-card strong { color: #b8e090; }
.privacy-card em { color: var(--accent-hi); font-style: normal; font-weight: 600; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .5rem;
}
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent-hi);
  font-size: .78rem;
  font-weight: 800;
  flex-shrink: 0;
  border: 1px solid var(--accent);
}
.section-desc {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.55;
}

/* ============================================================
   DROP ZONE
   ============================================================ */
.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  text-align: center;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #0e1e09;
}
.drop-zone-content { pointer-events: none; }
.drop-zone-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.drop-zone-label {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}
.drop-zone-hint {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ============================================================
   FILE LIST
   ============================================================ */
.file-list-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .85rem;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
}
.file-list {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .85rem;
  font-size: .8rem;
  font-family: var(--mono);
  color: var(--text-muted);
  border-bottom: 1px solid #1a1a1a;
}
.file-list li:last-child { border-bottom: none; }
.file-list li:hover { background: #1a1a1a; }
.file-ext {
  font-size: .7rem;
  font-weight: 700;
  padding: .05rem .35rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.ext-sqf { background: #1a2e10; color: #7bc450; border: 1px solid #2e5018; }
.ext-hpp { background: #10202e; color: #50a0c4; border: 1px solid #18405a; }
.ext-ext { background: #2e1a10; color: #c4a050; border: 1px solid #5a3018; }

/* ============================================================
   OPTIONS
   ============================================================ */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.option-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .6rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option-row:hover { border-color: var(--accent-dim); background: #141e0c; }
.option-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.option-label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}
.option-hint {
  font-size: .75rem;
  color: var(--text-muted);
  text-align: right;
}
.option-tag {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .05rem .4rem;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent-hi);
  border: 1px solid #3e5a20;
}
.option-tag.recommended { background: #1e3010; color: #7bc450; border-color: #3a6020; }

/* ============================================================
   PROCESS ACTIONS
   ============================================================ */
.process-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: background .15s, opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}
.btn-sm  { font-size: .78rem; padding: .25rem .65rem; }
.btn-lg  { font-size: .95rem; padding: .6rem 1.4rem; }
.btn     { font-size: .85rem; padding: .4rem .9rem; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); }

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) { background: var(--success-hi); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--text-muted); }

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .55rem 1rem;
  background: #111a09;
  border: 1px solid #2a4010;
  border-radius: var(--radius);
  font-size: .82rem;
  color: #9abf7a;
  margin-bottom: 1rem;
}
.stat-sep { color: var(--text-muted); }

/* ============================================================
   LOG
   ============================================================ */
.log-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .85rem;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 600;
}
.log-box {
  background: #0a0a0a;
  color: #7ec850;
  font-family: var(--mono);
  font-size: .78rem;
  padding: .85rem;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   WHY-CARD
   ============================================================ */
.why-card {
  border-color: #2a3a1a;
  background: #111811;
}
.why-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-hi);
  margin-bottom: .65rem;
}
.why-card p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: .65rem;
}
.why-card p:last-of-type { margin-bottom: .85rem; }
.why-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.why-list li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  font-size: .85rem;
  color: var(--text);
  line-height: 1.55;
}
.why-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: .05rem;
}

/* ============================================================
   DEV TIP CARD
   ============================================================ */
.dev-tip-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  border-color: #2a4010;
  background: #0e1a09;
}
.dev-tip-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: .1rem;
}
.dev-tip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.dev-tip-title {
  font-size: .95rem;
  font-weight: 700;
  color: #b8e090;
  margin-bottom: .1rem;
}
.dev-tip-body p {
  font-size: .875rem;
  color: #9abf7a;
  line-height: 1.65;
}
.dev-tip-body strong { color: #cef0a0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .tool-header-inner { flex-direction: column; align-items: flex-start; }
  .option-row { grid-template-columns: auto 1fr; }
  .option-hint { display: none; }
}

/* ============================================================
   EXAMPLE LOAD LINK
   ============================================================ */
.example-load-row {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.example-load-row a { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }
.example-load-row a:hover { color: var(--text-hi); }

/* ============================================================
   DIFF VIEWER
   ============================================================ */
.diff-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
  overflow: hidden;
  background: var(--bg-panel);
}
.diff-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.diff-title { font-weight: 700; color: var(--text-hi); font-size: 0.9rem; }
.diff-file-select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  padding: 0.3rem 0.5rem;
  font-size: 0.82rem;
  font-family: var(--font);
  max-width: 60%;
  cursor: pointer;
}
.diff-summary { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }
.diff-body {
  max-height: 460px;
  overflow: auto;
  font-family: var(--mono, 'Consolas', monospace);
  font-size: 0.78rem;
  line-height: 1.5;
  background: #0c0c0c;
}
[data-theme="light"] .diff-body { background: #fbfbfa; }
.diff-line { display: flex; white-space: pre; }
.diff-sign {
  flex: 0 0 1.4rem;
  text-align: center;
  color: var(--text-muted);
  user-select: none;
  border-right: 1px solid var(--border);
}
.diff-text { padding: 0 0.6rem; flex: 1; }
.diff-ctx { color: var(--text-muted); }
.diff-del { background: rgba(192, 57, 43, 0.16); color: #e0a0a0; }
.diff-del .diff-sign { color: var(--danger-hi); }
.diff-add { background: rgba(78, 138, 46, 0.16); color: #a6d488; }
.diff-add .diff-sign { color: var(--accent-hi); }
.diff-mod { background: rgba(70, 120, 190, 0.14); color: #9cc2e8; }
.diff-mod .diff-sign { color: #6fa8dc; }
/* trailing comment that was stripped from a reformatted line */
.diff-stripped {
  color: var(--danger-hi);
  opacity: 0.7;
  text-decoration: line-through;
  margin-left: 0.6rem;
}
[data-theme="light"] .diff-stripped { color: #b03228; }
[data-theme="light"] .diff-del { background: #fbe3e0; color: #8a2b22; }
[data-theme="light"] .diff-add { background: #e4f4d8; color: #2e6010; }
[data-theme="light"] .diff-mod { background: #e2ecf8; color: #285a8a; }
.diff-foot {
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.diff-swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; vertical-align: middle; }
.diff-del-sw { background: rgba(192, 57, 43, 0.4); }
.diff-add-sw { background: rgba(78, 138, 46, 0.4); }
.diff-mod-sw { background: rgba(70, 120, 190, 0.4); }
