/* ============================================================
   LLMs Guru — Shared Tool Stylesheet
   All static tool pages (calculators + utilities) link to this.
   Each tool only needs to define --brand, --brand-light, and
   any tool-specific widget styles in its own <style> block.
   ============================================================ */

/* ── Theme Variables ───────────────────────────────────────── */
:root {
  --bg:       #ffffff;
  --surface:  #f8f9fa;
  --surface2: #f1f3f5;
  --border:   #e9ecef;
  --text:     #1a1a2e;
  --text2:    #6c757d;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0, 0, 0, 0.08);
  /* --brand and --brand-light are set per tool */
  /* --card-width can be overridden per tool (default 860px) */
}

[data-theme="dark"] {
  --bg:       #0f0f0f;
  --surface:  #1a1a1a;
  --surface2: #242424;
  --border:   #2a2a2a;
  --text:     #f5f5f5;
  --text2:    #a0a0a0;
  --shadow:   0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ── Site Header ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0A0A0B;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #FF7300, #FB923C);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(245,158,11,0.35);
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.logo-llms {
  background: linear-gradient(135deg, #FF7300, #FB923C);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  color: #71717A;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}
.nav-link:hover { color: #FF7300; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #A1A1AA;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s;
}
.back-link:hover { border-color: #FF7300; color: #FF7300; background: rgba(255,115,0,0.08); }

.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #A1A1AA;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
  transition: all 0.18s;
}
.theme-btn:hover { border-color: #FF7300; color: #FF7300; background: rgba(255,115,0,0.08); }

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  padding: 12px 24px;
  font-size: 0.82rem;
  color: var(--text2);
  max-width: 900px;
  margin: 0 auto;
}
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { margin: 0 6px; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 40px 24px 24px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-light);
  color: var(--brand);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero p {
  color: var(--text2);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Tool Card ─────────────────────────────────────────────── */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: var(--card-width, 860px);
  margin: 28px auto;
  box-shadow: var(--shadow);
}

/* ── Form Elements ─────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.form-group { flex: 1; min-width: 100px; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--brand); }

select.form-input { cursor: pointer; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  padding: 10px 20px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

.btn-full {
  width: 100%;
  padding: 14px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}
.btn-full:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-full:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-full-outline {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: 10px;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-full-outline:hover { border-color: var(--brand); color: var(--brand); }

.copy-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.2s;
}
.copy-btn:hover { opacity: 0.85; }

/* ── Stat Boxes ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-box:hover { border-color: var(--brand); }

.stat-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Mode Tabs ���────────────────────────────────────────────── */
.mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  text-align: center;
}
.tab-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab-btn:hover:not(.active) { border-color: var(--brand); color: var(--brand); }

/* ── Toggle Switch ─────────────────────────────────────────── */
.toggle { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 12px; cursor: pointer; transition: background 0.3s; }
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle-slider::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform 0.3s; }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); }

/* ── Checkbox row ──────────────────────────────────────────── */
.opt-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 16px;
  cursor: pointer;
}
.opt-check input { accent-color: var(--brand); }

/* ── Section Label ─────────────────────────────────────────── */
.section-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* ── Misc ──────────────────────────────────────────────────── */
.error-msg { color: #EF4444; font-size: 0.85rem; margin-top: 8px; }

/* ── Drop Zone (image / file tools) ───────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 24px;
}
.drop-zone:hover, .drop-zone.dragging { border-color: var(--brand); background: var(--brand-light); }
.drop-zone input[type="file"] { display: none; }
.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }
.drop-text { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.drop-hint { font-size: 0.8rem; color: var(--text2); }
.drop-browse {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

/* ── Image preview pair ────────────────────────────────────── */
.preview-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
}
.preview-box img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  padding: 10px;
}
.preview-label {
  font-size: 0.75rem;
  color: var(--text2);
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Quality slider row ────────────────────────────────────── */
.quality-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quality-row label { font-size: 0.82rem; font-weight: 600; color: var(--text2); min-width: 80px; }
.quality-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.quality-val { font-size: 0.85rem; font-weight: 700; color: var(--brand); min-width: 36px; text-align: center; }

/* ── Features Grid ─────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 32px auto;
  padding: 0 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.feature-icon { font-size: 1.5rem; margin-bottom: 8px; }
.feature-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.feature-card p { font-size: 0.82rem; color: var(--text2); }

/* ── FAQ ───────────────────────────────────────────────────── */
.faq-section { max-width: 900px; margin: 32px auto; padding: 0 24px; }
.faq-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-q {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  user-select: none;
}
.faq-q:hover { color: var(--brand); }

.faq-a {
  padding: 0 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s, padding 0.3s;
  font-size: 0.88rem;
  color: var(--text2);
}
.faq-a.open { max-height: 220px; padding: 14px 18px; }

.chevron { transition: transform 0.3s; font-style: normal; }
.faq-item.open .chevron { transform: rotate(180deg); }

/* ── Related Tools ─────────────────────────────────────────── */
.related-section { max-width: 900px; margin: 32px auto; padding: 0 24px; }
.related-section h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}
.related-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.related-card .r-icon { font-size: 1.4rem; margin-bottom: 6px; }
.related-card .r-name { font-size: 0.88rem; font-weight: 600; }
.related-card .r-desc { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }

/* ── Site Footer ───────────────────────────────────────────── */
.site-footer {
  background: #0A0A0B;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  padding: 28px 24px;
  color: #52525B;
  font-size: 0.82rem;
  margin-top: 48px;
}
.site-footer a { color: #71717A; text-decoration: none; }
.site-footer a:hover { color: #FF7300; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .calc-card { margin: 16px; padding: 20px; }
  .features-grid { padding: 0 16px; }
  .faq-section, .related-section { padding: 0 16px; }
  .mode-tabs { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .header-inner { padding: 0 1rem; }
  .logo-text { font-size: 1rem; }
  .back-link { font-size: 0.75rem; padding: 5px 9px; }
}
