/* SparkAI - Documentation Styles */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #09090b;
  color: #e4e4e7;
  line-height: 1.6;
  font-size: 15px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Nav */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(9, 9, 11, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #1f1f23;
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: #fafafa;
  text-decoration: none;
}
.logo img { height: 28px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  color: #71717a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #fafafa; }

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  padding-right: 24px;
  border-right: 1px solid #1f1f23;
}
.sidebar-section {
  margin-bottom: 24px;
}
.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #52525b;
  margin-bottom: 8px;
}
.sidebar-link {
  display: block;
  padding: 6px 0;
  color: #a1a1aa;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
.sidebar-link:hover { color: #e4e4e7; }
.sidebar-link.active { color: #fafafa; font-weight: 500; }

/* Content */
.content {
  max-width: 800px;
  min-width: 0;
}

.hero-mini {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #1f1f23;
}
.hero-mini h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-mini .subtitle {
  color: #71717a;
  font-size: 18px;
}

section {
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1f1f23;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: #fafafa;
}

p {
  margin-bottom: 16px;
  color: #a1a1aa;
}

a { color: #818cf8; }
a:hover { color: #a5b4fc; }

ol, ul {
  margin: 0 0 16px 24px;
  color: #a1a1aa;
}
li { margin-bottom: 8px; }

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  background: #18181b;
  padding: 2px 6px;
  border-radius: 4px;
  color: #e4e4e7;
}

/* Steps */
.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 24px 0;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #74749b, #9494b8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.step-content h3 { margin: 0 0 4px; }
.step-content p { margin: 0; }

/* Code Blocks */
.code-block {
  position: relative;
  background: #0c0c0e;
  border: 1px solid #1f1f23;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}
.code-block .code-header {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #52525b;
  background: #111113;
  border-bottom: 1px solid #1f1f23;
}
.code-block pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
}
.code-block code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: #e4e4e7;
  background: transparent;
  padding: 0;
}
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #52525b;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.copy-btn:hover {
  color: #a1a1aa;
  background: rgba(255,255,255,0.08);
}
.copy-btn.copied {
  color: #22c55e;
}

/* CSS-only icons */
.icon-copy {
  width: 14px;
  height: 14px;
  position: relative;
}
.icon-copy::before,
.icon-copy::after {
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}
.icon-copy::before {
  width: 9px;
  height: 9px;
  top: 0;
  left: 0;
}
.icon-copy::after {
  width: 9px;
  height: 9px;
  bottom: 0;
  right: 0;
  background: #0c0c0e;
}
.icon-check {
  width: 14px;
  height: 14px;
  position: relative;
}
.icon-check::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 5px;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  top: 3px;
  left: 3px;
}

/* Endpoint */
.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #0c0c0e;
  border: 1px solid #1f1f23;
  border-radius: 8px;
  margin: 16px 0;
}
.method {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 4px;
}
.endpoint code {
  background: transparent;
  padding: 0;
  font-size: 14px;
}

/* Options Table */
.options-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
.options-table th,
.options-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #1f1f23;
}
.options-table th {
  font-weight: 600;
  color: #71717a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.options-table td { color: #a1a1aa; }
.options-table td code {
  font-size: 12px;
}

/* Tip */
.tip {
  padding: 12px 16px;
  background: rgba(129, 140, 248, 0.08);
  border-left: 3px solid #818cf8;
  border-radius: 0 6px 6px 0;
  color: #a5b4fc;
  font-size: 14px;
}

/* Playground */
.playground-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.playground-config,
.playground-preview {
  padding: 20px;
  background: #111113;
  border: 1px solid #1f1f23;
  border-radius: 10px;
}
.playground-config h3 {
  margin: 0 0 16px;
}
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.config-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.config-item label {
  font-size: 12px;
  font-weight: 500;
  color: #71717a;
}
.config-item input,
.config-item select {
  padding: 8px 12px;
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 6px;
  color: #e4e4e7;
  font-size: 14px;
}
.config-item input[type="color"] {
  padding: 4px;
  height: 36px;
  cursor: pointer;
}
.config-item input:focus,
.config-item select:focus {
  outline: none;
  border-color: #74749b;
}
.icon-picker {
  display: flex;
  gap: 8px;
}
.icon-option {
  width: 40px;
  height: 40px;
  padding: 6px;
  background: #09090b;
  border: 2px solid #27272a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.icon-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.icon-option:hover {
  border-color: #52525b;
}
.icon-option.active {
  border-color: #74749b;
  background: rgba(116, 116, 155, 0.1);
}
.btn-apply {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #74749b, #9494b8);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-apply:hover { opacity: 0.9; }
.preview-label {
  font-size: 12px;
  font-weight: 500;
  color: #52525b;
  margin-bottom: 12px;
}
.playground-preview p {
  color: #71717a;
  font-size: 14px;
  margin: 0;
}

/* Footer */
footer {
  padding: 24px 0;
  border-top: 1px solid #1f1f23;
}
footer .container {
  display: flex;
  justify-content: center;
  gap: 24px;
}
footer a {
  color: #52525b;
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
footer a:hover { color: #a1a1aa; }

/* Responsive */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .playground-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
}
