/* Colorful modern Prism.js syntax highlighting theme */

/* Code blocks */
pre[class*="language-"],
code[class*="language-"] {
  color: #ffffff;
  background: none;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  tab-size: 4;
  hyphens: none;
}

pre[class*="language-"] {
  display: block;
  overflow-x: auto;
  padding: 1.25rem;
  background: #0d1117;
  border-radius: 8px;
  border: 1px solid #30363d;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin: 1.5rem 0;
  position: relative;
}

/* Fix for inline code in pre blocks */
pre[class*="language-"] code[class*="language-"] {
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
}

/* Comments */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #e0e7ff;
  font-style: italic;
  opacity: 0.8;
}

/* Keywords */
.token.keyword,
.token.selector,
.token.important,
.token.atrule {
  color: #fbbf24;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Strings */
.token.string,
.token.char,
.token.attr-value,
.token.regex,
.token.variable {
  color: #34d399;
  font-weight: 500;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

/* Numbers */
.token.number,
.token.boolean,
.token.constant {
  color: #f472b6;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.4);
}

/* Operators */
.token.operator,
.token.entity,
.token.url {
  color: #60a5fa;
  font-weight: 500;
}

/* Functions */
.token.function,
.token.class-name {
  color: #a78bfa;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.5);
}

/* Properties */
.token.property,
.token.tag,
.token.punctuation {
  color: #fb7185;
  font-weight: 500;
}

/* Attributes */
.token.attr-name {
  color: #fbbf24;
  font-weight: 500;
}

/* Tags */
.token.tag {
  color: #4ade80;
  font-weight: 600;
}

.token.tag .token.punctuation {
  color: #4ade80;
}

/* Special tokens */
.token.namespace {
  color: #f59e0b;
  font-weight: 600;
}

.token.builtin,
.token.symbol {
  color: #ec4899;
  font-weight: 500;
}

.token.important,
.token.bold {
  color: #06b6d4;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

.token.italic {
  color: #ffffff;
  font-style: italic;
}

.token.entity {
  cursor: help;
}

/* Deletion and addition */
.token.deleted {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 2px 4px;
  border-radius: 3px;
}

.token.inserted {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  padding: 2px 4px;
  border-radius: 3px;
}

/* Language specific styles */
.language-css .token.string,
.language-scss .token.string {
  color: #34d399;
}

.language-json .token.property {
  color: #60a5fa;
}

.language-javascript .token.template-string .token.interpolation {
  color: #fbbf24;
}

/* JSX */
.language-jsx .token.tag .token.class-name,
.language-tsx .token.tag .token.class-name {
  color: #a78bfa;
}

/* Inline code */
:not(pre) > code {
  background: #f6f8fa;
  color: #24292f;
  padding: 0.125rem 0.375rem;
  border-radius: 6px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 0.875em;
  font-weight: 400;
  border: 1px solid #d0d7de;
}

/* Dark mode inline code */
@media (prefers-color-scheme: dark) {
  :not(pre) > code {
    background: #161b22;
    color: #e6edf3;
    border: 1px solid #30363d;
  }
}

/* Pre element styling */
pre {
  position: relative;
  margin: 1.5rem 0;
  overflow: auto;
}

pre code {
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  font-size: 14px;
  line-height: 1.45;
}

/* Language label */
pre::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  background: #21262d;
  color: #8b949e;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-bottom-left-radius: 4px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
}

/* Copy button */
.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  z-index: 10;
}

pre[class*="language-"]:hover .copy-button,
pre:hover .copy-button {
  opacity: 1;
}

.copy-button:hover {
  background: #30363d;
  border-color: #8b949e;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button.copied {
  background: #238636;
  border-color: #2ea043;
  color: white;
}

.copy-button.copied::after {
  content: " ✓";
}

/* Language label */
pre[class*="language-"]::before {
  content: attr(data-language);
  position: absolute;
  top: 0;
  right: 0;
  background: #21262d;
  color: #8b949e;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  border-bottom-left-radius: 4px;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
  border: 1px solid #30363d;
  border-top: none;
  border-right: none;
}

/* Scrollbar styling for code blocks */
pre[class*="language-"]::-webkit-scrollbar {
  height: 8px;
}

pre[class*="language-"]::-webkit-scrollbar-track {
  background: #161b22;
  border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}