/* Enhanced Syntax Highlighting Colors for Highlight.js */
/* Provides distinct colors for each syntax element */

/* ===== BASE SYNTAX COLORS (Light Theme) ===== */

/* Keywords and control structures - Blue */
.hljs-keyword,
.hljs-built_in,
.hljs-type,
.hljs-literal {
    color: #2563eb !important;
    font-weight: 600 !important;
}

/* Operators - Pink */
.hljs-operator,
.hljs-punctuation {
    color: #e11d48 !important;
    font-weight: 500 !important;
}

/* Functions and methods - Orange */
.hljs-function,
.hljs-title,
.hljs-title.function,
.hljs-title.class,
.hljs-title.class.inherited {
    color: #ea580c !important;
    font-weight: 500 !important;
}

/* Classes and types - Amber */
.hljs-class,
.hljs-type,
.hljs-title.class {
    color: #d97706 !important;
    font-weight: 500 !important;
}

/* Variables and identifiers - Emerald */
.hljs-variable,
.hljs-variable.language,
.hljs-variable.constant,
.hljs-property,
.hljs-attr {
    color: #059669 !important;
}

/* Strings and literals - Green */
.hljs-string,
.hljs-char,
.hljs-template-literal,
.hljs-template-variable,
.hljs-regexp {
    color: #16a34a !important;
}

/* Numbers - Red */
.hljs-number,
.hljs-literal {
    color: #dc2626 !important;
    font-weight: 500 !important;
}

/* Booleans and constants - Purple */
.hljs-boolean,
.hljs-constant,
.hljs-symbol {
    color: #9333ea !important;
    font-weight: 500 !important;
}

/* Comments - Gray */
.hljs-comment,
.hljs-quote,
.hljs-doctag {
    color: #6b7280 !important;
    font-style: italic !important;
}

/* HTML/XML specific - Red for tags */
.hljs-tag,
.hljs-name {
    color: #dc2626 !important;
    font-weight: 500 !important;
}

/* HTML attributes - Teal */
.hljs-attribute {
    color: #0d9488 !important;
}

/* CSS specific */
.hljs-selector-tag,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
    color: #0891b2 !important;
    font-weight: 500 !important;
}

/* CSS properties */
.hljs-property {
    color: #be123c !important;
}

/* CSS values */
.hljs-value,
.hljs-hexcolor {
    color: #7c3aed !important;
}

/* SQL specific */
.hljs-keyword.hljs-select,
.hljs-keyword.hljs-from,
.hljs-keyword.hljs-where,
.hljs-keyword.hljs-join {
    color: #2563eb !important;
    text-transform: uppercase !important;
}

/* JavaScript specific */
.hljs-params {
    color: #6495ed !important;
}

.hljs-meta {
    color: #a21caf !important;
    font-weight: 500 !important;
}

/* Additional elements */
.hljs-section {
    color: #0891b2 !important;
    font-weight: 500 !important;
}

.hljs-addition {
    color: #16a34a !important;
    background-color: rgba(22, 163, 74, 0.1) !important;
}

.hljs-deletion {
    color: #dc2626 !important;
    background-color: rgba(220, 38, 38, 0.1) !important;
}

.hljs-emphasis {
    font-style: italic !important;
}

.hljs-strong {
    font-weight: bold !important;
}

/* ===== DARK THEME OVERRIDES - ENHANCED BRIGHTNESS ===== */
[data-theme="dark"] .hljs-keyword,
[data-theme="dark"] .hljs-built_in,
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-literal {
    color: #93c5fd !important;
}

[data-theme="dark"] .hljs-operator,
[data-theme="dark"] .hljs-punctuation {
    color: #f9a8d4 !important;
}

[data-theme="dark"] .hljs-function,
[data-theme="dark"] .hljs-title,
[data-theme="dark"] .hljs-title.function,
[data-theme="dark"] .hljs-title.class,
[data-theme="dark"] .hljs-title.class.inherited {
    color: #fdba74 !important;
}

[data-theme="dark"] .hljs-class,
[data-theme="dark"] .hljs-type,
[data-theme="dark"] .hljs-title.class {
    color: #fde047 !important;
}

[data-theme="dark"] .hljs-variable,
[data-theme="dark"] .hljs-variable.language,
[data-theme="dark"] .hljs-variable.constant,
[data-theme="dark"] .hljs-property,
[data-theme="dark"] .hljs-attr {
    color: #6ee7b7 !important;
}

[data-theme="dark"] .hljs-string,
[data-theme="dark"] .hljs-char,
[data-theme="dark"] .hljs-template-literal,
[data-theme="dark"] .hljs-template-variable,
[data-theme="dark"] .hljs-regexp {
    color: #86efac !important;
}

[data-theme="dark"] .hljs-number,
[data-theme="dark"] .hljs-literal {
    color: #fca5a5 !important;
}

[data-theme="dark"] .hljs-boolean,
[data-theme="dark"] .hljs-constant,
[data-theme="dark"] .hljs-symbol {
    color: #d8b4fe !important;
}

[data-theme="dark"] .hljs-comment,
[data-theme="dark"] .hljs-quote,
[data-theme="dark"] .hljs-doctag {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .hljs-tag,
[data-theme="dark"] .hljs-name {
    color: #fca5a5 !important;
}

[data-theme="dark"] .hljs-attribute {
    color: #5eead4 !important;
}

[data-theme="dark"] .hljs-selector-tag,
[data-theme="dark"] .hljs-selector-id,
[data-theme="dark"] .hljs-selector-class,
[data-theme="dark"] .hljs-selector-attr,
[data-theme="dark"] .hljs-selector-pseudo {
    color: #a5f3fc !important;
}

[data-theme="dark"] .hljs-property {
    color: #fda4af !important;
}

[data-theme="dark"] .hljs-value,
[data-theme="dark"] .hljs-hexcolor {
    color: #c4b5fd !important;
}

[data-theme="dark"] .hljs-params {
    color: #a5b4fc !important;
}

[data-theme="dark"] .hljs-meta {
    color: #f0abfc !important;
}

[data-theme="dark"] .hljs-section {
    color: #a5f3fc !important;
}

[data-theme="dark"] .hljs-addition {
    color: #86efac !important;
    background-color: rgba(134, 239, 172, 0.1) !important;
}

[data-theme="dark"] .hljs-deletion {
    color: #fca5a5 !important;
    background-color: rgba(252, 165, 165, 0.1) !important;
}

/* ===== HIGH CONTRAST THEME OVERRIDES ===== */
[data-theme="high-contrast"] .hljs-keyword,
[data-theme="high-contrast"] .hljs-built_in,
[data-theme="high-contrast"] .hljs-type,
[data-theme="high-contrast"] .hljs-literal {
    color: #0000ff !important;
}

[data-theme="high-contrast"] .hljs-operator,
[data-theme="high-contrast"] .hljs-punctuation {
    color: #ff0080 !important;
}

[data-theme="high-contrast"] .hljs-function,
[data-theme="high-contrast"] .hljs-title,
[data-theme="high-contrast"] .hljs-title.function,
[data-theme="high-contrast"] .hljs-title.class,
[data-theme="high-contrast"] .hljs-title.class.inherited {
    color: #ff8000 !important;
}

[data-theme="high-contrast"] .hljs-string,
[data-theme="high-contrast"] .hljs-char,
[data-theme="high-contrast"] .hljs-template-literal,
[data-theme="high-contrast"] .hljs-template-variable,
[data-theme="high-contrast"] .hljs-regexp {
    color: #008000 !important;
}

[data-theme="high-contrast"] .hljs-number,
[data-theme="high-contrast"] .hljs-literal {
    color: #ff0000 !important;
}

[data-theme="high-contrast"] .hljs-boolean,
[data-theme="high-contrast"] .hljs-constant,
[data-theme="high-contrast"] .hljs-symbol {
    color: #800080 !important;
}

[data-theme="high-contrast"] .hljs-comment,
[data-theme="high-contrast"] .hljs-quote,
[data-theme="high-contrast"] .hljs-doctag {
    color: #666666 !important;
}

[data-theme="high-contrast"] .hljs-tag,
[data-theme="high-contrast"] .hljs-name {
    color: #ff0000 !important;
}

[data-theme="high-contrast"] .hljs-attribute {
    color: #008080 !important;
}

[data-theme="high-contrast"] .hljs-selector-tag,
[data-theme="high-contrast"] .hljs-selector-id,
[data-theme="high-contrast"] .hljs-selector-class,
[data-theme="high-contrast"] .hljs-selector-attr,
[data-theme="high-contrast"] .hljs-selector-pseudo {
    color: #0080ff !important;
}

[data-theme="high-contrast"] .hljs-property {
    color: #ff0080 !important;
}

[data-theme="high-contrast"] .hljs-value,
[data-theme="high-contrast"] .hljs-hexcolor {
    color: #800080 !important;
}

/* ===== CODE BLOCK STYLING ===== */
pre code.hljs {
    display: block;
    overflow-x: auto;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    background: var(--code-bg, #f8f9fa);
    border: 1px solid var(--border-color, #e9ecef);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-family: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

[data-theme="dark"] pre code.hljs {
    background: var(--code-bg, #1e1e1e);
    border-color: var(--border-color, #333);
}

/* Inline code styling */
code.hljs {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.05);
    font-family: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.85rem;
}

[data-theme="dark"] code.hljs {
    background: rgba(255, 255, 255, 0.1);
}

/* Selection styling */
pre code.hljs::-moz-selection,
pre code.hljs ::-moz-selection {
    background: rgba(0, 102, 204, 0.3);
}

pre code.hljs::selection,
pre code.hljs ::selection {
    background: rgba(0, 102, 204, 0.3);
}

/* Line highlighting */
.hljs-ln-line.highlighted {
    background: rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--syntax-keyword, #2563eb);
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

/* Language label styling */
pre[data-language]::before {
    content: attr(data-language);
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-color, #333);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 500;
}

[data-theme="dark"] pre[data-language]::before {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color, #fff);
}
