/* Fast.io API Documentation - Static Site Styles
   Brand colors and typography from Fast.io design system */

:root {
  /* Brand */
  --brand-blue: #006cfa;
  --brand-hover: #0056e0;
  --brand-dark: #0D0557;

  /* Accent */
  --accent-red: #FF4C57;
  --accent-purple: #CB37FF;
  --accent-blue: #0469FF;

  /* Neutral (light mode) */
  --bg: #ffffff;
  --bg-subtle: #f6f7f8;
  --bg-code: #f0f2f5;
  --border: #e2e4e8;
  --border-light: #eef0f3;
  --text-primary: #222835;
  --text-secondary: #71757f;
  --text-inverse: #ffffff;

  /* Semantic */
  --success: #17cf79;
  --caution: #ffd666;
  --danger: #fe714d;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.05), 0 2px 6px rgba(0,0,0,0.05);

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Menlo, Courier, monospace;

  /* Sizing */
  --sidebar-width: 260px;
  --content-max: 900px;
  --header-height: 56px;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1017;
    --bg-subtle: #151921;
    --bg-code: #1a1f2b;
    --border: #2a303a;
    --border-light: #1f2530;
    --text-primary: #e4e5e7;
    --text-secondary: #8b8f98;
    --text-inverse: #0d1017;
    --brand-blue: #4888ff;
    --brand-hover: #6b9aff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
  }
}

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

html {
  font-size: 16px;
  line-height: 1.5;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.92);
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(13,16,23,0.92);
  }
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
}

.site-header .logo svg {
  display: block;
  height: 28px;
  width: 140px;
  max-height: 28px;
  flex-shrink: 0;
}

.site-header .logo svg.logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .site-header .logo svg.logo-light {
    display: none;
  }
  .site-header .logo svg.logo-dark {
    display: block;
  }
}

.site-header .logo-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.site-header .logo-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.site-header nav a:hover {
  color: var(--brand-blue);
}

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: var(--header-height);
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
  font-size: 13px;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

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

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 4px 8px;
  margin-bottom: 4px;
}

.sidebar a {
  display: block;
  padding: 5px 8px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
  line-height: 1.4;
}

.sidebar a:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.sidebar a.active {
  color: var(--brand-blue);
  background: rgba(0, 108, 250, 0.08);
  font-weight: 500;
}

.sidebar .toc-h3 {
  padding-left: 20px;
  font-size: 12px;
}

/* Main content */
.content {
  flex: 1;
  min-width: 0;
  max-width: var(--content-max);
  padding: 32px 40px 80px;
}

.content-wide {
  max-width: 1100px;
}

/* Typography */
h1 {
  font-size: 28px;
  line-height: 38px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

h1 .subtitle {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 24px;
  margin-top: 8px;
}

h2 {
  font-size: 20px;
  line-height: 30px;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
}

h4 {
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 6px;
}

p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 22px;
}

/* Links */
a {
  color: var(--brand-blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-bottom: 12px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 22px;
}

li {
  margin-bottom: 4px;
}

li > ul, li > ol {
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--accent-red);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 20px;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 13px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 20px;
}

th {
  text-align: left;
  font-weight: 600;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

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

/* Blockquote / callout */
blockquote {
  border-left: 3px solid var(--brand-blue);
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg-subtle);
  border-radius: 0 6px 6px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Endpoint badges */
.method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.method-get {
  background: rgba(23, 207, 121, 0.12);
  color: #0da85e;
}

.method-post {
  background: rgba(0, 108, 250, 0.1);
  color: var(--brand-blue);
}

.method-put {
  background: rgba(255, 214, 102, 0.2);
  color: #b8930a;
}

.method-delete {
  background: rgba(254, 113, 77, 0.12);
  color: #d4452a;
}

@media (prefers-color-scheme: dark) {
  .method-get {
    background: rgba(23, 207, 121, 0.15);
    color: #3ddb8f;
  }
  .method-post {
    background: rgba(72, 136, 255, 0.15);
    color: #6ba3ff;
  }
  .method-put {
    background: rgba(255, 214, 102, 0.15);
    color: #ffd666;
  }
  .method-delete {
    background: rgba(254, 113, 77, 0.15);
    color: #ff8a70;
  }
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-all;
}

/* Endpoint block */
.endpoint {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 6px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.endpoint-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Parameter table */
.params-table {
  font-size: 13px;
}

.params-table th {
  font-size: 11px;
}

.params-table .param-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--brand-blue);
}

.params-table .param-type {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.params-table .param-required {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-red);
}

/* Category cards (index page) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.category-card {
  display: block;
  padding: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
}

.category-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.category-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.category-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* Meta info bar */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-secondary);
}

.meta-bar code {
  font-size: 12px;
}

/* Hero section */
.hero {
  margin-bottom: 32px;
}

.hero-tagline {
  font-size: 18px;
  line-height: 28px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

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

  .site-header {
    padding: 0 16px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 24px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}

/* Strong / Bold */
strong {
  font-weight: 600;
}

/* Definition-style items */
.def-list {
  margin-bottom: 16px;
}

.def-list dt {
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
}

.def-list dd {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 0;
  padding-left: 16px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 40px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

/* Back to top */
.back-to-top {
  display: inline-block;
  margin-top: 24px;
  font-size: 13px;
}

/* Print */
@media print {
  .sidebar, .site-header nav {
    display: none;
  }

  .site-header {
    position: static;
  }

  .content {
    max-width: 100%;
    padding: 0;
  }
}
