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

/* shadcn dark mode color palette */
:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 240 5.9% 10%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 240 4.9% 83.9%;
  --radius: 0.5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: hsl(var(--card));
  border-right: 1px solid hsl(var(--border));
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-weight: 600;
  font-size: 1.125rem;
}

.logo svg {
  color: hsl(var(--muted-foreground));
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section {
  padding: 0.5rem 1.5rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.nav-list {
  list-style: none;
}

.nav-link {
  display: block;
  padding: 0.5rem 0.75rem;
  margin: 0.125rem 0;
  border-radius: var(--radius);
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

.nav-link.active {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  position: sticky;
  top: 0;
  z-index: 40;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
}

.mobile-menu-btn:hover {
  background-color: hsl(var(--accent));
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}

.header-link:hover {
  color: hsl(var(--foreground));
}

/* Content */
.content {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 900px;
}

.doc-section {
  margin-bottom: 4rem;
  scroll-margin-top: 5rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: hsl(var(--muted-foreground));
}

p.lead {
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  line-height: 1.7;
}

/* Code blocks */
.code-block {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background-color: hsl(var(--secondary));
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.copy-btn:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

pre {
  margin: 0;
  padding: 1rem;
  background-color: hsl(240 10% 6%);
  overflow-x: auto;
}

code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* Inline code */
p code, td code, li code {
  background-color: hsl(var(--secondary));
  padding: 0.125rem 0.375rem;
  border-radius: calc(var(--radius) / 2);
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
}

/* Syntax highlighting */
.token-keyword {
  color: #c678dd;
}

.token-string {
  color: #98c379;
}

.token-comment {
  color: #5c6370;
  font-style: italic;
}

.token-function {
  color: #61afef;
}

/* Callouts */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.callout-info {
  background-color: hsl(221 83% 53% / 0.1);
  border-color: hsl(221 83% 53%);
}

.callout-warning {
  background-color: hsl(38 92% 50% / 0.1);
  border-color: hsl(38 92% 50%);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

.callout-info .callout-title {
  color: hsl(221 83% 60%);
}

.callout-warning .callout-title {
  color: hsl(38 92% 50%);
}

.callout p {
  margin: 0;
  font-size: 0.875rem;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  transition: border-color 0.15s ease;
}

.feature-card:hover {
  border-color: hsl(var(--muted-foreground));
}

.feature-icon {
  display: inline-flex;
  padding: 0.625rem;
  border-radius: var(--radius);
  background-color: hsl(var(--secondary));
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  font-size: 0.875rem;
}

/* Endpoints */
.endpoint {
  padding: 1rem 1.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin: 1rem 0;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.method {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) / 2);
  text-transform: uppercase;
}

.method-get {
  background-color: hsl(142 71% 45% / 0.15);
  color: hsl(142 71% 45%);
}

.method-post {
  background-color: hsl(221 83% 53% / 0.15);
  color: hsl(221 83% 60%);
}

.method-patch {
  background-color: hsl(38 92% 50% / 0.15);
  color: hsl(38 92% 50%);
}

.method-delete {
  background-color: hsl(0 84% 60% / 0.15);
  color: hsl(0 84% 60%);
}

.endpoint p {
  margin: 0;
  font-size: 0.875rem;
}

/* Table */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.875rem;
}

.doc-table th,
.doc-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

.doc-table th {
  font-weight: 600;
  color: hsl(var(--foreground));
  background-color: hsl(var(--secondary));
}

.doc-table td {
  color: hsl(var(--muted-foreground));
}

.doc-table tr:hover td {
  background-color: hsl(var(--accent) / 0.5);
}

/* Footer */
.content-footer {
  padding: 2rem 3rem;
  border-top: 1px solid hsl(var(--border));
  margin-top: auto;
}

.content-footer p {
  margin: 0;
  font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 1024px) {
  .content {
    padding: 1.5rem 2rem;
  }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .main-content {
    margin-left: 0;
  }

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

  .content {
    padding: 1.5rem;
  }

  .content-footer {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--background));
}

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

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground));
}

/* Selection */
::selection {
  background-color: hsl(var(--primary) / 0.2);
}
