/**
 * Prism.js Custom Theme - PrismaData
 * Syntax highlighting colors aligned with PrismaData brand
 * Based on prismadata.io color scheme (#210060, #5D2CF7)
 */

/* Base code styling */
code[class*="language-"],
pre[class*="language-"] {
  color: #222222;
  background: #F9FAFB;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  tab-size: 2;
  hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1.5em;
  margin: 0;
  overflow: auto;
  border-radius: 10px;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: 0.2em 0.4em;
  border-radius: 6px;
  white-space: normal;
}

/* ============================================
   TOKEN COLORS - PrismaData Brand
   ============================================ */

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

/* Punctuation (braces, brackets, commas) */
.token.punctuation {
  color: #555555;
}

/* Property names, tag names, constant, symbol, deleted */
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #5D2CF7;  /* PrismaData accent purple */
  font-weight: 600;
}

/* Selectors, attr-names, strings, char, builtin, inserted */
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #10B981;  /* Success green for strings */
}

/* Operators, entities, URLs */
.token.operator,
.token.entity,
.token.url {
  color: #F59E0B;  /* Warning orange */
}

/* Keywords, at-rules, regex, important */
.token.atrule,
.token.attr-value,
.token.keyword {
  color: #210060;  /* PrismaData primary purple */
  font-weight: 600;
}

/* Functions, class names */
.token.function,
.token.class-name {
  color: #3B82F6;  /* Info blue */
  font-weight: 600;
}

/* Regex, important */
.token.regex,
.token.important,
.token.variable {
  color: #EF4444;  /* Error red */
}

/* Bold, Italic */
.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

/* Entity */
.token.entity {
  cursor: help;
}

/* ============================================
   DARK MODE THEME
   ============================================ */

body.dark-mode code[class*="language-"],
body.dark-mode pre[class*="language-"] {
  color: #e0e0e0;
  background: #2a2a2a;
}

body.dark-mode .token.comment,
body.dark-mode .token.prolog,
body.dark-mode .token.doctype,
body.dark-mode .token.cdata {
  color: #707070;
}

body.dark-mode .token.punctuation {
  color: #b0b0b0;
}

body.dark-mode .token.property,
body.dark-mode .token.tag,
body.dark-mode .token.boolean,
body.dark-mode .token.number,
body.dark-mode .token.constant,
body.dark-mode .token.symbol,
body.dark-mode .token.deleted {
  color: #7d4cff;  /* Lighter accent for dark mode */
}

body.dark-mode .token.selector,
body.dark-mode .token.attr-name,
body.dark-mode .token.string,
body.dark-mode .token.char,
body.dark-mode .token.builtin,
body.dark-mode .token.inserted {
  color: #34d399;  /* Lighter green */
}

body.dark-mode .token.operator,
body.dark-mode .token.entity,
body.dark-mode .token.url {
  color: #fbbf24;  /* Lighter orange */
}

body.dark-mode .token.atrule,
body.dark-mode .token.attr-value,
body.dark-mode .token.keyword {
  color: #9f7aea;  /* Lighter primary purple */
}

body.dark-mode .token.function,
body.dark-mode .token.class-name {
  color: #60a5fa;  /* Lighter blue */
}

/* ============================================
   LINE NUMBERS PLUGIN
   ============================================ */

pre[class*="language-"].line-numbers {
  position: relative;
  padding-left: 3.8em;
  counter-reset: linenumber;
}

pre[class*="language-"].line-numbers > code {
  position: relative;
  white-space: inherit;
}

.line-numbers .line-numbers-rows {
  position: absolute;
  pointer-events: none;
  top: 0;
  font-size: 100%;
  left: -3.8em;
  width: 3em;
  letter-spacing: -1px;
  border-right: 1px solid #E6E7E9;
  user-select: none;
}

.line-numbers-rows > span {
  display: block;
  counter-increment: linenumber;
}

.line-numbers-rows > span:before {
  content: counter(linenumber);
  color: #999999;
  display: block;
  padding-right: 0.8em;
  text-align: right;
}

body.dark-mode .line-numbers .line-numbers-rows {
  border-right-color: #3a3a3a;
}

body.dark-mode .line-numbers-rows > span:before {
  color: #707070;
}

/* ============================================
   HIGHLIGHTING SPECIFIC LINES
   ============================================ */

pre[data-line] {
  position: relative;
  padding: 1em 0 1em 3em;
}

.line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1em;
  background: rgba(93, 44, 247, 0.08);
  pointer-events: none;
  line-height: inherit;
  white-space: pre;
}

body.dark-mode .line-highlight {
  background: rgba(93, 44, 247, 0.2);
}

/* ============================================
   TOOLBAR PLUGIN
   ============================================ */

div.code-toolbar {
  position: relative;
}

div.code-toolbar > .toolbar {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  transition: opacity 0.3s ease-in-out;
  opacity: 0;
}

div.code-toolbar:hover > .toolbar {
  opacity: 1;
}

div.code-toolbar > .toolbar .toolbar-item {
  display: inline-block;
}

div.code-toolbar > .toolbar button {
  background: #5D2CF7;
  color: #FFFFFF;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

div.code-toolbar > .toolbar button:hover {
  background: #210060;
}

body.dark-mode div.code-toolbar > .toolbar button {
  background: #7d4cff;
}

body.dark-mode div.code-toolbar > .toolbar button:hover {
  background: #5D2CF7;
}
