:root {
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --bg-page: #fafbfc;
  --bg-surface: #ffffff;
  --bg-muted: #f3f5f7;
  --bg-code: #0f172a;

  --text-strong: #1a202c;
  --text-body: #4a5568;
  --text-muted: #718096;

  --border-light: #e2e8f0;
  --border-strong: #cbd5e0;

  --accent: #8ec641;
  --accent-soft: #f4f9e9;
  --accent-hover: #7db037;

  --sidebar-width: 280px;
  --toc-width: 240px;

  --transition-speed: 0.3s;
}

[data-theme="dark"] {
  --bg-page: #14161a;
  --bg-surface: #1f2128;
  --bg-muted: #2d3038;
  --bg-code: #0f172a;

  --text-strong: #ffffff;
  --text-body: #e2e8f0;
  --text-muted: #94a3b8;

  --border-light: #2d313a;
  --border-strong: #3f4551;

  --accent: #a3d94a;
  --accent-soft: #1e2912;
  --accent-hover: #b4e663;
}

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

.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-page);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: #ccc;
  letter-spacing: -0.02rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite ease-in-out;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  width: 200px;
}

.loader-logo img {
  height: 80px;
  width: auto;
}

.loader-bar {
  width: 100%;
  height: 2px;
  background: var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.loader-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  background: var(--accent);
  border-radius: 10px;
  animation: slide 1.5s infinite ease-in-out;
}

@keyframes slide {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(100%);
  }
}

html,
body {
  height: 100vh;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  transition: background var(--transition-speed), color var(--transition-speed);
}

.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-width);
  background: var(--bg-page);
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

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

.sidebar-header {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  height: 60px;
  width: auto;
  display: block;
}

.nav-menu {
  padding: 0 1rem 2rem;
}

.nav-tools {
  margin-bottom: 1rem;
}

.nav-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  padding-left: 0.25rem;
}

.search-shell {
  display: block;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav-section {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  text-decoration: none;
  color: var(--text-body);
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover {
  background: var(--bg-muted);
  color: var(--text-strong);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  width: 1.1rem;
  height: 1.1rem;
  color: inherit;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-text {
  font-size: 0.9rem;
}

.nav-meta {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.content {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.header-breadcrumb-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-breadcrumb-area .doc-breadcrumb {
  margin-bottom: 2px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.header-breadcrumb-area .doc-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0;
  line-height: 1.2;
}

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

.theme-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn:hover {
  background: var(--bg-muted);
  color: var(--text-strong);
  border-color: var(--border-strong);
}

.theme-icon {
  width: 20px;
  height: 20px;
  display: none;
}

[data-theme="light"] .light-icon {
  display: block;
}

[data-theme="dark"] .dark-icon {
  display: block;
}

html:not([data-theme]) .dark-icon {
  display: block;
}

.header-titles {
  min-width: 0;
}

h1#page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
}

.tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.doc-layout {
  display: block;
}

.doc-main {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  margin: 0;
}

.doc-header {
  margin-bottom: 3rem;
}

.doc-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.doc-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-strong);
  margin-bottom: 1rem;
}

.doc-description {
  font-size: 1.1rem;
  color: var(--text-body);
  margin-bottom: 1.5rem;
}

.doc-meta {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 1.5rem;
}

.doc-meta span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.endpoint-list {
  display: grid;
  gap: 4rem;
}

.endpoint-card {
  scroll-margin-top: 2rem;
}

.endpoint-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

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

.method-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.method-get {
  background: #dbeafe;
  color: #1e40af;
}

.method-post {
  background: #dcfce7;
  color: #166534;
}

.method-put {
  background: #fef3c7;
  color: #92400e;
}

.method-delete {
  background: #fee2e2;
  color: #991b1b;
}

.endpoint-url {
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: var(--text-muted);
  word-break: break-all;
  overflow-wrap: anywhere;
}

.endpoint-group {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.endpoint-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: 0.5rem;
}

.endpoint-description {
  font-size: 1rem;
  color: var(--text-body);
  margin-bottom: 1.5rem;
}

.code-panel {
  background: var(--bg-code);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.code-tabs {
  display: flex;
  background: #1e293b;
  padding: 0 1rem;
  border-bottom: 1px solid #334155;
}

.code-tab {
  background: transparent;
  border: 0;
  color: #94a3b8;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.code-tab.active {
  color: #f8fafc;
  border-bottom-color: var(--accent);
}

.code-pane {
  display: none;
  padding: 1.25rem;
}

.code-pane.active {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.code-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

pre {
  margin: 0;
  font-family: var(--font-code);
  font-size: 0.85rem;
  color: #e2e8f0;
  overflow-x: auto;
  width: 100%;
  display: block;
}

.code-pane[id^="curl-"] pre {
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: visible;
}

.doc-toc {
  display: none;
}

.doc-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-strong);
  margin-bottom: 1rem;
}

.doc-toc-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.toc-link:hover {
  color: var(--text-strong);
}

.menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: var(--bg-muted);
  border-color: var(--border-strong);
}

.icon-bar {
  width: 24px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 1px;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 40;
}

.sidebar-open .overlay {
  display: block;
}

@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }

  .sidebar {
    transform: none;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .content {
    margin-left: var(--sidebar-width);
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .content-header {
    margin-bottom: 0;
    padding: 1.5rem 2rem;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--border-light);
  }

  #main-view {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .doc-layout {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }

  .doc-main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    min-height: 0;
    padding: 2.5rem 2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .doc-main::-webkit-scrollbar {
    display: none;
  }

  .doc-toc {
    display: block;
    width: var(--toc-width);
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    border-left: 1px solid var(--border-light);
    background: var(--bg-page);
    padding: 2.5rem 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .doc-toc::-webkit-scrollbar {
    display: none;
  }

  .doc-toc-inner {
    position: static;
  }
}

.meta-pill {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-muted);
  color: var(--text-muted);
  font-weight: 600;
}