/* ==========================================================================
   Streamed Docs - CSS Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   Custom Properties / Themes
   -------------------------------------------------------------------------- */
:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(240 10% 3.9%);
  --border: hsl(240 5.9% 90%);
  --primary: hsl(142.1 76.2% 36.3%);
  --accent: hsl(240 4.8% 95.9%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 46.1%);
  --card: hsl(0 0% 100%);
}

html.dark,
:root.dark {
  --background: hsl(240 10% 3.9%);
  --foreground: hsl(0 0% 98%);
  --border: hsl(240 3.7% 15.9%);
  --primary: hsl(142.1 76.2% 36.3%);
  --accent: hsl(240 3.7% 15.9%);
  --muted: hsl(240 3.7% 15.9%);
  --muted-foreground: hsl(240 5% 64.9%);
  --card: hsl(240 10% 3.9%);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--background) 95%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-header .container,
.site-header .header-inner,
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  height: 56px;
  align-items: center;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  color: var(--foreground);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: color-mix(in srgb, var(--foreground) 60%, transparent);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: color-mix(in srgb, var(--foreground) 80%, transparent);
}

.nav-links a.active {
  color: var(--foreground);
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--foreground);
  margin-left: auto;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.theme-toggle:hover {
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.discord-link {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  color: var(--foreground);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.discord-link:hover {
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

.discord-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--foreground);
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.mobile-menu-btn:hover {
  background: color-mix(in srgb, var(--foreground) 5%, transparent);
}

/* --------------------------------------------------------------------------
   Layout & Documentation Structure
   -------------------------------------------------------------------------- */
.docs-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  gap: 16px;
}

/* --------------------------------------------------------------------------
   Sidebar Navigation
   -------------------------------------------------------------------------- */
.docs-sidebar {
  width: 200px;
  flex-shrink: 0;
  padding: 8px;
  border-right: 2px solid var(--border);
  text-align: right;
  padding-right: 24px;
}

.sidebar-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  display: block;
  color: var(--foreground);
  text-decoration: none;
}

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

.sidebar-nav a {
  font-size: 20px;
  text-decoration: none;
  color: color-mix(in srgb, var(--foreground) 60%, transparent);
  transition: color 0.2s ease;
}

.sidebar-nav a:hover {
  color: color-mix(in srgb, var(--foreground) 80%, transparent);
}

.sidebar-nav a.active {
  color: var(--foreground);
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
.docs-content {
  flex: 1;
  padding: 8px;
  min-width: 0;
}

.docs-content h1,
h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 16px;
}

.docs-content h2,
h2 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.docs-content h3,
h3 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}

.section {
  margin: 24px 0;
}

p {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Endpoint Cards
   -------------------------------------------------------------------------- */
.endpoint-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  background: var(--card);
}

.endpoint-method {
  font-family: monospace;
  color: var(--primary);
  margin-bottom: 4px;
}

.endpoint-note {
  font-size: 14px;
  margin-top: 8px;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   Code Blocks & Highlighting
   -------------------------------------------------------------------------- */
.code-block {
  position: relative;
  margin: 16px 0;
}

.code-block pre,
pre {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow-x: auto;
  background: #272822;
  color: #ddd;
  font-size: 14px;
  line-height: 1.5;
}

code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ddd;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Syntax Highlighting (Monokai-inspired) */
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-number,
.hljs-name {
  color: #f92672;
}

.hljs-string,
.hljs-title,
.hljs-type,
.hljs-built_in,
.hljs-variable,
.hljs-addition {
  color: #a6e22e;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
  color: #75715e;
}

.hljs-attr,
.hljs-symbol,
.hljs-regexp,
.hljs-link {
  color: #bf79db;
}

.hljs-title.class_ {
  color: white;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-title,
.hljs-section,
.hljs-type,
.hljs-selector-id {
  font-weight: bold;
}

/* --------------------------------------------------------------------------
   API Tables
   -------------------------------------------------------------------------- */
.api-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  margin-bottom: 16px;
}

.api-table th {
  padding: 8px;
  text-align: left;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.api-table td {
  padding: 8px;
}

.api-table tr {
  border-top: 1px solid var(--border);
}

.font-mono {
  font-family: monospace;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */
.steps-list {
  list-style: decimal;
  margin-left: 24px;
  margin-bottom: 16px;
}

.steps-list li {
  margin-bottom: 4px;
}

.tips-list {
  list-style: disc;
  margin-left: 24px;
  margin-bottom: 16px;
}

.tips-list li {
  margin-bottom: 4px;
}

.guidelines-list {
  list-style: disc;
  margin-left: 24px;
  margin-bottom: 16px;
}

.guidelines-list li {
  margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   Quick Start Cards
   -------------------------------------------------------------------------- */
.quick-start {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.quick-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--foreground);
  transition: border-color 0.2s ease, background-color 0.2s ease;
  display: block;
}

.quick-card:hover {
  border-color: var(--primary);
}

.quick-card h3 {
  margin-bottom: 4px;
}

.quick-card p {
  font-size: 14px;
  color: var(--muted-foreground);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.back-link {
  color: var(--primary);
  text-decoration: underline;
  display: inline-block;
  margin-top: 16px;
  margin-bottom: 32px;
}

.text-link {
  color: var(--primary);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .docs-layout {
    flex-direction: column;
  }

  .docs-sidebar {
    border-right: none;
    border-bottom: 2px solid var(--border);
    text-align: left;
    width: 100%;
    padding-bottom: 16px;
    padding-right: 8px;
  }

  .mobile-menu-btn {
    display: flex;
  }
}
