/* Financer Documentation - Style */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  --secondary: #8b5cf6;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --bg: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-code: #f1f5f9;
  --bg-tip: #eff6ff;
  --bg-warn: #fefce8;
  --bg-hero: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --sidebar-width: 280px;
  --header-height: 60px;
  --radius: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--primary-dark);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-logo img {
  height: 32px;
  width: auto;
}

.header-logo span {
  color: rgba(255,255,255,0.5);
  font-size: 14px;
  font-weight: 500;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-links a {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.header-links a:hover {
  color: #fff;
}

.header-links a.btn-bug {
  background: rgba(255,255,255,0.1);
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
}

.header-links a.btn-bug:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  padding: 8px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 24px 0;
  z-index: 50;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  padding: 8px 24px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.sidebar-link {
  display: block;
  padding: 8px 24px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.sidebar-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background: var(--primary-light);
  font-weight: 500;
}

/* Content */
.content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

.content-inner {
  max-width: 780px;
  padding: 48px 48px 80px;
}

/* Hero (index page only) */
.hero {
  background: var(--bg-hero);
  padding: 80px 48px;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
}

.hero-inner {
  max-width: 780px;
}

.hero h1 {
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero p {
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Typography */
h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}

h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
}

p {
  margin-bottom: 16px;
}

.lead {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Lists */
ul, ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--text-muted);
}

/* Code */
code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--primary-dark);
}

/* Callouts/Boxes */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border-left: 4px solid;
  font-size: 14px;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-tip {
  background: var(--bg-tip);
  border-color: var(--primary);
}

.callout-tip .callout-title {
  color: var(--primary);
}

.callout-warn {
  background: var(--bg-warn);
  border-color: var(--warning);
}

.callout-warn .callout-title {
  color: #a16207;
}

.callout-danger {
  background: #fef2f2;
  border-color: var(--danger);
}

.callout-danger .callout-title {
  color: var(--danger);
}

/* Steps */
.steps {
  counter-reset: step;
  padding-left: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  padding-bottom: 24px;
  margin-bottom: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 36px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

/* Feature grid (index) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59,130,246,0.1);
}

.feature-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.feature-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Keyboard shortcuts */
kbd {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  font-family: 'SF Mono', monospace;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  background: var(--bg-sidebar);
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: var(--bg-sidebar);
}

/* Images / Screenshots placeholder */
.screenshot {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0 24px;
  background: var(--bg-code);
  overflow: hidden;
}

.screenshot img {
  width: 100%;
  display: block;
}

.screenshot-caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  margin: 0 6px;
}

/* Page nav (prev/next) */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.page-nav a {
  display: block;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
  flex: 1;
  max-width: 50%;
}

.page-nav a:hover {
  border-color: var(--primary);
  background: var(--bg-sidebar);
}

.page-nav-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.page-nav-title {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.page-nav-next {
  text-align: right;
  margin-left: auto;
}

/* Footer */
.footer {
  margin-left: var(--sidebar-width);
  padding: 24px 48px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.footer a {
  color: var(--text-muted);
}

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

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 60;
    background: var(--bg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .content,
  .hero,
  .footer {
    margin-left: 0;
  }

  .content-inner {
    padding: 24px 20px 60px;
  }

  .hero {
    padding: 48px 20px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .hero p {
    font-size: 16px;
  }

  .footer {
    padding: 20px;
    flex-direction: column;
    gap: 8px;
  }

  .page-nav {
    flex-direction: column;
  }

  .page-nav a {
    max-width: 100%;
  }

  .header-links .hide-mobile {
    display: none;
  }
}
