/* Custom styling for documentation code blocks */

/* Code block container */
pre[class*="language-"] {
  margin: 1.5em 0;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-height: 500px;
  overflow: auto;
}

/* Fix for HTML entities in code blocks */
pre code {
  display: block;
  white-space: pre;
  overflow-x: auto;
  word-wrap: normal;
}

/* Ensure proper language class is applied */
pre.language-typescript,
pre.language-javascript,
pre.language-jsx,
pre.language-tsx,
pre.language-js {
  background-color: #1e1e2e !important;
  color: #f8f8f2 !important;
}

/* Force Prism highlighting */
pre[class*="language-"] {
  position: relative;
}

pre[class*="language-"]::before {
  content: attr(class);
  position: absolute;
  top: 0;
  right: 0;
  color: #232323;
  font-size: 0.7rem;
  padding: 2px 8px;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.7);
  border-radius: 0 6px 0 6px;
}

/* Style for inline code */
:not(pre) > code {
  background-color: rgba(175, 184, 193, 0.2);
  color: #24292f;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
  font-size: 85%;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  :not(pre) > code {
    background-color: rgba(110, 118, 129, 0.4);
    color: #e6edf3;
  }
}

/* Syntax highlighting tokens */
.token.keyword {
  color: #ff7edb !important;
}

.token.function, .token.function-name {
  color: #82aaff !important;
}

.token.string {
  color: #a5e844 !important; 
}

.token.comment {
  color: #676e95 !important;
  font-style: italic;
}

.token.class-name {
  color: #ffcb6b !important;
}

.token.operator, .token.punctuation {
  color: #89ddff !important;
}

.token.property {
  color: #80cbc4 !important;
}

.token.number, .token.boolean {
  color: #f78c6c !important;
} 