.container {
  margin: 1.25rem 0;
  border: 1px solid var(--ifm-color-emphasis-300);
  border-radius: var(--ifm-code-border-radius);
  overflow: hidden;
  background: var(--ifm-background-surface-color);
}

.header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--ifm-color-emphasis-100);
  border-bottom: 1px solid var(--ifm-color-emphasis-200);
  flex-wrap: wrap;
  min-height: 42px;
}

.headerLabel {
  font-size: 0.75rem;
  color: var(--ifm-color-emphasis-700);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.tabs {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.625rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-family: var(--ifm-font-family-monospace);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ifm-color-emphasis-700);
  transition: all 0.15s ease;
  line-height: 1.2;
}

.tab:hover {
  background: var(--ifm-color-emphasis-200);
  color: var(--ifm-color-emphasis-900);
}

.tab.active {
  background: var(--ifm-color-primary);
  color: white;
  border-color: var(--ifm-color-primary-dark);
}

.tab.active:hover {
  background: var(--ifm-color-primary-dark);
}

.codeContainer {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

.codeContainer > div {
  margin-bottom: 0 !important;
}

.codeContainer pre {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

.codeContainer pre code {
  padding: 0.875rem 1rem !important;
}

/* Dark mode adjustments */
[data-theme='dark'] .container {
  border-color: var(--ifm-color-emphasis-400);
}

[data-theme='dark'] .header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: var(--ifm-color-emphasis-400);
}

[data-theme='dark'] .headerLabel {
  color: var(--ifm-color-emphasis-600);
}

[data-theme='dark'] .tab {
  color: var(--ifm-color-emphasis-600);
}

[data-theme='dark'] .tab:hover {
  background: var(--ifm-color-emphasis-300);
  color: var(--ifm-color-emphasis-900);
}

[data-theme='dark'] .tab.active {
  background: var(--ifm-color-primary);
  color: white;
}

/* Mobile adjustments */
@media (max-width: 576px) {
  .header {
    padding: 0.5rem;
    gap: 0.375rem;
  }

  .headerLabel {
    font-size: 0.7rem;
    width: 100%;
  }

  .tabs {
    width: 100%;
    gap: 0.25rem;
  }

  .tab {
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
  }

  .codeContainer pre code {
    padding: 0.75rem !important;
    font-size: 0.8rem !important;
  }
}
