/* ===== Syntax Highlighting Theme ===== */
/* Vibrant indigo-tinted syntax theme */

/* Base token colors */
.hljs {
    display: block;
    overflow-x: auto;
    color: var(--text-primary);
    background: transparent;
}

/* Comments */
.hljs-comment,
.hljs-quote {
    color: #8888A0;
    font-style: italic;
}

/* Keywords */
.hljs-keyword,
.hljs-selector-tag {
    color: #4F46E5;
}

/* Strings */
.hljs-string,
.hljs-doctag,
.hljs-regexp,
.hljs-meta .hljs-string {
    color: #059669;
}

/* Numbers */
.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
    color: #D97706;
}

/* Functions */
.hljs-title,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
    color: #7C3AED;
    font-weight: 500;
}

/* Types and Classes */
.hljs-type,
.hljs-class .hljs-title,
.hljs-built_in {
    color: #DB2777;
}

/* Attributes and Properties */
.hljs-attribute,
.hljs-symbol,
.hljs-bullet,
.hljs-subst,
.hljs-meta {
    color: #2563EB;
}

/* Deletion */
.hljs-deletion {
    color: #DC2626;
    background: rgba(220, 38, 38, 0.08);
}

/* Addition */
.hljs-addition {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
}

/* Emphasis */
.hljs-emphasis {
    font-style: italic;
}

/* Strong */
.hljs-strong {
    font-weight: bold;
}

/* Links */
.hljs-link {
    text-decoration: underline;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .hljs-comment,
    .hljs-quote {
        color: #6B6B88;
    }

    .hljs-keyword,
    .hljs-selector-tag {
        color: #A78BFA;
    }

    .hljs-string,
    .hljs-doctag,
    .hljs-regexp,
    .hljs-meta .hljs-string {
        color: #34D399;
    }

    .hljs-number,
    .hljs-literal,
    .hljs-variable,
    .hljs-template-variable,
    .hljs-tag .hljs-attr {
        color: #FCD34D;
    }

    .hljs-title,
    .hljs-section,
    .hljs-name,
    .hljs-selector-id,
    .hljs-selector-class {
        color: #C4B5FD;
    }

    .hljs-type,
    .hljs-class .hljs-title,
    .hljs-built_in {
        color: #F9A8D4;
    }

    .hljs-attribute,
    .hljs-symbol,
    .hljs-bullet,
    .hljs-subst,
    .hljs-meta {
        color: #7DD3FC;
    }

    .hljs-deletion {
        color: #FCA5A5;
        background: rgba(252, 165, 165, 0.1);
    }

    .hljs-addition {
        color: #34D399;
        background: rgba(52, 211, 153, 0.1);
    }
}

/* Line numbers for code blocks */
.line-numbers {
    counter-reset: line;
}

.line-numbers .line::before {
    counter-increment: line;
    content: counter(line);
    display: inline-block;
    width: 2em;
    margin-right: 1em;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85em;
    user-select: none;
}

/* Diff highlighting */
.diff .hljs-deletion,
.diff .deletion {
    display: block;
    background: rgba(220, 38, 38, 0.08);
    margin: 0 calc(-1 * var(--space-xl));
    padding: 0 var(--space-xl);
}

.diff .hljs-addition,
.diff .addition {
    display: block;
    background: rgba(5, 150, 105, 0.08);
    margin: 0 calc(-1 * var(--space-xl));
    padding: 0 var(--space-xl);
}

@media (prefers-color-scheme: dark) {
    .diff .hljs-deletion,
    .diff .deletion {
        background: rgba(252, 165, 165, 0.08);
    }

    .diff .hljs-addition,
    .diff .addition {
        background: rgba(52, 211, 153, 0.08);
    }
}
