/* ==========================================================================
   Design System: Scam Message Explainer
   Mobile-first, calm, trustworthy, Bengali typography optimized
   ========================================================================== */

:root {
  --font-main: "Noto Sans Bengali", "Noto Sans", sans-serif;
  
  /* Color Palette with WCAG AA compliance (4.5:1+ contrast) */
  --ink: #12202b;
  --ink-secondary: #2d3f50;
  --mute: #485966;
  --line: #cbd5e1;
  --line-light: #e2e8f0;
  --bg: #f4f7f9;
  --card: #ffffff;
  --brand: #0b5d8a;
  --brand-hover: #08496d;
  --brand-light: #eaf3f8;
  --brand-focus: rgba(11, 93, 138, 0.25);
  
  /* Hero Deep Navy */
  --navy-hero: #0a192f;
  --navy-surface: #13243f;
  --navy-line: #1e355b;
  --navy-text-mute: #a2b7cf;

  /* Verdict Colors with accessible contrast */
  --strong: #b3261e;
  --strong-bg: #fdf2f2;
  --strong-border: #f8c8c5;

  --some: #944f00;
  --some-bg: #fff8ed;
  --some-border: #fce2b8;

  --cant: #2c4d6f;
  --cant-bg: #f0f4f8;
  --cant-border: #cbdbe8;

  /* System Metrics */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --container-max: 1120px;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Accessible focus ring */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-narrow {
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   Shared Header & Navigation
   ========================================================================== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

#sticker {
  height: 56px;
  width: auto;
  max-width: none;
  object-fit: contain;
  display: block;
}

.stk {
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--brand);
  max-width: 210px;
  line-height: 1.3;
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--ink-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  font-size: 0.96rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link:hover {
  background-color: var(--brand-light);
  color: var(--brand);
}

.nav-link.active {
  background-color: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  min-height: 42px;
}

.nav-toggle-icon {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--ink);
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background-color: var(--ink);
  left: 0;
}

.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { bottom: -6px; }

/* Language Switcher */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.lang-switcher, .lang {
  display: inline-flex;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.lang-switcher button, .lang button {
  border: 0;
  background: var(--card);
  color: var(--brand);
  padding: 8px 16px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-switcher button:first-child, .lang button:first-child {
  border-right: 1px solid var(--brand);
}

.lang-switcher button[aria-pressed="true"], .lang button[aria-pressed="true"] {
  background-color: var(--brand);
  color: #ffffff;
}

/* ==========================================================================
   Typography & Common Elements
   ========================================================================== */
h1, h2, h3, h4, h5 {
  color: var(--ink);
  line-height: 1.35;
  margin-top: 0;
  font-weight: 700;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 24px;
  min-height: 48px;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary, .primary {
  background-color: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
}

.btn-primary:hover, .primary:hover {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--brand);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background-color: var(--brand-light);
  border-color: var(--brand);
}

.btn-light {
  background-color: #ffffff;
  color: var(--navy-hero);
  border: 1px solid #ffffff;
}

.btn-light:hover {
  background-color: #f0f4f8;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
}

/* ==========================================================================
   Hero Section (Deep Navy)
   ========================================================================== */
.hero-band {
  background: linear-gradient(180deg, #0a192f 0%, #0d213c 100%);
  color: #ffffff;
  padding: 56px 0 68px;
  border-bottom: 1px solid var(--navy-line);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
}

.hero-content h1 {
  color: #ffffff;
  font-size: 2.35rem;
  line-height: 1.3;
  margin-bottom: 18px;
}

.hero-tagline {
  color: var(--navy-text-mute);
  font-size: 1.18rem;
  line-height: 1.6;
  margin-bottom: 28px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.hero-notice {
  font-size: 0.9rem;
  color: var(--navy-text-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* CSS-built Mock Result Card */
.mock-card {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.mock-badge-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.84rem;
}

.mock-label {
  background: #eef2f6;
  color: var(--mute);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.78rem;
}

.mock-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.verdict-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}

.verdict-chip.strong {
  background: var(--strong-bg);
  color: var(--strong);
  border-color: var(--strong-border);
}

.verdict-chip.some {
  background: var(--some-bg);
  color: var(--some);
  border-color: var(--some-border);
}

.verdict-chip.cant {
  background: var(--cant-bg);
  color: var(--cant);
  border-color: var(--cant-border);
}

.mock-msg-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.mock-msg-box mark {
  background-color: #ffe08a;
  color: #2b1700;
  padding: 1px 4px;
  border-bottom: 2px solid var(--some);
  border-radius: 2px;
  font-weight: 600;
}

.mock-analysis-box {
  background: var(--strong-bg);
  border-left: 4px solid var(--strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
}

.mock-analysis-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--strong);
  margin-bottom: 4px;
}

.mock-analysis-desc {
  font-size: 0.86rem;
  color: var(--ink-secondary);
  margin: 0;
}

/* ==========================================================================
   Section Layouts & Card Grids
   ========================================================================== */
.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--line-light);
}

.section-alt {
  background-color: #ffffff;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 44px;
}

.section-tag {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.section-title {
  font-size: 1.95rem;
  margin-bottom: 12px;
}

.section-sub {
  color: var(--mute);
  font-size: 1.05rem;
  margin: 0;
}

/* Grid Layouts */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: var(--brand);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.card h3 {
  font-size: 1.22rem;
  margin-bottom: 10px;
}

.card p {
  color: var(--ink-secondary);
  font-size: 0.96rem;
  margin-bottom: 0;
}

/* Step Cards */
.step-number {
  display: inline-block;
  width: 38px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  background: var(--brand);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

/* Action Showcase Box */
.action-showcase {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.showcase-left h3 {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.showcase-left ul {
  padding-left: 20px;
  color: var(--ink-secondary);
  margin-bottom: 24px;
}

.showcase-left li {
  margin-bottom: 8px;
}

.showcase-right {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.showcase-preview-head {
  font-size: 0.88rem;
  color: var(--mute);
  margin-bottom: 10px;
  font-weight: 600;
}

/* Privacy Promise Box */
.privacy-box {
  background: #ffffff;
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  padding: 32px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: flex-start;
}

.privacy-badge {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--brand);
}

.faq-item summary {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.35rem;
  color: var(--brand);
  font-weight: 700;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-content {
  padding: 0 20px 20px;
  color: var(--ink-secondary);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* CTA Band */
.cta-band {
  background: var(--navy-hero);
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
}

.cta-band h2 {
  color: #ffffff;
  font-size: 2.1rem;
  margin-bottom: 12px;
}

.cta-band p {
  color: var(--navy-text-mute);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 28px;
}

/* ==========================================================================
   Tool Page Specific Styles (check.html)
   Preserves all element IDs and classes used by app.js
   ========================================================================== */
.tool-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.tool-header {
  margin-bottom: 24px;
}

.tool-header h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--mute);
  margin: 0;
}

textarea#msg {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
  background: #ffffff;
  color: var(--ink);
  line-height: 1.6;
}

textarea#msg:focus {
  border-color: var(--brand);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.exlab {
  color: var(--mute);
  font-size: 0.92rem;
  margin-left: 4px;
  font-weight: 500;
}

#exs button, .exp button {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  margin: 3px;
  min-height: 44px;
  color: var(--ink-secondary);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#exs button:hover, .exp button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background-color: var(--brand-light);
}

.exp button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 600;
}

.status {
  min-height: 1.4em;
  color: var(--brand);
  font-weight: 600;
  margin: 10px 0;
}

.res {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 8px solid var(--cant);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.res.strong_warning { border-left-color: var(--strong); }
.res.some_warning { border-left-color: var(--some); }
.res.cannot_tell { border-left-color: var(--cant); }

.verdict {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.strong_warning .verdict { color: var(--strong); }
.some_warning .verdict { color: var(--some); }
.cannot_tell .verdict { color: var(--cant); }

.summary {
  margin: 6px 0 10px;
  font-weight: 500;
  font-size: 1.05rem;
}

.small {
  font-size: 0.88rem;
  color: var(--mute);
  margin: 6px 0;
}

.shown {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 14px 0;
  line-height: 1.65;
}

mark {
  background: #ffe08a;
  color: var(--ink);
  padding: 1px 4px;
  border-bottom: 2px solid var(--some);
  border-radius: 2px;
}

#result h3 {
  font-size: 1.05rem;
  margin: 20px 0 8px;
}

#why {
  margin: 6px 0 14px;
  padding-left: 22px;
}

#why li {
  margin-bottom: 6px;
}

.now {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-weight: 600;
  margin: 16px 0 12px;
}

.steps {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
  line-height: 1.65;
}

.priv {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================================
   Shared Footer
   ========================================================================== */
.site-footer {
  background: #0f1c29;
  color: #cbd5e1;
  padding: 56px 0 32px;
  border-top: 1px solid #1e2e40;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.94rem;
  line-height: 1.6;
  color: #94a3b8;
  margin-bottom: 14px;
  max-width: 440px;
}

.footer-disclaimer {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #fca5a5;
  background: rgba(185, 28, 28, 0.12);
  border: 1px solid rgba(185, 28, 28, 0.3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  max-width: 480px;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid #1e2e40;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: #64748b;
}

.footer-bottom-text {
  max-width: 650px;
}

/* ==========================================================================
   Dashboard & History Design Components
   ========================================================================== */
.page-header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.privacy-banner-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid rgba(11, 93, 138, 0.2);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 500;
}

.sample-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
}

.sample-badge-active {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line);
  transition: 0.2s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--brand);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--ink);
}

.stat-card.strong .stat-val { color: var(--strong); }
.stat-card.some .stat-val { color: var(--some); }
.stat-card.cant .stat-val { color: var(--cant); }

.stat-label {
  font-size: 0.92rem;
  color: var(--mute);
  font-weight: 500;
}

/* CSS Charts */
.chart-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

.chart-title {
  font-size: 1.15rem;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bar-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 180px;
  padding: 16px 8px 0;
  border-bottom: 1px solid var(--line);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-pill {
  width: 100%;
  max-width: 44px;
  background: var(--brand);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.3s ease;
  position: relative;
}

.bar-pill:hover {
  background: var(--brand-hover);
}

.bar-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

.bar-label {
  font-size: 0.8rem;
  color: var(--mute);
  margin-top: 8px;
  text-align: center;
}

/* Horizontal Progress Bars */
.horizontal-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hbar-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  align-items: center;
  gap: 16px;
}

.hbar-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hbar-track {
  height: 14px;
  background: #eef2f6;
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.hbar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.hbar-count {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-secondary);
  text-align: right;
}

/* Recent Checks Table/List */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recent-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s ease;
}

.recent-item:hover {
  border-color: var(--brand);
}

.recent-info {
  flex: 1;
  min-width: 0;
}

.recent-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--mute);
}

.recent-text {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}

.scam-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 4px;
}

/* Top Scam Tip Card */
.tip-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.tip-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.tip-content h4 {
  color: #166534;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.tip-content p {
  color: #14532d;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* History Filter Bar & Search */
.history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  text-decoration: none;
  color: var(--ink-secondary);
}

.filter-chip.active {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.search-input-wrap {
  position: relative;
  min-width: 260px;
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  background: #ffffff;
}

.search-input:focus {
  border-color: var(--brand);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mute);
  pointer-events: none;
}

/* History Cards */
.history-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.history-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 6px solid var(--cant);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: box-shadow 0.15s ease;
}

.history-card.strong_warning { border-left-color: var(--strong); }
.history-card.some_warning { border-left-color: var(--some); }
.history-card.cannot_tell { border-left-color: var(--cant); }

.history-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history-card-text {
  font-size: 0.98rem;
  line-height: 1.6;
  margin-bottom: 14px;
  color: var(--ink);
}

.history-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line-light);
  padding-top: 12px;
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10, 25, 47, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: 0;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--mute);
}

/* Empty State */
.empty-box {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  margin: 20px 0;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 14px;
  opacity: 0.7;
}

.empty-box h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.empty-box p {
  color: var(--mute);
  max-width: 480px;
  margin: 0 auto 20px;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hbar-row {
    grid-template-columns: 140px 1fr 50px;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .hbar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .history-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input-wrap {
    max-width: 100%;
  }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .action-showcase {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 12px 20px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  }
  .site-nav.nav-open {
    display: flex;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .hero-content h1 {
    font-size: 1.85rem;
  }
  .section {
    padding: 44px 0;
  }
  .section-title {
    font-size: 1.6rem;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .res {
    animation: fadeIn 0.25s ease-out;
  }
  @keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
  }
}
