/* ========================================
   AGENTS-PROMPTS DOCS — DARK THEME
   ======================================== */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-code: #1a1a26;
  --bg-badge: #252535;
  --bg-highlight: rgba(99, 102, 241, 0.08);
  --border-color: #2a2a3a;
  --border-accent: #3d3d55;
  --text-primary: #e8e8f0;
  --text-secondary: #9898b0;
  --text-muted: #6a6a82;
  --text-code: #c5c5e0;
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --accent-glow: rgba(99, 102, 241, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);
  --transition: all 0.2s ease;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

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

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

/* ---- LAYOUT ---- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- HEADER ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 6px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.4;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  position: relative;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- CARDS GRID ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  padding: 20px 0 60px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-badge);
  flex-shrink: 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 16px;
}

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

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-badge);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.tag.tag-tools { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.tag.tag-risk { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.tag.tag-flow { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.2); }
.tag.tag-proprietary { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.2); }
.tag.tag-opensource { background: rgba(99, 102, 241, 0.12); color: #a78bfa; border-color: rgba(99, 102, 241, 0.2); }

/* ---- PAGE CONTENT (individual agent pages) ---- */
.page-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

.page-hero .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page-hero .breadcrumb a {
  color: var(--accent-secondary);
  text-decoration: none;
}

.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.page-hero .lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
}

.content-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding-bottom: 80px;
}

/* Sidebar TOC */
.sidebar {
  position: sticky;
  top: 88px;
  height: fit-content;
}

.toc-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.toc-list {
  list-style: none;
  border-left: 2px solid var(--border-color);
}

.toc-list li a {
  display: block;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: var(--transition);
}

.toc-list li a:hover,
.toc-list li a.active {
  color: var(--accent-secondary);
  border-left-color: var(--accent-primary);
  background: var(--bg-highlight);
}

/* Main content */
.main-content section {
  margin-bottom: 48px;
}

.main-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-content h2 .section-icon {
  font-size: 1.2rem;
}

.main-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--accent-secondary);
}

.main-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.main-content ul, .main-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.main-content li {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.6;
}

.main-content li strong {
  color: var(--text-primary);
}

/* Info boxes */
.info-box {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border-left: 4px solid;
}

.info-box.risk {
  background: rgba(239, 68, 68, 0.06);
  border-color: var(--danger);
}

.info-box.success {
  background: rgba(34, 197, 94, 0.06);
  border-color: var(--success);
}

.info-box.warning {
  background: rgba(245, 158, 11, 0.06);
  border-color: var(--warning);
}

.info-box.info {
  background: rgba(59, 130, 246, 0.06);
  border-color: var(--info);
}

.info-box-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box p {
  font-size: 0.9rem;
  margin-bottom: 0;
}

/* Data flow diagram */
.flow-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-code);
  overflow-x: auto;
  white-space: pre;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.tool-item {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: var(--transition);
}

.tool-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.tool-name {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 4px;
}

.tool-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Rules list */
.rules-list {
  list-style: none;
  padding: 0;
}

.rules-list li {
  padding: 12px 16px;
  border-left: 3px solid var(--border-color);
  margin-bottom: 8px;
  background: var(--bg-code);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
}

.rules-list li.critical {
  border-left-color: var(--danger);
}

.rules-list li.important {
  border-left-color: var(--warning);
}

.rules-list li.standard {
  border-left-color: var(--info);
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ---- COMPARATIVO TABLE ---- */
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.comparison-table th {
  background: var(--bg-code);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.comparison-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table tr:hover td {
  background: var(--bg-highlight);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
  .hero h1 { font-size: 2rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0; }
  .nav-links { display: none; }
}

@media (max-width: 600px) {
  .hero { padding: 48px 16px 32px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 16px; }
  .container { padding: 0 16px; }
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeInUp 0.4s ease both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
.card:nth-child(7) { animation-delay: 0.3s; }
.card:nth-child(8) { animation-delay: 0.35s; }
.card:nth-child(9) { animation-delay: 0.4s; }
.card:nth-child(10) { animation-delay: 0.45s; }
.card:nth-child(11) { animation-delay: 0.5s; }
.card:nth-child(12) { animation-delay: 0.55s; }
.card:nth-child(13) { animation-delay: 0.6s; }
.card:nth-child(14) { animation-delay: 0.65s; }
.card:nth-child(15) { animation-delay: 0.7s; }

/* Scroll indicator for TOC */
.toc-list li a.visible {
  color: var(--text-primary);
}
