/* Enhanced Documentation Page Styles */
:root {
  --primary-color: #1a1f36;
  --secondary-color: #2d3748;
  --accent-color: #4299e1;
  --accent-hover: #3182ce;
  --text-color: #2d3748;
  --text-light: #718096;
  --bg-color: #f7fafc;
  --card-bg-color: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #48bb78;
  --warning-color: #ed8936;
  --code-bg: #1a202c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* Navigation Sidebar */
nav {
  width: 280px;
  background: linear-gradient(180deg, var(--primary-color) 0%, #0f1419 100%);
  color: #fff;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 0;
}

.nav-header {
  padding: 25px 20px 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.15) 0%, rgba(49, 130, 206, 0.08) 100%);
  margin-bottom: 0;
}

.nav-header h1,
.nav-header h1 a {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px 0;
  background: linear-gradient(135deg, #fff 0%, #cbd5e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.nav-subtitle {
  font-size: 12px;
  color: #a0aec0;
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.search-container {
  padding: 15px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#searchInput {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

#searchInput::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#searchInput:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.search-results {
  display: none;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding: 10px;
}

.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.search-results-header {
  padding: 10px 15px;
  color: #a0aec0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-result-item {
  display: block;
  padding: 12px 15px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #4299e1;
  transform: translateX(3px);
}

.search-result-title {
  color: white;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}

.search-result-title mark {
  background: #4299e1;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.search-result-path {
  color: #718096;
  font-size: 12px;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: #a0aec0;
  font-size: 14px;
}

.nav-content {
  padding: 10px 0;
}

.nav-section-content {
  max-height: 5000px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
  opacity: 1;
}

.nav-section.collapsed .nav-section-content {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.nav-section {
  margin-bottom: 5px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  padding: 12px 20px;
  margin: 0;
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid var(--accent-color);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 45px;
}

.section-title::after {
  content: "▼";
  position: absolute;
  right: 20px;
  transition: transform 0.3s ease;
  font-size: 12px;
}

.section-title.collapsed::after {
  transform: rotate(-90deg);
}

.subsection {
  margin-bottom: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-color);
  padding: 8px 20px 8px 30px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

nav::-webkit-scrollbar {
  width: 8px;
}

nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: flex;
  align-items: center;
  padding: 14px 30px;
  color: #a0aec0;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: var(--accent-color);
  padding-left: 33px;
}

nav a::before {
  content: "←";
  margin-right: 10px;
  font-size: 18px;
}

/* Main Content */
main {
  margin-left: 280px;
  flex: 1;
  padding: 0;
  background-color: var(--bg-color);
  min-height: 100vh;
}

main h1:first-child {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 50px;
  margin: 0 0 40px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

main > h1:first-child + h1,
main > h1:first-child + p,
main > h1:first-child + h2,
main > h1:first-child + h3,
main > h1:first-child + ul,
main > h1:first-child + ol,
main > h1:first-child + table,
main > h1:first-child + pre,
main > h2,
main > h3,
main > h4,
main > p,
main > ul,
main > ol,
main > table,
main > pre {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 50px;
  padding-right: 50px;
}

main > p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* Headings */
h1 {
  font-size: 38px;
  font-weight: 800;
  color: white;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 50px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--accent-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2::before {
  content: "▸";
  color: var(--accent-color);
  font-size: 24px;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--secondary-color);
  margin-top: 30px;
  margin-bottom: 15px;
}

h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-color);
  margin-top: 25px;
  margin-bottom: 12px;
}

/* Code Blocks */
pre {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  color: #e2e8f0;
  padding: 25px;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 600px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  margin: 25px 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  white-space: pre-wrap;
  word-break: break-word;
}

pre code {
  background-color: transparent;
  color: #e2e8f0;
  padding: 0;
  border: none;
  font-size: 14px;
  line-height: 1.8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Scrollbar for code blocks */
pre::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

pre::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

pre::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  background-color: #f1f5f9;
  color: #e53e3e;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid #e2e8f0;
}

/* Language Labels for Code Blocks */
pre[class*="language-"]::before {
  content: attr(class);
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 11px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 1px;
  font-weight: 600;
}

pre.language-http::before { content: "HTTP"; }
pre.language-bash::before { content: "BASH"; }
pre.language-json::before { content: "JSON"; }
pre.language-javascript::before { content: "JAVASCRIPT"; }
pre.language-python::before { content: "PYTHON"; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  background-color: var(--card-bg-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color);
}

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

thead {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
  color: #fff;
}

thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

tbody tr:hover {
  background-color: #edf2f7;
}

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

/* Buttons */
button {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
  margin: 20px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

button:active {
  transform: translateY(0);
}

button::before {
  content: "📋";
  font-size: 16px;
}

/* Endpoint Badge */
h2 + pre code.language-http {
  font-weight: 600;
  font-size: 15px;
}

/* Response Status Badges */
h3[class*="200"]::before,
h3:contains("200")::before {
  content: "✓";
  display: inline-block;
  width: 24px;
  height: 24px;
  background: var(--success-color);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  margin-right: 8px;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  nav {
    width: 250px;
  }
  
  main {
    margin-left: 250px;
  }
  
  main > * {
    padding: 0 40px;
  }
}

@media (max-width: 768px) {
  nav {
    width: 100%;
    position: relative;
    height: auto;
  }
  
  main {
    margin-left: 0;
  }
  
  main > * {
    padding: 0 25px;
  }
  
  main > h1:first-child {
    padding: 40px 25px 30px;
  }
  
  h1 {
    font-size: 32px;
  }
  
  h2 {
    font-size: 22px;
  }
  
  pre {
    padding: 20px;
  }
}

/* Utility Classes */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #c6f6d5;
  color: #22543d;
}

.badge-warning {
  background: #feebc8;
  color: #7c2d12;
}

.badge-info {
  background: #bee3f8;
  color: #2c5282;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--accent-color);
  color: white;
}

::-moz-selection {
  background: var(--accent-color);
  color: white;
}
