/* ============================================
   SerpWatch API Documentation - Syntax Highlighting
   Custom Prism.js theme override (Catppuccin-inspired)
   ============================================ */

/* Base code styling */
code[class*="language-"],
pre[class*="language-"] {
    color: #cdd6f4;
    background: none;
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.6;
    tab-size: 2;
    hyphens: none;
}

pre[class*="language-"] {
    padding: 1em;
    margin: 0;
    overflow: auto;
    background: #1e1e2e;
}

:not(pre) > code[class*="language-"] {
    padding: 0.1em 0.3em;
    border-radius: 0.3em;
    white-space: normal;
    background: #1e1e2e;
}

/* --- Token Colors --- */

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

/* Punctuation */
.token.punctuation {
    color: #94a3b8;
}

/* Namespace */
.token.namespace {
    opacity: 0.7;
}

/* Properties, tags, symbols */
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #f38ba8;
}

/* Strings, attributes, inserted text */
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #a6e3a1;
}

/* Operators, URLs */
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #89dceb;
}

/* Keywords */
.token.atrule,
.token.attr-value,
.token.keyword {
    color: #cba6f7;
}

/* Functions, classes */
.token.function,
.token.class-name {
    color: #89b4fa;
}

/* Regex, variables */
.token.regex,
.token.important,
.token.variable {
    color: #f9e2af;
}

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

/* Italic */
.token.italic {
    font-style: italic;
}

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

/* --- Language-specific adjustments --- */

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

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

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

.language-json .token.boolean,
.language-json .token.null {
    color: #cba6f7;
}

/* Bash */
.language-bash .token.function {
    color: #89b4fa;
}

.language-bash .token.parameter {
    color: #f9e2af;
}

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

.language-python .token.builtin {
    color: #89dceb;
}

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

/* --- Line Numbers (optional) --- */
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: 1em;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #313244;
    user-select: none;
}

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

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

/* --- Highlighting specific lines --- */
.line-highlight {
    position: absolute;
    left: 0;
    right: 0;
    padding: inherit 0;
    margin-top: 1em;
    background: rgba(99, 91, 255, 0.1);
    pointer-events: none;
    line-height: inherit;
    white-space: pre;
}

/* --- Diff highlighting --- */
.token.deleted {
    color: #f38ba8;
    background: rgba(243, 139, 168, 0.1);
}

.token.inserted {
    color: #a6e3a1;
    background: rgba(166, 227, 161, 0.1);
}

/* --- Selection --- */
pre[class*="language-"]::selection,
pre[class*="language-"] *::selection,
code[class*="language-"]::selection,
code[class*="language-"] *::selection {
    background: rgba(99, 91, 255, 0.3);
}
