/**
 * Playcast Documentation - Prism.js Dark Theme
 * Custom syntax highlighting theme matching Playcast color scheme
 */

/* Code block base styling */
code[class*="language-"],
pre[class*="language-"] {
  color: #E5E7EB;
  background: none;
  font-family: var(--font-family-mono, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace);
  font-size: 14px;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;
  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
}

/* Code block container */
pre[class*="language-"] {
  position: relative;
  margin: 0.5em 0;
  overflow: auto;
  border-radius: 8px;
  padding: 1em;
  background-color: #161423;
  border: 1px solid #29334E;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  white-space: normal;
  background-color: #29334E;
  color: #FBBF24;
  border: 1px solid #4A5580;
}

/* Selection */
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
  text-shadow: none;
  background: rgba(251, 191, 36, 0.3);
}

pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
  text-shadow: none;
  background: rgba(251, 191, 36, 0.3);
}

/* Tokens */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6B7280;
  font-style: italic;
}

.token.punctuation {
  color: #A1A5B8;
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #EF4444;
}

.token.boolean,
.token.number {
  color: #F59E0B;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #10B981;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
  color: #06B6D4;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
  color: #FBBF24;
}

.token.keyword {
  color: #8B5CF6;
  font-weight: 600;
}

.token.regex,
.token.important {
  color: #F59E0B;
  font-weight: 600;
}

.token.important,
.token.bold {
  font-weight: bold;
}

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

.token.entity {
  cursor: help;
}

/* Language-specific styling */

/* JavaScript */
.language-javascript .token.template-string > .token.interpolation {
  color: #E5E7EB;
}

.language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation {
  color: #EF4444;
}

/* HTML */
.language-html .token.punctuation {
  color: #A1A5B8;
}

.language-html .token.attr-name {
  color: #FBBF24;
}

.language-html .token.attr-value {
  color: #10B981;
}

.language-html .token.tag .token.punctuation {
  color: #EF4444;
}

.language-html .token.tag .token.tag {
  color: #8B5CF6;
}

/* CSS */
.language-css .token.selector {
  color: #8B5CF6;
}

.language-css .token.property {
  color: #06B6D4;
}

.language-css .token.important {
  color: #EF4444;
}

/* JSON */
.language-json .token.property {
  color: #FBBF24;
}

.language-json .token.string {
  color: #10B981;
}

.language-json .token.number {
  color: #F59E0B;
}

.language-json .token.boolean {
  color: #8B5CF6;
}

.language-json .token.null.keyword {
  color: #EF4444;
}

/* TypeScript */
.language-typescript .token.type-annotation > .token.punctuation,
.language-typescript .token.type-annotation > .token.keyword {
  color: #06B6D4;
}

.language-typescript .token.type {
  color: #06B6D4;
}

/* Shell/Bash */
.language-bash .token.function,
.language-shell .token.function {
  color: #FBBF24;
}

.language-bash .token.parameter.variable,
.language-shell .token.parameter.variable {
  color: #06B6D4;
}

/* Python */
.language-python .token.decorator {
  color: #F59E0B;
}

.language-python .token.function {
  color: #FBBF24;
}

/* 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 #4A5580;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

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

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

/* Line highlight plugin */
.line-highlight {
  position: absolute;
  left: 0;
  right: 0;
  padding: inherit 0;
  margin-top: 1em;
  background: rgba(251, 191, 36, 0.1);
  background: linear-gradient(to right, rgba(251, 191, 36, 0.1) 70%, rgba(251, 191, 36, 0));
  pointer-events: none;
  line-height: inherit;
  white-space: pre;
}

.line-highlight:before,
.line-highlight[data-end]:after {
  content: attr(data-start);
  position: absolute;
  top: 0.4em;
  left: 0.6em;
  min-width: 1em;
  padding: 0 0.5em;
  background-color: rgba(251, 191, 36, 0.2);
  color: #FBBF24;
  font: bold 65%/1.5 sans-serif;
  text-align: center;
  vertical-align: 0.3em;
  border-radius: 999px;
  text-shadow: none;
  box-shadow: 0 1px white;
}

.line-highlight[data-end]:after {
  content: attr(data-end);
  top: auto;
  bottom: 0.4em;
}

/* Command line plugin */
.command-line-prompt {
  border-right: 1px solid #4A5580;
  display: block;
  float: left;
  font-size: 100%;
  letter-spacing: -1px;
  margin-right: 1em;
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.command-line-prompt > span:before {
  color: #6B7280;
  content: ' ';
  display: block;
  padding-right: 0.8em;
}

.command-line-prompt > span[data-user]:before {
  content: "[" attr(data-user) "@" attr(data-host) "] $";
}

.command-line-prompt > span[data-user="root"]:before {
  content: "[" attr(data-user) "@" attr(data-host) "] #";
}

.command-line-prompt > span[data-prompt]:before {
  content: attr(data-prompt);
}

/* Copy to clipboard plugin */
div.code-toolbar {
  position: relative;
}

div.code-toolbar > .toolbar {
  position: absolute;
  z-index: 10;
  top: 0.3em;
  right: 0.2em;
  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;
  margin-left: 0.25em;
}

div.code-toolbar > .toolbar > .toolbar-item > a {
  cursor: pointer;
}

div.code-toolbar > .toolbar > .toolbar-item > button {
  background: #29334E;
  border: 1px solid #4A5580;
  border-radius: 4px;
  color: #A1A5B8;
  font: inherit;
  line-height: normal;
  overflow: visible;
  padding: 0 0.5em;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: pointer;
  font-size: 0.8em;
  transition: all 0.15s ease-in-out;
}

div.code-toolbar > .toolbar > .toolbar-item > button:hover,
div.code-toolbar > .toolbar > .toolbar-item > button:focus {
  color: #FBBF24;
  background: #4A5580;
  border-color: #FBBF24;
}

div.code-toolbar > .toolbar > .toolbar-item > a,
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
  color: #A1A5B8;
  font-size: 0.8em;
  padding: 0 0.5em;
  background: #29334E;
  background: rgba(41, 51, 78, 0.8);
  border-radius: 4px;
  border: 1px solid #4A5580;
}

/* Diff highlighting */
.token.deleted {
  background-color: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

.token.inserted {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10B981;
}

/* Print styles */
@media print {
  code[class*="language-"],
  pre[class*="language-"] {
    text-shadow: none;
  }

  pre[class*="language-"] {
    background: white !important;
    border: 1px solid #ddd !important;
  }

  .token.comment,
  .token.prolog,
  .token.doctype,
  .token.cdata,
  .token.punctuation,
  .token.namespace,
  .token.property,
  .token.tag,
  .token.constant,
  .token.symbol,
  .token.deleted,
  .token.boolean,
  .token.number,
  .token.selector,
  .token.attr-name,
  .token.string,
  .token.char,
  .token.builtin,
  .token.inserted,
  .token.operator,
  .token.entity,
  .token.url,
  .token.variable,
  .token.atrule,
  .token.attr-value,
  .token.function,
  .token.class-name,
  .token.keyword,
  .token.regex,
  .token.important {
    color: black !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  code[class*="language-"],
  pre[class*="language-"] {
    font-size: 13px;
  }

  pre[class*="language-"] {
    padding: 0.8em;
    margin: 0.3em 0;
  }

  pre[class*="language-"].line-numbers {
    padding-left: 2.8em;
  }

  .line-numbers .line-numbers-rows {
    left: -2.8em;
    width: 2em;
  }
}