/*
 * Enhanced Erlang syntax highlighting for Reveal.js presentations
 * Vibrant Monokai-inspired theme with Erlang-specific styling
 */

.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
  background: #272822 !important;
  color: #f8f8f2 !important;
  border-radius: 8px;
}

/* Keywords: fun, case, of, when, end, if, receive, after, etc. */
.hljs-keyword {
  color: #6b46c1 !important;  /* Dark purple for keywords */
  font-weight: 600;
}

/* Built-in functions and module names (ets, crypto, lists, etc.) */
.hljs-built_in,
.hljs-builtin-name {
  color: #66d9ef !important;
  font-weight: 500;
}

/* Function names */
.hljs-function .hljs-title,
.hljs-title.function_,
.hljs-title {
  color: #a6e22e !important;
  font-weight: 600;
}

/* Atoms (ok, error, undefined, etc.) */
.hljs-symbol {
  color: #61afef !important;  /* Blue for atoms */
  font-weight: 500;
}

/* Boolean literals (true, false) */
.hljs-literal {
  color: #6b46c1 !important;  /* Dark purple for true/false */
  font-weight: 600;
}

/* Strings and binaries */
.hljs-string {
  color: #98c379 !important;  /* Light green for strings */
}

/* Numbers */
.hljs-number {
  color: #66d9ef !important;  /* Light blue for numbers */
}

/* Variables (capitalized in Erlang: Account, Delta, Ts, etc.) */
.hljs-variable {
  color: #fd971f !important;
  font-weight: 500;
}

/* Comments */
.hljs-comment {
  color: #6a9955 !important;  /* Green for comments */
  font-style: italic;
}

/* Operators (=>, ->, =, +, -, etc.) */
.hljs-operator {
  color: #f92672 !important;
}

/* Module attributes (-module, -export, etc.) - MACROS */
.hljs-meta {
  color: #e74c3c !important;  /* Red for macros/attributes */
}

/* Pattern matching and tuples */
.hljs-type {
  color: #66d9ef !important;
}

/* Records and map keys */
.hljs-attr {
  color: #a6e22e !important;
}

/* Shell prompt styling */
.hljs-meta.prompt_ {
  color: #6a9955 !important;  /* Green like comments */
  user-select: none;
}

/* Hash/binary literals */
.hljs-subst {
  color: #f8f8f2 !important;
}

/* Maps and records */
.hljs-tag {
  color: #f92672 !important;
}

/* Function parameters and patterns */
.hljs-params {
  color: #fd971f !important;
}

/* Names (like in function definitions) */
.hljs-name {
  color: #a6e22e !important;
}

/* Bracket highlighting in shades of orange */
.hljs-punctuation {
  color: #fd971f !important;  /* Orange for brackets and punctuation */
}

/* Specific bracket types if supported by highlighter */
.hljs-bracket,
.hljs-paren,
.hljs-brace {
  color: #fd971f !important;  /* Base orange */
}

/* Enhanced readability for code blocks */
.reveal pre {
  border-left: 4px solid #a6e22e;  /* Default border */
}

.reveal pre code {
  background: #272822;
  padding-left: 1.2em;
}

/* Better contrast for inline code */
.reveal code {
  background: #3e3d32;
  color: #f8f8f2;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-family: 'Hack', 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* Language-specific left borders for highlight.js (used in module slides) */
.reveal pre:has(code.language-erlang) {
  border-left: 4px solid #A90533 !important;  /* Erlang red */
}

.reveal pre:has(code.language-elixir) {
  border-left: 4px solid #4B275F !important;  /* Elixir purple */
}

.reveal pre:has(code.language-shell),
.reveal pre:has(code.language-bash) {
  border-left: 4px solid #66d9ef !important;  /* Light blue */
}

/* Erlang-specific: highlight special forms */
.hljs-keyword.hljs-function {
  color: #f92672;
}

/* Better visibility for errors/warnings in output */
.hljs-deletion,
.hljs-formula {
  color: #f92672;
}

.hljs-addition {
  color: #a6e22e;
}

/* Improve selection visibility */
.hljs ::selection {
  background: rgba(173, 214, 255, 0.3);
}

.hljs ::-moz-selection {
  background: rgba(173, 214, 255, 0.3);
}
