/* ==========================================================================
   BotPerks Design System & Stylesheet
   Pure Vanilla CSS • Strict WCAG 2.1 AAA Contrast • Responsive Grid
   ========================================================================== */

:root {
  /* Dark Theme Palette (Default) */
  --bg-canvas: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-raised: #121212;
  --bg-surface-hover: #1c1c1c;
  
  --border-subtle: #222222;
  --border-medium: #333333;
  --border-focus: #10b981;

  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #888888;
  
  /* Accent: Electric Emerald */
  --accent-emerald: #10b981;
  --accent-emerald-hover: #34d399;
  --accent-emerald-text: #000000;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-emerald-border: rgba(16, 185, 129, 0.35);

  --badge-exclusive-bg: rgba(16, 185, 129, 0.15);
  --badge-exclusive-text: #34d399;
  
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.7);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="light"] {
  /* Light Theme Palette */
  --bg-canvas: #ffffff;
  --bg-surface: #f8f9fa;
  --bg-surface-raised: #f1f3f5;
  --bg-surface-hover: #e9ecef;

  --border-subtle: #e5e7eb;
  --border-medium: #d1d5db;
  --border-focus: #047857;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;

  --accent-emerald: #047857;
  --accent-emerald-hover: #065f46;
  --accent-emerald-text: #ffffff;
  --accent-emerald-subtle: rgba(4, 120, 87, 0.12);
  --accent-emerald-border: rgba(4, 120, 87, 0.35);

  --badge-exclusive-bg: rgba(4, 120, 87, 0.12);
  --badge-exclusive-text: #065f46;

  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-raised: 0 8px 20px rgba(0, 0, 0, 0.08);
}

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

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Utilities */
.hidden {
  display: none !important;
}

.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .text-gradient {
  background: linear-gradient(135deg, #047857 0%, #065f46 50%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Top Announcement Banner */
.top-banner {
  background-color: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.top-banner code {
  font-family: var(--font-mono);
  background-color: var(--bg-surface);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  color: var(--accent-emerald);
}

.banner-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* Header & Nav */
.site-header {
  background-color: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-icon {
  font-size: 1.35rem;
}

.brand-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background-color: var(--accent-emerald-subtle);
  color: var(--accent-emerald);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--accent-emerald-border);
  font-weight: 600;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-primary);
}

.nav-item.code-link {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.nav-item.code-link:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--accent-emerald);
  color: var(--accent-emerald-text);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-primary:hover {
  background-color: var(--accent-emerald-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-surface-raised);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-secondary:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--border-medium);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  background-color: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 6px;
  font-size: 1rem;
}

.btn-icon:hover {
  background-color: var(--bg-surface-hover);
}

/* Hero Section */
.hero-section {
  padding: 4rem 0 2.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .hero-section {
  background: radial-gradient(circle at 50% 0%, rgba(4, 120, 87, 0.06) 0%, transparent 60%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.badge-pulse {
  width: 6px;
  height: 6px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
}

.stat-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-emerald);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Interactive Agent Terminal */
.terminal-section {
  padding: 1.5rem 0;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.terminal-window {
  background-color: #0d1117;
  border: 1px solid #30363d;
  border-radius: 8px;
  box-shadow: var(--shadow-raised);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-titlebar {
  background-color: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.terminal-title {
  color: #8b949e;
  font-size: 0.75rem;
}

.terminal-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.terminal-close:hover {
  color: #ffffff;
}

.terminal-body {
  padding: 1rem;
  max-height: 380px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.terminal-prompt-line {
  color: #c9d1d9;
  margin-bottom: 0.75rem;
}

.prompt-user { color: #58a6ff; }
.prompt-path { color: #f0883e; }
.prompt-cmd { color: #7ee787; }

.terminal-content {
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* Catalog Controls Section */
.catalog-section {
  padding: 2.5rem 0 4rem;
  flex: 1;
}

.controls-wrapper {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 2.25rem 0.75rem 2.5rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-emerald-subtle);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.clear-search-btn:hover {
  color: var(--text-primary);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.toggle-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  display: inline-block;
  position: relative;
  transition: all var(--transition-fast);
}

.toggle-checkbox input:checked ~ .checkbox-custom {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.toggle-checkbox input:checked ~ .checkbox-custom::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid var(--accent-emerald-text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.sort-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.select-input {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
  cursor: pointer;
}

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

/* Category Pills */
.category-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  scrollbar-width: thin;
}

.pill {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.pill:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.pill.active {
  background-color: var(--accent-emerald-subtle);
  border-color: var(--accent-emerald-border);
  color: var(--accent-emerald);
  font-weight: 600;
}

.pill-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Results Meta */
.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.filter-active-tag {
  background-color: var(--bg-surface-raised);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

/* Perks Card Grid */
.perks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.perk-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.perk-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.perk-card.agent-exclusive {
  border-color: rgba(16, 185, 129, 0.25);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.provider-info {
  display: flex;
  flex-direction: column;
}

.provider-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.card-badges {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.badge-exclusive {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background-color: var(--badge-exclusive-bg);
  color: var(--badge-exclusive-text);
  border: 1px solid var(--accent-emerald-border);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.card-discount {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-instructions {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  flex: 1;
}

/* Promo Code Box */
.promo-code-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-raised);
  border: 1px dashed var(--border-medium);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}

.promo-code-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

.btn-copy-code {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background-color: var(--accent-emerald);
  color: var(--accent-emerald-text);
  border-color: var(--accent-emerald);
}

.btn-copy-code.copied {
  background-color: var(--accent-emerald);
  color: var(--accent-emerald-text);
  border-color: var(--accent-emerald);
}

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.btn-redeem {
  background-color: var(--accent-emerald);
  color: var(--accent-emerald-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.8125rem;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background-color var(--transition-fast);
}

.btn-redeem:hover {
  background-color: var(--accent-emerald-hover);
}

.card-feedback {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.confidence-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-vote {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.btn-vote:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.btn-vote.active {
  background-color: var(--accent-emerald-subtle);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: inline-block;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

/* Loading Spinner */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-emerald);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Agent Docs Section */
.docs-section {
  padding: 4rem 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

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

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.doc-card {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.doc-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-emerald);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.doc-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.doc-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex: 1;
}

.code-snippet {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-x: auto;
}

.snippet-comment {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.code-snippet code {
  color: var(--accent-emerald);
}

/* MCP Config Block */
.mcp-config-box {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}

.mcp-config-header {
  background-color: var(--bg-surface-raised);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mcp-config-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.btn-copy-sm {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-copy-sm:hover {
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
}

.mcp-config-box pre {
  padding: 1rem;
  margin: 0;
  background-color: var(--bg-canvas);
  overflow-x: auto;
}

.mcp-config-box code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Modal Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-raised);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-heading {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-form {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input, .form-group select, .form-group textarea {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--border-focus);
}

.checkbox-row {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
}

.form-error {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.form-success {
  background-color: var(--accent-emerald-subtle);
  border: 1px solid var(--accent-emerald-border);
  color: var(--accent-emerald);
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background-color: var(--bg-surface-raised);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-raised);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.2s ease-out;
}

.toast.success {
  border-color: var(--accent-emerald);
}

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 0 2rem;
  margin-top: auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-left {
  max-width: 360px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 3.5rem;
  flex-wrap: wrap;
}

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.footer-column a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition-fast);
}

.footer-column a:hover {
  color: var(--accent-emerald);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .hero-title {
    font-size: 2.15rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .docs-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .perks-grid {
    grid-template-columns: 1fr;
  }
  .controls-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-controls {
    justify-content: space-between;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
