/* ============================================
   Syntax Highlighting - Professional Theme
   Based on VS Code Dark+ with custom refinements
   ============================================ */

/* Code Blocks */
.highlight {
    background: #1e1e2e;
    border: 1px solid rgba(63, 63, 70, 0.5);
    border-radius: 12px;
    margin: 1.5rem 0;
    overflow: hidden;
    position: relative;
}

.highlight pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
    background: transparent;
    border: none;
}

.highlight code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    background: transparent;
    border: none;
    padding: 0;
    color: #e4e4e7;
}

/* Line Numbers */
.highlight .ln,
.highlight .lnt {
    color: #52525b;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 1px solid rgba(63, 63, 70, 0.5);
    user-select: none;
}

/* Syntax Colors - Professional Dark Theme */

/* Comments - Subtle gray */
.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cs,
.highlight .cp,
.highlight .cpf {
    color: #6b7280;
    font-style: italic;
}

/* Keywords - Purple accent */
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt {
    color: #c084fc;
    font-weight: 500;
}

/* Strings - Cyan/Teal */
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx,
.highlight .sr,
.highlight .ss {
    color: #67e8f9;
}

/* Numbers - Orange */
.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo,
.highlight .mb,
.highlight .mx,
.highlight .il {
    color: #fb923c;
}

/* Functions & Methods - Blue */
.highlight .nf,
.highlight .fm,
.highlight .nx {
    color: #60a5fa;
}

/* Classes & Types - Yellow/Gold */
.highlight .nc,
.highlight .nn,
.highlight .no,
.highlight .nd {
    color: #fbbf24;
}

/* Variables - Light text */
.highlight .n,
.highlight .na,
.highlight .nb,
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .vm {
    color: #e4e4e7;
}

/* Operators */
.highlight .o,
.highlight .ow {
    color: #a78bfa;
}

/* Punctuation */
.highlight .p {
    color: #a1a1aa;
}

/* Error - Red */
.highlight .err {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* Generic */
.highlight .gd {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.highlight .gi {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
}

.highlight .gh {
    color: #60a5fa;
    font-weight: 600;
}

.highlight .gu {
    color: #a78bfa;
    font-weight: 600;
}

/* Diff markers */
.highlight .gd .x {
    color: #fca5a5;
    background: rgba(252, 165, 165, 0.15);
}

.highlight .gi .x {
    color: #86efac;
    background: rgba(134, 239, 172, 0.15);
}

/* Whitespace */
.highlight .w {
    color: transparent;
}

/* Special tokens */
.highlight .bp { color: #94a3b8; }
.highlight .nt { color: #f472b6; }
.highlight .nl { color: #67e8f9; }
.highlight .ni { color: #f472b6; font-weight: 600; }

/* Attribute names (for HTML/XML) */
.highlight .na {
    color: #a78bfa;
}

/* Attribute values */
.highlight .s .na,
.highlight .nv {
    color: #67e8f9;
}

/* Tags */
.highlight .nt {
    color: #f472b6;
}

/* Regex */
.highlight .sr {
    color: #4ade80;
}

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

/* Shell/Bash */
.language-bash .highlight .nb,
.language-sh .highlight .nb,
.language-shell .highlight .nb {
    color: #60a5fa;
}

/* Python */
.language-python .highlight .bp {
    color: #c084fc;
}

.language-python .highlight .fm {
    color: #fbbf24;
}

/* JavaScript/TypeScript */
.language-javascript .highlight .kd,
.language-typescript .highlight .kd {
    color: #c084fc;
}

/* JSON */
.language-json .highlight .nl {
    color: #60a5fa;
}

/* YAML */
.language-yaml .highlight .l {
    color: #67e8f9;
}

/* CSS */
.language-css .highlight .nc {
    color: #fbbf24;
}

.language-css .highlight .nn {
    color: #4ade80;
}

/* SQL */
.language-sql .highlight .k {
    color: #c084fc;
    text-transform: uppercase;
}

/* ============================================
   Inline Code
   ============================================ */
code:not([class*="language-"]) {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    padding: 0.2em 0.4em;
    background: rgba(24, 24, 27, 0.8);
    border-radius: 4px;
    color: #06b6d4;
}

/* ============================================
   Code Block Header (optional - for language labels)
   ============================================ */
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(63, 63, 70, 0.5);
}

.code-language {
    font-size: 0.75rem;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Scrollbar for code blocks
   ============================================ */
.highlight pre::-webkit-scrollbar {
    height: 8px;
}

.highlight pre::-webkit-scrollbar-track {
    background: transparent;
}

.highlight pre::-webkit-scrollbar-thumb {
    background: rgba(113, 113, 122, 0.5);
    border-radius: 4px;
}

.highlight pre::-webkit-scrollbar-thumb:hover {
    background: rgba(113, 113, 122, 0.7);
}

/* ============================================
   Selection in code blocks
   ============================================ */
.highlight ::selection {
    background: rgba(99, 102, 241, 0.3);
}
