/* ============================================================
   BS DETECTOR — main.css
   Color scheme: warm dark bg, high-contrast text, amber accent
   Category colors: buzzword=amber, hot_air=coral, clickbait=cyan
   Fonts: Roboto Slab (headings), Arial (body/UI)
   Min font size: 12px
   ============================================================ */

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

:root {
  /* Backgrounds — warmer, slightly lighter than pure black for readability */
  --bg:         #111113;
  --bg2:        #1a1a1d;
  --bg3:        #242428;
  --bg4:        #2e2e33;
  --bgtxtar:    #000;

  /* Borders */
  --border:     #2e2e33;
  --border2:    #3a3a40;

  /* Text — high contrast */
  --text:       #fff;
  --text2:      #c8c8cc;
  --muted:      #9a9aa8;
  --subtle:     #6b6b78;

  /* Brand accents */
  --red:        #ef4444;
  --orange:     #f97316;
  --amber:      #f59e0b;
  --green:      #22c55e;
  --cyan:       #22d3ee;
  --coral:      #f87171;

  /* Category highlight colors — visually distinct triad */
  --cat-buzzword:  #f59e0b;   /* amber  — warm gold */
  --cat-hot-air:   #f87171;   /* coral  — warm red  */
  --cat-clickbait: #22d3ee;   /* cyan   — cool teal */

  /* Fonts */
  --font-head: 'Roboto Slab', Georgia, serif;
  --font-ui:   Arial, Helvetica, sans-serif;
  --font-body: Arial, Helvetica, sans-serif;

  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }

/* ── Layout ───────────────────────────────────────────────── */
.container { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.main-content { padding: 32px 16px 60px; }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(180deg, #1f0808 0%, var(--bg) 100%);
  border-bottom: 1px solid #ef444428;
  padding: 24px 16px 0;
  text-align: center;
}
.logo { font-size: 48px; line-height: 1; margin-bottom: 6px; display:none;}
.site-title {
  font-family: var(--font-head);
  font-size: clamp(28px, 6vw, 52px);
  background: linear-gradient(135deg, #ef4444, #f97316, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.site-tagline {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 3px;
  margin-bottom: 20px;
}
.main-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding: 0;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 12px 20px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--amber); border-bottom-color: var(--amber); }

/* ── Stats Bar ───────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 16px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num { display: block; font-family: var(--font-head); font-size: 26px; color: var(--amber); }
.stat-label { font-family: var(--font-ui); font-size: 12px; color: var(--muted); letter-spacing: 1px; }

/* ── Input Section ───────────────────────────────────────── */
.input-mode-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.mode-btn {
  padding: 8px 20px;
  border-radius: 20px;
  background: var(--bg3);
  border: 2px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  transition: all 0.2s;
}
.mode-btn.active {
  background: #22c55e18;
  border-color: var(--green);
  color: var(--green);
}
.input-area textarea, .input-area input[type="url"] {
  width: 100%;
  background: var(--bgtxtar);
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  outline: none;
  transition: border-color 0.2s;
}
.input-area textarea { min-height: 180px; resize: vertical; }
.input-area textarea:focus, .input-area input[type="url"]:focus { border-color: #ef444466; }
.char-count { text-align: right; color: var(--muted); font-family: var(--font-ui); font-size: 12px; margin-top: 6px; }
.url-note { color: var(--muted); font-size: 13px; font-family: var(--font-ui); margin-top: 8px; }
.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.form-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.detect-btn {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: var(--radius);
  padding: 15px 36px;
  color: white;
  font-family: var(--font-head);
  font-size: 20px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  box-shadow: 0 4px 20px #16a34a44;
}
.detect-btn:hover { transform: scale(1.03); box-shadow: 0 8px 30px #16a34a66; }
.detect-btn:active { transform: scale(0.98); }
.detect-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.sample-btn {
  background: var(--bg3);
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
  padding: 14px 24px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.sample-btn:hover { color: var(--text2); border-color: var(--subtle); }

/* ── Score Card ──────────────────────────────────────────── */
.score-card {
  text-align: center;
  border-color: var(--score-color, var(--border));
  box-shadow: 0 0 40px color-mix(in srgb, var(--score-color, #333) 15%, transparent);
}
.score-header { display: flex; align-items: center; gap: 16px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.score-emoji { font-size: 48px; }
.score-label { font-family: var(--font-head); font-size: 28px; color: var(--score-color, white); }
.score-desc { color: var(--text2); font-size: 14px; font-style: italic; margin-top: 4px; }
.gauge-wrap { display: flex; justify-content: center; margin-bottom: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat-box {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 14px 8px;
  text-align: center;
}
.stat-n { font-size: 24px; font-weight: 900; font-family: Arial, sans-serif; color: var(--text); }
.stat-l { font-size: 12px; color: var(--muted); margin-top: 4px; font-family: var(--font-ui); }

/* ── Subscores ───────────────────────────────────────────── */
.section-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.score-bar-row { margin-bottom: 18px; }
.score-bar-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; color: var(--text2); font-family: var(--font-ui); }
.bar-track { background: var(--bg3); border-radius: 6px; height: 10px; overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--fill-color, var(--amber));
  border-radius: 6px;
  transition: width 1s ease;
  box-shadow: 0 0 8px color-mix(in srgb, var(--fill-color, var(--amber)) 50%, transparent);
}
.bar-desc { color: var(--muted); font-size: 12px; margin-top: 4px; font-family: var(--font-ui); }

/* ── Roast ───────────────────────────────────────────────── */
.roast-card { background: linear-gradient(135deg, #1c0d00, #1c1500); border-color: #f59e0b44; }
.roast-text { font-family: var(--font-body); font-size: 17px; font-style: italic; color: var(--text); line-height: 1.8; border: none; padding: 0; }

/* ── Heatmap / Category tags ─────────────────────────────── */
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; font-family: var(--font-ui); font-size: 13px; }
.hit-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hit-tag {
  background: color-mix(in srgb, var(--tag-color) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag-color) 55%, transparent);
  color: var(--tag-color);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
}

/* ── Highlighted / Annotated Text ────────────────────────── */
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.toggle-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 6px;
  color: var(--text2);
  padding: 6px 14px;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
}
.toggle-btn:hover { color: var(--text); border-color: var(--muted); }

/* Annotated text — white base so highlights pop against it */
.highlighted-text {
  color: var(--text2);
  line-height: 2.0;
  font-family: var(--font-body);
  font-size: 15px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 8px;
}

/* Category highlight marks in annotated text */
mark.cat-buzzword {
  background: #f59e0b30;
  color: #fbbf24;
  border-bottom: 2px solid #f59e0b;
  border-radius: 2px;
  padding: 1px 3px;
  font-weight: 700;
}
mark.cat-hot-air {
  background: #f8717130;
  color: #fca5a5;
  border-bottom: 2px solid #f87171;
  border-radius: 2px;
  padding: 1px 3px;
  font-weight: 700;
}
mark.cat-clickbait {
  background: #22d3ee28;
  color: #67e8f9;
  border-bottom: 2px solid #22d3ee;
  border-radius: 2px;
  padding: 1px 3px;
  font-weight: 700;
}

/* ── Share ───────────────────────────────────────────────── */
.share-text {
  background: var(--bg);
  border: 1px dashed var(--border2);
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 16px;
  font-family: var(--font-ui);
  line-height: 1.6;
}
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 10px 18px;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
}
.share-btn:hover { border-color: var(--muted); color: white; }
.share-twitter { border-color: #1d9bf044; }
.share-twitter:hover { background: #1d9bf022; border-color: #1d9bf0; }
.share-linkedin { border-color: #0077b544; }
.share-linkedin:hover { background: #0077b522; border-color: #0077b5; }

/* ── Contest ─────────────────────────────────────────────── */
.contest-card { background: linear-gradient(135deg, #16162a, #141428); border-color: #f59e0b44; }
.contest-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.contest-trophy { font-size: 36px; }
.contest-title { font-family: var(--font-head); color: var(--amber); font-size: 22px; margin-bottom: 4px; }
.contest-sub { color: var(--text2); font-size: 14px; }
.contest-form { display: flex; flex-direction: column; gap: 10px; }
.contest-input {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.contest-input:focus { border-color: #f59e0b66; }
.contest-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: none;
  border-radius: 8px;
  padding: 12px;
  color: #111;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  font-family: var(--font-ui);
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.contest-btn:hover { transform: scale(1.02); }
.contest-success { background: #0a2e18; border: 1px solid #22c55e55; border-radius: 8px; padding: 14px; color: #4ade80; font-size: 14px; }
.contest-error { background: #2d0808; border: 1px solid #ef444455; border-radius: 8px; padding: 14px; color: #fca5a5; font-size: 14px; }

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard-teaser .leader-list { display: flex; flex-direction: column; gap: 8px; }
.leader-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
}
.leader-rank { font-size: 18px; min-width: 28px; }
.leader-nick { font-weight: 700; min-width: 120px; color: var(--text); }
.leader-snippet { flex: 1; color: var(--text2); font-size: 13px; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-score { font-family: var(--font-head); font-size: 22px; min-width: 44px; text-align: right; }
.view-all-link { display: block; text-align: center; margin-top: 14px; color: var(--amber); text-decoration: none; font-family: var(--font-ui); font-size: 13px; }

/* ── Error ───────────────────────────────────────────────── */
.error-card { text-align: center; padding: 48px 24px; }
.error-icon { font-size: 48px; margin-bottom: 12px; }
.error-message { color: #fca5a5; font-size: 16px; }

/* ── Try Again ───────────────────────────────────────────── */
.try-again { text-align: center; margin-top: 8px; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 28px 16px;
  color: var(--text2);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 2;
}
.footer-sub { color: var(--muted); }

/* ── About ───────────────────────────────────────────────── */
.about-content { color: var(--text2); line-height: 1.8; }
.about-content h2 { font-family: var(--font-head); color: var(--amber); font-size: 24px; margin: 32px 0 12px; }
.about-content p { margin-bottom: 16px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .share-buttons { flex-direction: column; }
  .leader-snippet { display: none; }
  .gauge-wrap svg { width: 240px; height: 156px; }
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeUp 0.4s ease forwards; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.20s; }
.card:nth-child(6) { animation-delay: 0.25s; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.pulse { animation: pulse 1.5s infinite; }
