/* tally-to-xml-tdl documentation styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-dark: #080c14;
  --bg-surface: #0f172a;
  --bg-card: #131c31;
  --bg-card-hover: #19243d;
  --bg-code: #0a0f1d;
  --bg-code-header: #10182b;
  --border: #1e293b;
  --border-light: #2d3b55;
  --border-accent: #10b981;
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #38bdf8;
  --accent-cyan-glow: rgba(6, 182, 212, 0.15);

  --accent-purple: #a855f7;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --gradient-brand: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --gradient-glow: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(6, 182, 212, 0.2) 100%);
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px -5px rgba(16, 185, 129, 0.25);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle background grid pattern */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 500px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-brand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 9999px;
  font-weight: 500;
}

/* Nav Tabs */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  background: var(--bg-card);
  color: var(--accent-emerald-light);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.nav-link.active svg {
  opacity: 1;
  stroke: var(--accent-emerald-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-install-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px 5px 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-install-pill:hover {
  border-color: var(--border-light);
  background: var(--bg-card);
  color: var(--text-main);
}

.quick-install-pill svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.quick-install-pill:hover svg {
  opacity: 1;
}

.nav-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-icon-link:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  background: var(--bg-card);
}

/* Page Layout */
.page-wrapper {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
  padding: 36px 24px 80px 24px;
}

/* Single column for Readme */
.doc-single-column {
  max-width: 860px;
  margin: 0 auto;
}

/* Two column for Guide */
.doc-guide-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* Sticky Sidebar */
.guide-sidebar {
  position: sticky;
  top: 96px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
  padding-left: 8px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  display: block;
  font-size: 0.86rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 6px;
  transition: all 0.15s ease;
  line-height: 1.4;
}

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

.sidebar-nav a.active {
  color: var(--accent-emerald-light);
  background: rgba(16, 185, 129, 0.1);
  font-weight: 600;
}

/* Cross-link Banners */
.crosslink-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
}

.crosslink-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crosslink-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.crosslink-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.crosslink-text p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-brand);
  color: #04121a;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 9999px;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
}

.btn-pill svg {
  width: 14px;
  height: 14px;
  stroke: #04121a;
  stroke-width: 2.5;
}

/* Hero Section */
.hero {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-emerald-light);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff 30%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin-bottom: 20px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.meta-chip strong {
  color: var(--text-main);
}

/* Flowchart / How It Works */
.flow-diagram {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}

.flow-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  position: relative;
}

.flow-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
  position: relative;
  transition: all 0.2s ease;
}

.flow-step-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  background: var(--bg-card-hover);
}

.flow-step-num {
  width: 24px;
  height: 24px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-light);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
}

.flow-step-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.flow-step-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.flow-pipeline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
}

.flow-pipeline-bar span.active {
  color: var(--accent-emerald-light);
  font-weight: 600;
}

.flow-pipeline-bar .arrow {
  color: var(--accent-cyan);
}

/* Content Sections */
.section {
  margin-bottom: 48px;
}

.section-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 32px 0 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-heading a.anchor-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.15s;
}

.section-heading:hover a.anchor-link {
  opacity: 1;
}

.sub-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 24px 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 0.96rem;
}

strong {
  color: var(--text-main);
}

/* Numbered Steps / Lists */
.step-list {
  list-style: none;
  margin: 16px 0 24px 0;
  counter-reset: step-counter;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 40px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--accent-emerald-light);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Code Blocks */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0 24px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-header {
  background: var(--bg-code-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
}

.code-lang-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.code-lang-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border-color: var(--border-light);
}

.copy-btn.copied {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-light);
  border-color: rgba(16, 185, 129, 0.4);
}

.code-block pre {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Syntax Highlighting Tokens */
.syn-kw { color: #ff7b72; font-weight: 500; }     /* keyword: import, export, await, const */
.syn-str { color: #a5d6ff; }                     /* string: "..." */
.syn-fn { color: #d2a8ff; }                      /* function: get, period, all */
.syn-num { color: #79c0ff; }                     /* number */
.syn-comment { color: #64748b; font-style: italic; } /* comments */
.syn-tag { color: #7ee787; }                     /* XML tag */
.syn-prop { color: #79c0ff; }                    /* property / variable */
.syn-punc { color: #94a3b8; }                    /* punctuation */

code.inline-code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--accent-cyan-light);
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Data Tables */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 18px 0 26px 0;
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.query-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan-light);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 500;
}

.error-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.25);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
}

/* Callouts */
.callout {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.92rem;
}

.callout-info {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #bfdbfe;
}

.callout-info svg {
  width: 20px;
  height: 20px;
  stroke: #60a5fa;
  flex-shrink: 0;
  margin-top: 2px;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde68a;
}

.callout-warning svg {
  width: 20px;
  height: 20px;
  stroke: #fbbf24;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Architecture Tree View */
.file-tree {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 18px 0;
}

.file-tree .dir {
  color: var(--accent-cyan-light);
  font-weight: 600;
}

.file-tree .file {
  color: #e2e8f0;
}

.file-tree .desc {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  margin-left: 12px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 32px 24px;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* Mobile responsive */
@media (max-width: 900px) {
  .doc-guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-sidebar {
    position: static;
    max-height: none;
    margin-bottom: 24px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .nav-container {
    padding: 0 16px;
  }

  .quick-install-pill {
    display: none;
  }
}
