/* GuardBot — Global Stylesheet */
/* Fonts: Fraunces (headings), DM Sans (body) */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,600;1,9..144,300;1,9..144,400&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&display=swap');

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

:root {
  --bg:         #1a1713;
  --bg-surface: #221e18;
  --bg-card:    #2a2520;
  --bg-card-2:  #302b24;
  --border:     #3d3628;
  --border-2:   #4a4235;

  --text:       #f0e8da;
  --text-muted: #9a8a78;
  --text-dim:   #6a5e52;

  --accent:     #d4a96a;
  --accent-2:   #e8d5b0;
  --accent-dim: #8a6a3a;

  --blue:       #8ab4cc;
  --green:      #8ac8a4;
  --red:        #cc8a8a;
  --yellow:     #ccc080;
  --purple:     #b8a0cc;

  --radius:     10px;
  --radius-lg:  16px;
  --radius-sm:  6px;
  --shadow:     0 2px 12px rgba(0,0,0,0.35);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);

  --font-head:  'Fraunces', Georgia, serif;
  --font-body:  'DM Sans', sans-serif;

  --transition: 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.2; }

img { display: block; max-width: 100%; }

button, input, textarea, select {
  font-family: var(--font-body);
  font-size: 1rem;
}

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 760px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.925rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: #1a1200; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--border-2); }
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover { background: rgba(204,138,138,0.1); }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-lg { padding: 15px 32px; font-size: 1.05rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card--raised { box-shadow: var(--shadow); }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}
.pill-accent { background: rgba(212,169,106,0.15); color: var(--accent); }
.pill-blue   { background: rgba(138,180,204,0.15); color: var(--blue); }
.pill-green  { background: rgba(138,200,164,0.15); color: var(--green); }
.pill-red    { background: rgba(204,138,138,0.15); color: var(--red); }
.pill-yellow { background: rgba(204,192,128,0.15); color: var(--yellow); }
.pill-dim    { background: rgba(154,138,120,0.1);  color: var(--text-muted); }

/* ── Banner warnings ─────────────────────────────────────────────────────── */
.banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border-left: 3px solid;
  margin-bottom: 12px;
}
.banner-warn  { background: rgba(204,192,128,0.1); border-color: var(--yellow); color: var(--yellow); }
.banner-error { background: rgba(204,138,138,0.1); border-color: var(--red);    color: var(--red); }
.banner-info  { background: rgba(138,180,204,0.1); border-color: var(--blue);   color: var(--blue); }
.banner svg   { flex-shrink: 0; margin-top: 2px; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.input, .textarea, .select {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.925rem;
  transition: border-color var(--transition);
  width: 100%;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
.char-counter { font-size: 0.78rem; color: var(--text-dim); text-align: right; }
.char-counter.warn { color: var(--yellow); }
.char-counter.over { color: var(--red); }

/* ── Toggle ──────────────────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border-2);
  border-radius: 100px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--accent-dim); }
.toggle input:checked + .toggle-track::before {
  transform: translateX(18px);
  background: var(--accent);
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(26,23,19,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding: 0 24px;
  max-width: 1140px; margin: 0 auto;
}
.nav-logo { font-family: var(--font-head); font-size: 1.4rem; color: var(--accent); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-link { color: var(--text-muted); font-size: 0.925rem; transition: color var(--transition); }
.nav-link:hover { color: var(--text); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: 110px 0 80px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.8rem, 6vw, 5rem);
  color: var(--text);
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto; margin-right: auto;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Stats ───────────────────────────────────────────────────────────────── */
.stats-section { padding: 64px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 2.8rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: 0.875rem; color: var(--text-muted); }

/* ── Features ────────────────────────────────────────────────────────────── */
.features-section { padding: 80px 0; }
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 12px;
}
.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 56px;
  max-width: 500px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: border-color var(--transition), transform var(--transition);
}
.feature-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px; height: 44px;
  background: rgba(212,169,106,0.12);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  color: var(--accent);
}
.feature-title { font-family: var(--font-head); font-size: 1.2rem; margin-bottom: 10px; }
.feature-desc { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.pricing-section { padding: 80px 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.pricing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex; flex-direction: column;
}
.pricing-card.featured {
  background: var(--bg-card);
  border-color: var(--accent-dim);
  position: relative;
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #1a1200;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 14px;
  border-radius: 100px;
}
.pricing-tier { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.pricing-price { font-family: var(--font-head); font-size: 2.4rem; color: var(--text); line-height: 1; margin-bottom: 4px; }
.pricing-price sub { font-size: 1rem; font-family: var(--font-body); color: var(--text-muted); }
.pricing-period { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 24px; }
.pricing-limit { font-size: 0.9rem; color: var(--accent); font-weight: 500; margin-bottom: 24px; }
.pricing-features { list-style: none; margin-bottom: 32px; flex: 1; }
.pricing-features li {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.875rem; color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li svg { color: var(--green); flex-shrink: 0; }
.pricing-ltc { font-size: 0.8rem; color: var(--text-dim); margin-top: 12px; text-align: center; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.footer-note { font-size: 0.85rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 24px; }
.footer-link { font-size: 0.85rem; color: var(--text-muted); }

/* ── Scroll reveal ───────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal][data-delay="1"] { transition-delay: 80ms; }
[data-reveal][data-delay="2"] { transition-delay: 160ms; }
[data-reveal][data-delay="3"] { transition-delay: 240ms; }
[data-reveal][data-delay="4"] { transition-delay: 320ms; }

/* ── Dashboard layout ────────────────────────────────────────────────────── */
.dash-layout { display: flex; min-height: 100vh; }
.dash-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.dash-sidebar-logo {
  padding: 24px 20px;
  font-family: var(--font-head);
  font-size: 1.35rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.dash-nav { padding: 12px 8px; flex: 1; }
.dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none; background: none; width: 100%; text-align: left;
}
.dash-nav-item:hover { background: var(--bg-card); color: var(--text); }
.dash-nav-item.active { background: rgba(212,169,106,0.12); color: var(--accent); }
.dash-nav-item svg { flex-shrink: 0; }
.dash-nav-sep {
  height: 1px; background: var(--border);
  margin: 8px 12px;
}
.dash-main { flex: 1; padding: 32px; min-width: 0; overflow-x: hidden; }
.dash-header { margin-bottom: 28px; }
.dash-title { font-family: var(--font-head); font-size: 1.8rem; margin-bottom: 4px; }
.dash-sub { font-size: 0.9rem; color: var(--text-muted); }

/* Guild selector */
.guild-selector {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.guild-selector-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.guild-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}
.guild-item:hover { background: var(--bg-card); }
.guild-item.active { background: rgba(212,169,106,0.1); }
.guild-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-card-2);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--text-muted); font-weight: 600;
  flex-shrink: 0;
}
.guild-name { font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Panels */
.panel { display: none; }
.panel.active { display: block; }

/* Overview stats */
.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.overview-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
}
.overview-stat-val {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.overview-stat-label { font-size: 0.8rem; color: var(--text-muted); }

/* Incidents table */
.incidents-table { width: 100%; border-collapse: collapse; }
.incidents-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.incidents-table td {
  padding: 12px 14px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.incidents-table tr:hover td { background: var(--bg-surface); cursor: pointer; }
.incidents-table .expand-row td {
  background: var(--bg-surface);
  cursor: default;
  padding: 16px 20px;
}
.incident-content { font-size: 0.85rem; color: var(--text-muted); font-family: monospace; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow-y: auto; }

/* Conversation log */
.conv-log { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.conv-msg {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  max-width: 80%;
}
.conv-msg.bot { background: rgba(212,169,106,0.12); align-self: flex-start; }
.conv-msg.accused { background: rgba(138,180,204,0.1); align-self: flex-end; }
.conv-msg.victim  { background: rgba(138,200,164,0.1); align-self: flex-end; }
.conv-msg-speaker { font-size: 0.72rem; color: var(--text-dim); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* Mode pills (channel rules) */
.mode-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.mode-pill {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
}
.mode-pill.active.mode-normal  { background: rgba(154,138,120,0.15); border-color: var(--text-muted); color: var(--text); }
.mode-pill.active.mode-strict  { background: rgba(204,138,138,0.15); border-color: var(--red);        color: var(--red); }
.mode-pill.active.mode-relaxed { background: rgba(138,200,164,0.15); border-color: var(--green);      color: var(--green); }
.mode-pill.active.mode-off     { background: rgba(106,94,82,0.2);    border-color: var(--text-dim);   color: var(--text-dim); }
.mode-pill:hover { border-color: var(--border-2); color: var(--text); }

/* Upgrade gate overlay */
.upgrade-gate {
  position: fixed; inset: 0;
  background: rgba(26,23,19,0.96);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  flex-direction: column;
  text-align: center;
  padding: 24px;
}
.upgrade-gate-title { font-family: var(--font-head); font-size: 2rem; margin-bottom: 16px; }
.upgrade-gate-sub   { color: var(--text-muted); max-width: 420px; margin-bottom: 32px; }

/* Filters bar */
.filters-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-input { max-width: 220px; }

/* Billing credit bar */
.credit-bar-wrap { margin: 16px 0; }
.credit-bar-track {
  height: 8px; border-radius: 100px;
  background: var(--border);
  overflow: hidden;
}
.credit-bar-fill {
  height: 100%; border-radius: 100px;
  background: var(--green);
  transition: width 0.5s ease;
}
.credit-bar-fill.warn  { background: var(--yellow); }
.credit-bar-fill.crit  { background: var(--red); }

/* Rate table */
.rate-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.rate-table th, .rate-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rate-table th { color: var(--text-dim); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rate-table td:last-child { color: var(--text-muted); font-size: 0.8rem; }

/* Loading spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 52px 44px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}
.login-logo { font-family: var(--font-head); font-size: 2rem; color: var(--accent); margin-bottom: 8px; }
.login-sub  { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 36px; }
.btn-discord {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px;
  background: #5865F2;
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  width: 100%;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-discord:hover { background: #4752c4; color: #fff; }
.login-error { font-size: 0.85rem; color: var(--red); margin-top: 20px; }
.login-note  { font-size: 0.8rem; color: var(--text-dim); margin-top: 24px; line-height: 1.5; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* Toast notification */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.3s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* Responsive */
@media (max-width: 768px) {
  .dash-layout { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: static; }
  .dash-main { padding: 20px 16px; }
  .nav-links { gap: 16px; }
  .hero { padding: 72px 0 48px; }
  .pricing-grid { grid-template-columns: 1fr; }
}
