/* SmarterDiff — minimal, fast, accessible styling */
:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1c212c;
  --border: #262c38;
  --text: #e6e9ef;
  --muted: #8a93a6;
  --accent: #4f8bff;
  --accent-2: #7bd389;
  --add: #163d2a;
  --add-fg: #7ee2a0;
  --del: #4a1c24;
  --del-fg: #ff8a9a;
  --warn: #b07a1f;
  --danger: #d05656;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --panel: #ffffff;
    --panel-2: #f1f3f8;
    --border: #e3e7ef;
    --text: #1a1d24;
    --muted: #5a6273;
    --add: #defbe6;
    --add-fg: #146c2e;
    --del: #fde2e4;
    --del-fg: #a4243b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--accent);
}
.brand span:not(.badge) { color: var(--text); letter-spacing: -0.01em; }
.badge {
  margin-left: 10px;
  font-size: 11px; font-weight: 500;
  background: var(--panel-2); color: var(--muted);
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border);
}
.nav a {
  color: var(--muted); margin-left: 18px; text-decoration: none; font-size: 13.5px;
}
.nav a:hover { color: var(--text); }

.container { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }

.hero h1 {
  font-size: 34px; letter-spacing: -0.02em; margin: 8px 0 8px;
}
.hero .lead { color: var(--muted); max-width: 720px; }
.trust-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.trust-pill {
  background: var(--panel); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: var(--accent-2); }

.tabs {
  display: flex; gap: 4px; margin: 26px 0 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  appearance: none; background: transparent; color: var(--muted);
  border: none; padding: 12px 16px; cursor: pointer; font-size: 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.panel {
  display: none; padding: 18px 0;
}
.panel.active { display: block; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.panel-head h2 { font-size: 18px; margin: 0; }
.controls {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.controls label {
  display: inline-flex; gap: 6px; align-items: center;
  color: var(--muted); font-size: 13px;
}
.controls select, .controls input[type="range"] {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 5px 8px; font-size: 13px;
}
.btn {
  appearance: none; cursor: pointer; border-radius: 8px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--panel);
  color: var(--text); transition: transform .04s ease, background .15s;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.split.single { grid-template-columns: 1fr; }

textarea {
  width: 100%; min-height: 220px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: 10px;
  background: var(--panel);
  min-height: 130px; padding: 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: var(--muted);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { background: var(--panel-2); border-color: var(--accent); color: var(--text); }
.dropzone strong { color: var(--text); }
.dropzone .filename { display: block; margin-top: 6px; font-size: 12px; color: var(--accent); }

.folder-pick { display: block; width: 100%; cursor: pointer; }

.diff-result {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px;
  min-height: 60px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.diff-line { padding: 2px 6px; border-radius: 4px; }
.diff-add  { background: var(--add); color: var(--add-fg); }
.diff-del  { background: var(--del); color: var(--del-fg); }
.diff-eq   { color: var(--muted); }

.diff-inline-add { background: var(--add); color: var(--add-fg); padding: 0 2px; border-radius: 3px; }
.diff-inline-del { background: var(--del); color: var(--del-fg); padding: 0 2px; border-radius: 3px; text-decoration: line-through; }

.summary {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.summary .stat {
  background: var(--panel-2); border: 1px solid var(--border);
  padding: 6px 10px; border-radius: 6px; font-size: 12.5px;
}
.summary .stat b { color: var(--text); }

table.diff {
  border-collapse: collapse; width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px;
}
table.diff th, table.diff td {
  border: 1px solid var(--border); padding: 4px 8px; vertical-align: top;
}
table.diff th { background: var(--panel-2); font-weight: 600; text-align: left; }
table.diff td.changed { background: rgba(255, 200, 0, 0.10); }
table.diff td.added { background: var(--add); color: var(--add-fg); }
table.diff td.removed { background: var(--del); color: var(--del-fg); }
.tag {
  display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 11px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--border);
}
.tag.add { background: var(--add); color: var(--add-fg); border-color: transparent; }
.tag.del { background: var(--del); color: var(--del-fg); border-color: transparent; }
.tag.mod { background: rgba(255,200,0,0.15); color: var(--warn); border-color: transparent; }

.image-canvas-wrap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px; margin-top: 8px;
}
.image-canvas-wrap figure {
  margin: 0; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
}
.image-canvas-wrap figcaption { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.image-canvas-wrap canvas, .image-canvas-wrap img {
  width: 100%; height: auto; display: block; border-radius: 6px; background: #111;
}

.slider-wrap {
  position: relative; user-select: none; border-radius: 8px; overflow: hidden;
  background: #111;
}
.slider-wrap canvas { display: block; width: 100%; height: auto; }
.slider-wrap .slider-handle {
  position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent);
  cursor: ew-resize; box-shadow: 0 0 0 2px rgba(79,139,255,0.4);
}
.slider-wrap .clip { position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; }
.slider-wrap .clip canvas { width: var(--w); }

.gauge {
  --pct: 0;
  background:
    conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--panel-2) 0);
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.gauge::before {
  content: ""; position: absolute; inset: 12px;
  border-radius: 50%; background: var(--panel);
}
.gauge .gauge-val {
  position: relative; font-size: 22px; font-weight: 700;
}
.ai-grid {
  display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: center;
  margin-top: 10px;
}
.ai-meters { display: grid; gap: 10px; }
.meter {
  display: grid; grid-template-columns: 200px 1fr 60px; gap: 10px; align-items: center;
  font-size: 13px;
}
.meter .bar { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.meter .bar > i { display: block; height: 100%; background: var(--accent); }
.meter .v { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

.caveat {
  color: var(--muted); font-size: 12.5px; margin-top: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}

.info { margin-top: 56px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.info h2 { margin-top: 0; font-size: 18px; }

.footer { text-align: center; padding: 30px; color: var(--muted); }
.footer-nav { margin-bottom: 8px; }
.footer-nav a { color: var(--muted); text-decoration: none; margin: 0 4px; font-size: 12.5px; }
.footer-nav a:hover { color: var(--accent); }

/* AdSense slots — reserved heights prevent CLS, label keeps Google policy happy */
.ad-slot {
  margin: 28px 0;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.ad-slot::before {
  content: "Advertisement";
  position: absolute; top: 6px; left: 10px;
  font-size: 10px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  z-index: 1;
  pointer-events: none;
}
.ad-slot ins.adsbygoogle {
  width: 100%;
  display: block;
  min-width: 250px;
}

/* Banner ads — responsive to mobile/tablet/desktop */
.ad-banner {
  min-height: 120px;
  /* Supports: 320x50, 468x60, 728x90, 970x90 */
}

/* In-content rectangle — optimizes for 300x250, 336x280 */
.ad-in-content {
  min-height: 250px;
  margin: 32px 0;
  /* Supports: 300x250, 336x280, inline fluid ads */
}

/* Pre-footer — flexible height for best performance */
.ad-prefooter {
  min-height: 280px;
  /* Supports: 728x90, 970x90, 300x250, 336x280 */
}

/* Responsive behavior for different viewports */
@media (max-width: 640px) {
  .ad-slot {
    min-height: 90px;
    margin: 20px 0;
  }
  .ad-banner { min-height: 90px; }
  .ad-in-content { min-height: 250px; margin: 24px 0; }
  .ad-prefooter { min-height: 90px; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .ad-slot {
    min-height: 280px;
  }
  .ad-banner { min-height: 100px; }
  .ad-in-content { min-height: 280px; }
  .ad-prefooter { min-height: 280px; }
}

@media (min-width: 1025px) {
  .ad-slot {
    min-height: 300px;
  }
  .ad-banner { min-height: 120px; }
  .ad-in-content { min-height: 300px; margin: 36px 0; }
  .ad-prefooter { min-height: 300px; }
}

.toast {
  position: fixed; right: 20px; bottom: 20px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 99;
}

@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .nav a { display: none; }
  /* Hide third ad slot on mobile to improve content-to-ads ratio */
  .ad-prefooter { display: none; }
}

/* Team member grid styling */
.team-members {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.team-member {
  padding: 1.25rem;
  background: var(--panel-2);
  border-radius: 8px;
  border-left: 4px solid var(--accent);
}

.team-member h4 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 600;
}

.team-member p {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: var(--text);
  font-size: 0.95rem;
}

/* Table styling for benchmarks */
table {
  font-size: 0.95rem;
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

table thead {
  background: var(--panel-2);
  border-bottom: 2px solid var(--border);
}

table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--accent);
}

table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

table tr:last-child td {
  border-bottom: none;
}
