/* ========================================
   ParseFlow Documentation - Styles
   ======================================== */

:root {
  /* Colors */
  --bg-primary: #050506;
  --bg-secondary: #0a0a0c;
  --bg-tertiary: #111114;
  --bg-card: #0d0d10;

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --accent-light: #2dd4bf;
  --accent-glow: rgba(20, 184, 166, 0.4);

  --border: #1f1f23;
  --border-light: #2a2a2f;
  --border-accent: rgba(20, 184, 166, 0.3);

  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --nav-height: 64px;
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 2rem);
}

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

::selection {
  background-color: var(--accent);
  color: var(--bg-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-light);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========================================
   Navigation
   ======================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(5, 5, 6, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--text-primary);
}

.nav-logo {
  width: 32px;
  height: 32px;
}

.nav-docs-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  border-radius: 4px;
  margin-left: 0.25rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg-primary) !important;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

/* ========================================
   Hero
   ======================================== */

.hero {
  position: relative;
  padding: calc(var(--nav-height) + 6rem) 0 6rem;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  height: 400px;
  background: radial-gradient(ellipse at center top, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.text-accent {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 10px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg-primary);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ========================================
   Documentation Layout
   ======================================== */

.main {
  min-height: 100vh;
  padding-bottom: 6rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 4rem;
}

@media (max-width: 1000px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }
}

/* ========================================
   Sidebar
   ======================================== */

.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
  height: fit-content;
  max-height: calc(100vh - var(--nav-height) - 4rem);
  overflow-y: auto;
  padding-right: 1rem;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section li {
  margin-bottom: 0.25rem;
}

.sidebar-section a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.sidebar-section a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-section a.active {
  color: var(--accent);
  background: rgba(20, 184, 166, 0.1);
}

/* ========================================
   Content
   ======================================== */

.content {
  max-width: 800px;
}

.doc-section {
  padding-top: 2rem;
  margin-bottom: 4rem;
}

.doc-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.doc-section h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.doc-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.doc-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.doc-section ul,
.doc-section ol {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.doc-section li {
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* ========================================
   Info & Warning Boxes
   ======================================== */

.info-box,
.warning-box {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.info-box {
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid var(--border-accent);
}

.info-box-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.info-box strong {
  color: var(--accent);
}

.info-box p {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

.warning-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.warning-box-icon {
  color: var(--warning);
  flex-shrink: 0;
}

.warning-box strong {
  color: var(--warning);
}

.warning-box p {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
}

/* ========================================
   Feature Grid
   ======================================== */

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

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

.feature-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}

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

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 184, 166, 0.1);
  border-radius: 10px;
  color: var(--accent);
  margin-bottom: 1rem;
}

.feature-card h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
}

/* ========================================
   Steps
   ======================================== */

.steps {
  margin: 1.5rem 0;
}

.step {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.step:last-child {
  border-bottom: none;
}

.step-number {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.step-content h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.step-content p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ========================================
   Code Blocks
   ======================================== */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--accent-light);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  padding: 0.2em 0.5em;
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--border);
}

.code-block {
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.code-header {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 0;
}

.code-block code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  line-height: 1.7;
}

/* ========================================
   Example Box
   ======================================== */

.example-box {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.example-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.example-content {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  white-space: pre-wrap;
}

.example-before {
  color: var(--text-secondary);
  border-left: 3px solid var(--text-muted);
}

.example-after {
  color: var(--text-primary);
  border-left: 3px solid var(--accent);
}

.example-arrow {
  display: flex;
  justify-content: center;
  padding: 1rem;
  color: var(--accent);
}

/* ========================================
   Flow Diagram
   ======================================== */

.flow-diagram {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.flow-step {
  text-align: center;
  max-width: 140px;
}

.flow-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 184, 166, 0.1);
  border-radius: 16px;
  color: var(--accent);
  margin: 0 auto 1rem;
}

.flow-step h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
}

.flow-step p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--text-muted);
  padding-top: 1rem;
}

@media (max-width: 700px) {
  .flow-arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}

/* ========================================
   Feature Detail
   ======================================== */

.feature-detail {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1rem 0;
}

.feature-detail h3 {
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
}

.feature-detail p {
  margin: 0;
}

/* ========================================
   Use Cases
   ======================================== */

.use-case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

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

@media (max-width: 500px) {
  .use-case-grid {
    grid-template-columns: 1fr;
  }
}

.use-case {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.use-case h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
  color: var(--accent);
}

.use-case p {
  margin: 0;
  font-size: 0.875rem;
}

/* ========================================
   Tables
   ======================================== */

.config-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
}

.config-table th,
.config-table td {
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.config-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-secondary);
}

.config-table td {
  color: var(--text-secondary);
}

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

/* ========================================
   FAQ
   ======================================== */

.faq-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.faq-item p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ========================================
   Troubleshooting
   ======================================== */

.trouble-item {
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 1rem 0;
}

.trouble-item h4 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--error);
}

.trouble-item ul {
  margin: 0;
  padding-left: 1.25rem;
}

.trouble-item li {
  font-size: 0.9375rem;
  margin-bottom: 0.375rem;
}

/* ========================================
   Support
   ======================================== */

.support-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (max-width: 500px) {
  .support-options {
    grid-template-columns: 1fr;
  }
}

.support-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  transition: all 0.2s;
}

.support-card:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.support-card svg {
  color: var(--accent);
  margin-bottom: 1rem;
}

.support-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.support-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   Requirements List
   ======================================== */

.requirements-list {
  list-style: none;
  padding: 0;
}

.requirements-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.requirements-list li:last-child {
  border-bottom: none;
}

.requirements-list li::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border-radius: 50%;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ========================================
   Footer
   ======================================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.footer-logo {
  width: 28px;
  height: 28px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

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

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

@media (max-width: 700px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* ========================================
   Scrollbar
   ======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
