.tab-button {
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.tab-button:hover {
  background-color: #f3f4f6;
}

.tab-button.active {
  border-bottom: 2px solid #2563eb;
  color: #2563eb;
}

.code-tab {
  display: none;
}

.code-tab.active {
  display: block;
}

pre[class*="language-"] {
  border-radius: 0.375rem;
  margin: 0 !important;
  background: #272822 !important;
}

.line-numbers .line-numbers-rows {
  border-right: none;
  background: #1e1f1c !important;
  padding: 1em 0;
}

.line-numbers-rows > span:before {
  color: #8f908a !important;
}

.line-numbers .line-numbers-rows > span {
  padding-right: 1em;
  border: none;
}

pre[class*="language-"].line-numbers {
  padding-left: 3.8em !important;
}

pre[class*="language-"] > code {
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(255, 255, 255, 0.02) 50%
  ) !important;
  background-size: 100% 4em !important;
  background-position: 0 0 !important;
  line-height: 2em !important;
}

/* Toolbar styles */
div.code-toolbar > .toolbar {
  opacity: 1 !important;
  top: 0.5em !important;
  right: 0.5em !important;
}

div.code-toolbar > .toolbar > .toolbar-item > button {
  background: #2563eb !important;
  color: white !important;
  padding: 0.4em 0.8em !important;
  border-radius: 0.375rem !important;
  font-size: 0.875rem !important;
  transition: all 0.3s !important;
}

div.code-toolbar > .toolbar > .toolbar-item > button:hover {
  background: #1d4ed8 !important;
}

/* Language display */
div.code-toolbar > .toolbar > .toolbar-item > span {
  background: #374151 !important;
  color: white !important;
  padding: 0.4em 0.8em !important;
  border-radius: 0.375rem !important;
  font-size: 0.875rem !important;
}

/* --- API Sample Section Improvements --- */
.api-sample-section {
  max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.api-sample-section .tab-button {
  border: none;
  background: none;
  color: #374151;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: color 0.2s, border-color 0.2s;
}
.api-sample-section .tab-button.active {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
  background: #fff;
  z-index: 1;
}
.api-sample-section .tab-button:not(.active):hover {
  background: #f3f4f6;
  color: #1d4ed8;
}
.api-sample-section .code-tab {
  margin-top: 0;
  border-radius: 0 0 0.5rem 0.5rem;
  background: #18181b;
  border: 1px solid #e5e7eb;
  border-top: none;
  padding: 0;
}
.api-sample-section pre {
  background: #18181b !important;
  color: #f3f4f6 !important;
  border-radius: 0.5rem;
  border: none;
  font-size: 0.95rem;
  margin: 0;
  padding: 1.5rem 1rem 1rem 1rem;
  min-height: 120px;
}
.api-sample-section code {
  background: none !important;
  color: inherit !important;
}
.api-sample-section .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  font-size: 0.85rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  padding: 0.3em 0.9em;
  cursor: pointer;
  transition: background 0.2s;
}
.api-sample-section .copy-btn:hover {
  background: #1d4ed8;
}
@media (max-width: 600px) {
  .api-sample-section pre {
    font-size: 0.85rem;
    padding: 1.2rem 0.5rem 0.7rem 0.5rem;
  }
  .api-sample-section .tab-button {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
    font-size: 0.95rem;
  }
}
