/* Highlight */
.highlight-wrapper {
  position: relative;
}

/* HighlightCompo base styles */
.hlc-base {
  border-radius: 0.375rem;
  position: relative;
}

/* CodeWrapper base styles */
.cw-base {
  max-width: 56rem;
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
  background-color: white;
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

@media (prefers-color-scheme: dark) {
  .cw-base {
    border-color: #4b5563;
    background-color: #030712;
  }
}

.cw-inner {
  /* Empty for now, can be customized */
}

/* Utility classes for error/warning messages */
.hlc-warning {
  color: #9ca3af;
  font-style: italic;
}

@media (prefers-color-scheme: dark) {
  .hlc-warning {
    color: #9ca3af;
  }
}

.hlc-empty-code {
  padding: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

@media (prefers-color-scheme: dark) {
  .hlc-empty-code {
    color: #9ca3af;
  }
}

.hlc-error {
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid #f87171;
  padding: 1rem;
  font-size: 0.875rem;
  color: #ef4444;
}

@media (prefers-color-scheme: dark) {
  .hlc-error {
    border-color: #b91c1c;
    color: #fca5a5;
  }
}

.hlc-error-hint {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.8;
}

/* Copy button styles */
.hlc-copy-button {
  position: absolute;
  top: 1rem;
  right: 0.5rem;
  z-index: 10;
  border-radius: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: colors 0.2s;
}

.hlc-copy-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgb(59 130 246 / 0.5);
}

.hlc-copy-success {
  color: #15803d;
  background-color: #f0fdf4;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-success {
    color: #4ade80;
    background-color: #14532d;
  }
}

.hlc-copy-success:focus-visible {
  box-shadow: 0 0 0 2px #bbf7d0;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-success:focus-visible {
    box-shadow: 0 0 0 2px #15803d;
  }
}

.hlc-copy-error {
  color: #b91c1c;
  background-color: #fef2f2;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-error {
    color: #f87171;
    background-color: #7f1d1d;
  }
}

.hlc-copy-error:focus-visible {
  box-shadow: 0 0 0 2px #fecaca;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-error:focus-visible {
    box-shadow: 0 0 0 2px #b91c1c;
  }
}

.hlc-copy-idle {
  color: #111827;
  background-color: #f9fafb;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-idle {
    color: #9ca3af;
    background-color: #1f2937;
  }
}

.hlc-copy-idle:hover {
  background-color: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-idle:hover {
    background-color: #374151;
  }
}

.hlc-copy-idle:focus-visible {
  box-shadow: 0 0 0 2px #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  .hlc-copy-idle:focus-visible {
    box-shadow: 0 0 0 2px #374151;
  }
}

/* Expand/Collapse button */
.hlc-expand-button {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  border-top: 1px solid #e5e7eb;
  background-color: #f3f4f6;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

@media (prefers-color-scheme: dark) {
  .hlc-expand-button {
    border-color: #4b5563;
    background-color: #374151;
    color: #9ca3af;
  }
}

.hlc-expand-button:hover {
  background-color: #e5e7eb;
  color: #4f46e5;
}

@media (prefers-color-scheme: dark) {
  .hlc-expand-button:hover {
    background-color: #4b5563;
    color: #ffffff;
  }
}

/* No code message */
.hlc-no-code {
  padding: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

@media (prefers-color-scheme: dark) {
  .hlc-no-code {
    color: #9ca3af;
  }
}
