/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #090e1a;
  --bg-card: #111827;
  --bg-card-hover: #131c2e;
  --bg-tab-active: #1a2540;
  --border: #1e2d47;
  --border-light: #243048;
  --accent: #eab308;
  --accent-dim: rgba(234, 179, 8, 0.12);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --sheet-bg: #0f1f3a;
  --sheet-text: #60a5fa;
  --tag-bg: #1e293b;
  --tag-text: #94a3b8;
  --user-bg: #1a2035;
  --bot-bg: #0f1929;
  --user-label-color: #60a5fa;
  --bot-label-color: #34d399;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --header-h: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===========================
   HEADER
=========================== */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 14, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-icon {
  font-size: 18px;
}

.brand-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-dot {
  color: var(--text-muted);
  margin: 0 2px;
}

/* Filter Nav */
.filter-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-btn:hover {
  color: var(--text-primary);
  background: var(--border);
  border-color: var(--border-light);
}

.filter-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(234, 179, 8, 0.3);
}

/* ===========================
   HERO
=========================== */
.hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 72px 24px 48px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #93c5fd;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.hero-badge .sep {
  color: rgba(147, 197, 253, 0.4);
}

.hero-headline {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.hero-headline .highlight {
  color: var(--accent);
}

.hero-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 40px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 500px;
  margin: 0 auto;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===========================
   SEARCH
=========================== */
.search-section {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.5;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 13px 16px 13px 44px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.08);
}

/* ===========================
   USE CASES SECTION
=========================== */
.usecases-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

.usecases-header {
  margin-bottom: 20px;
}

.usecases-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-num { font-size: 22px; }
}

/* ===========================
   CARD
=========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

.card-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

/* Tags */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* Sheets */
.card-sheets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sheet-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 2px;
}

.sheet-item {
  background: var(--sheet-bg);
  color: var(--sheet-text);
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(96, 165, 250, 0.15);
}

/* Card Tabs */
.card-tabs {
  display: flex;
  gap: 2px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-secondary);
  background: var(--bg-tab-active);
}

.tab-btn.active {
  background: var(--bg-tab-active);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

/* Tab Content */
.tab-content {
  flex: 1;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: fadeIn 0.15s ease;
}

.tab-pane.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* System Prompt */
.prompt-text {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  padding: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  margin: 0;
}

.copy-btn {
  align-self: flex-start;
  background: var(--bg-tab-active);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.16s ease;
}

.copy-btn:hover {
  background: var(--accent-dim);
  border-color: rgba(234, 179, 8, 0.35);
  color: var(--accent);
}

.copy-btn.copied {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  color: #34d399;
}

/* Q&A */
.qa-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.qa-block:last-child {
  margin-bottom: 0;
}

.qa-user,
.qa-bot {
  font-size: 13px;
  line-height: 1.55;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.qa-user {
  background: var(--user-bg);
  border: 1px solid rgba(96, 165, 250, 0.1);
  color: var(--text-primary);
}

.qa-bot {
  background: var(--bot-bg);
  border: 1px solid rgba(52, 211, 153, 0.1);
  color: #d1d5db;
}

.qa-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}

.user-label {
  background: rgba(96, 165, 250, 0.15);
  color: var(--user-label-color);
}

.bot-label {
  background: rgba(52, 211, 153, 0.12);
  color: var(--bot-label-color);
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.no-results p {
  font-size: 15px;
}

/* Card hidden */
.card.hidden {
  display: none;
}

/* ===========================
   BEST PRACTICES
=========================== */
.best-practices {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px 80px;
  border-top: 1px solid var(--border);
}

.bp-header {
  margin-bottom: 32px;
  padding-top: 48px;
}

.bp-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.bp-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.bp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .bp-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .bp-grid { grid-template-columns: 1fr; }
}

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

.bp-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.bp-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  margin-bottom: 10px;
  opacity: 0.8;
}

.bp-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.bp-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================
   FOOTER
=========================== */
.footer-divider {
  height: 1px;
  background: var(--border);
  max-width: 1200px;
  margin: 0 auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-left {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-right {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===========================
   TOAST
=========================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a2540;
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===========================
   SCROLLBAR
=========================== */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}
