/**
 * Atahualpa Code Highlighting & Diagram Styles
 * Complete GitHub-style syntax highlighting theme
 * Version 3.7.36
 */

/* ========================================
   Import JetBrains Mono Font
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ========================================
   Prism.js Complete Token Colors 
   GitHub-inspired Dark Theme
   ======================================== */

code[class*="language-"],
pre[class*="language-"] {
    color: #c9d1d9;
    background: none;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 14px;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.6;
    tab-size: 4;
    hyphens: none;
    text-shadow: none !important;
}

/* Code blocks */
pre[class*="language-"] {
    padding: 1em;
    margin: 0;
    overflow: auto;
    border-radius: 0;
    background: #0d1117;
}

/* Inline code */
:not(pre)>code[class*="language-"] {
    padding: 0.2em 0.4em;
    border-radius: 6px;
    white-space: normal;
    background: rgba(110, 118, 129, 0.4);
    color: #c9d1d9;
}

/* ========================================
   Token Colors - Complete Set
   ======================================== */

/* Comments - Gray italic */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #8b949e !important;
    font-style: italic;
}

/* Punctuation - Light gray */
.token.punctuation {
    color: #c9d1d9 !important;
}

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

/* Tags - Green (HTML tags, XML tags) */
.token.tag,
.token.tag .token.tag {
    color: #7ee787 !important;
}

/* Attribute names - Light blue */
.token.attr-name {
    color: #79c0ff !important;
}

/* Attribute values, Strings - Light cyan */
.token.attr-value,
.token.string,
.token.char {
    color: #a5d6ff !important;
}

/* Properties (CSS, JSON keys) - Light blue */
.token.property {
    color: #79c0ff !important;
}

/* Constants, Symbols - Red/Pink */
.token.constant,
.token.symbol,
.token.deleted {
    color: #ff7b72 !important;
}

/* Booleans - Light blue */
.token.boolean {
    color: #79c0ff !important;
}

/* Numbers - Light blue */
.token.number {
    color: #79c0ff !important;
}

/* Selectors (CSS) - Green */
.token.selector {
    color: #7ee787 !important;
}

/* Built-in names - Light blue */
.token.builtin {
    color: #79c0ff !important;
}

/* Inserted (diff) - Green */
.token.inserted {
    color: #7ee787 !important;
    background: rgba(63, 185, 80, 0.15);
}

/* Operators - Cyan */
.token.operator {
    color: #79c0ff !important;
}

/* Entity - Orange */
.token.entity {
    color: #ffa657 !important;
}

/* URLs - Blue */
.token.url {
    color: #58a6ff !important;
}

/* Keywords - Red/Pink (if, else, for, while, return, etc.) */
.token.keyword {
    color: #ff7b72 !important;
}

/* Control flow keywords */
.token.control-flow {
    color: #ff7b72 !important;
}

/* At-rules (CSS @import, @media) - Red/Pink */
.token.atrule {
    color: #ff7b72 !important;
}

/* Functions - Purple */
.token.function {
    color: #d2a8ff !important;
}

/* Methods - Purple */
.token.method {
    color: #d2a8ff !important;
}

/* Class names - Orange */
.token.class-name {
    color: #ffa657 !important;
}

/* Regex - Orange */
.token.regex {
    color: #ffa657 !important;
}

/* Important - Orange bold */
.token.important {
    color: #ffa657 !important;
    font-weight: bold;
}

/* Variables - Orange */
.token.variable {
    color: #ffa657 !important;
}

/* Bold */
.token.bold {
    font-weight: bold;
}

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

/* ========================================
   Language-Specific Overrides
   ======================================== */

/* JavaScript/TypeScript */
.language-javascript .token.keyword,
.language-typescript .token.keyword,
.language-js .token.keyword,
.language-ts .token.keyword {
    color: #ff7b72 !important;
}

.language-javascript .token.function,
.language-typescript .token.function,
.language-js .token.function,
.language-ts .token.function {
    color: #d2a8ff !important;
}

.language-javascript .token.string,
.language-typescript .token.string,
.language-js .token.string,
.language-ts .token.string {
    color: #a5d6ff !important;
}

.language-javascript .token.template-string,
.language-typescript .token.template-string {
    color: #a5d6ff !important;
}

.language-javascript .token.template-punctuation,
.language-typescript .token.template-punctuation {
    color: #ff7b72 !important;
}

.language-javascript .token.console,
.language-js .token.console {
    color: #79c0ff !important;
}

/* JSX/TSX */
.language-jsx .token.tag,
.language-tsx .token.tag,
.language-jsx .token.tag .token.tag,
.language-tsx .token.tag .token.tag {
    color: #7ee787 !important;
}

.language-jsx .token.tag .token.class-name,
.language-tsx .token.tag .token.class-name {
    color: #ffa657 !important;
}

.language-jsx .token.attr-name,
.language-tsx .token.attr-name {
    color: #79c0ff !important;
}

.language-jsx .token.attr-value,
.language-tsx .token.attr-value {
    color: #a5d6ff !important;
}

.language-jsx .token.script .token.keyword,
.language-tsx .token.script .token.keyword {
    color: #ff7b72 !important;
}

/* HTML/Markup */
.language-html .token.tag,
.language-markup .token.tag,
.language-xml .token.tag {
    color: #7ee787 !important;
}

.language-html .token.attr-name,
.language-markup .token.attr-name,
.language-xml .token.attr-name {
    color: #79c0ff !important;
}

.language-html .token.attr-value,
.language-markup .token.attr-value,
.language-xml .token.attr-value {
    color: #a5d6ff !important;
}

.language-html .token.doctype,
.language-markup .token.doctype {
    color: #8b949e !important;
}

/* CSS */
.language-css .token.selector {
    color: #7ee787 !important;
}

.language-css .token.property {
    color: #79c0ff !important;
}

.language-css .token.function {
    color: #d2a8ff !important;
}

.language-css .token.string,
.language-css .token.url {
    color: #a5d6ff !important;
}

.language-css .token.atrule,
.language-css .token.keyword {
    color: #ff7b72 !important;
}

.language-css .token.important {
    color: #ff7b72 !important;
}

/* PHP */
.language-php .token.keyword {
    color: #ff7b72 !important;
}

.language-php .token.function {
    color: #d2a8ff !important;
}

.language-php .token.class-name {
    color: #ffa657 !important;
}

.language-php .token.variable {
    color: #79c0ff !important;
}

.language-php .token.string {
    color: #a5d6ff !important;
}

.language-php .token.delimiter {
    color: #ff7b72 !important;
}

/* Python */
.language-python .token.keyword {
    color: #ff7b72 !important;
}

.language-python .token.function {
    color: #d2a8ff !important;
}

.language-python .token.builtin {
    color: #79c0ff !important;
}

.language-python .token.decorator {
    color: #ffa657 !important;
}

.language-python .token.string {
    color: #a5d6ff !important;
}

.language-python .token.triple-quoted-string {
    color: #a5d6ff !important;
}

/* Bash/Shell */
.language-bash .token.keyword,
.language-shell .token.keyword {
    color: #ff7b72 !important;
}

.language-bash .token.function,
.language-shell .token.function {
    color: #7ee787 !important;
}

.language-bash .token.variable,
.language-shell .token.variable {
    color: #79c0ff !important;
}

.language-bash .token.string,
.language-shell .token.string {
    color: #a5d6ff !important;
}

/* JSON */
.language-json .token.property {
    color: #79c0ff !important;
}

.language-json .token.string {
    color: #a5d6ff !important;
}

.language-json .token.number {
    color: #79c0ff !important;
}

.language-json .token.boolean {
    color: #ff7b72 !important;
}

.language-json .token.null {
    color: #ff7b72 !important;
}

/* YAML */
.language-yaml .token.key,
.language-yml .token.key {
    color: #7ee787 !important;
}

.language-yaml .token.string,
.language-yml .token.string {
    color: #a5d6ff !important;
}

.language-yaml .token.boolean,
.language-yml .token.boolean {
    color: #ff7b72 !important;
}

.language-yaml .token.number,
.language-yml .token.number {
    color: #79c0ff !important;
}

/* SQL */
.language-sql .token.keyword {
    color: #ff7b72 !important;
    text-transform: uppercase;
}

.language-sql .token.function {
    color: #d2a8ff !important;
}

.language-sql .token.string {
    color: #a5d6ff !important;
}

.language-sql .token.number {
    color: #79c0ff !important;
}

/* Markdown */
.language-markdown .token.title,
.language-md .token.title {
    color: #79c0ff !important;
    font-weight: bold;
}

.language-markdown .token.bold,
.language-md .token.bold {
    font-weight: bold;
    color: #ffa657 !important;
}

.language-markdown .token.italic,
.language-md .token.italic {
    font-style: italic;
    color: #a5d6ff !important;
}

.language-markdown .token.code,
.language-md .token.code {
    color: #7ee787 !important;
    background: rgba(110, 118, 129, 0.2);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.language-markdown .token.url,
.language-md .token.url {
    color: #58a6ff !important;
}

/* Diff */
.language-diff .token.deleted {
    color: #ff7b72 !important;
    background: rgba(248, 81, 73, 0.15);
}

.language-diff .token.inserted {
    color: #7ee787 !important;
    background: rgba(63, 185, 80, 0.15);
}

/* Docker */
.language-docker .token.keyword,
.language-dockerfile .token.keyword {
    color: #ff7b72 !important;
    text-transform: uppercase;
}

.language-docker .token.string,
.language-dockerfile .token.string {
    color: #a5d6ff !important;
}

/* Go */
.language-go .token.keyword {
    color: #ff7b72 !important;
}

.language-go .token.function {
    color: #d2a8ff !important;
}

.language-go .token.builtin {
    color: #79c0ff !important;
}

/* Rust */
.language-rust .token.keyword {
    color: #ff7b72 !important;
}

.language-rust .token.function {
    color: #d2a8ff !important;
}

.language-rust .token.macro {
    color: #79c0ff !important;
}

.language-rust .token.lifetime {
    color: #ffa657 !important;
}

/* C/C++ */
.language-c .token.keyword,
.language-cpp .token.keyword {
    color: #ff7b72 !important;
}

.language-c .token.function,
.language-cpp .token.function {
    color: #d2a8ff !important;
}

.language-c .token.macro,
.language-cpp .token.macro {
    color: #79c0ff !important;
}

/* Java */
.language-java .token.keyword {
    color: #ff7b72 !important;
}

.language-java .token.function {
    color: #d2a8ff !important;
}

.language-java .token.class-name {
    color: #ffa657 !important;
}

.language-java .token.annotation {
    color: #7ee787 !important;
}

/* C# */
.language-csharp .token.keyword,
.language-cs .token.keyword {
    color: #ff7b72 !important;
}

.language-csharp .token.function,
.language-cs .token.function {
    color: #d2a8ff !important;
}

.language-csharp .token.class-name,
.language-cs .token.class-name {
    color: #ffa657 !important;
}

/* Ruby */
.language-ruby .token.keyword,
.language-rb .token.keyword {
    color: #ff7b72 !important;
}

.language-ruby .token.function,
.language-rb .token.function {
    color: #d2a8ff !important;
}

.language-ruby .token.symbol {
    color: #79c0ff !important;
}

/* ========================================
   Light Theme Overrides
   ======================================== */

.theme-light code[class*="language-"],
.theme-light pre[class*="language-"],
.code-theme-light code[class*="language-"],
.code-theme-light pre[class*="language-"] {
    color: #1f2328 !important;
}

.theme-light pre[class*="language-"],
.code-theme-light pre[class*="language-"] {
    background: #f6f8fa !important;
}

/* Light theme token colors */
.theme-light .token.comment,
.code-theme-light .token.comment {
    color: #6e7781 !important;
}

.theme-light .token.tag,
.code-theme-light .token.tag {
    color: #116329 !important;
}

.theme-light .token.attr-name,
.code-theme-light .token.attr-name {
    color: #0550ae !important;
}

.theme-light .token.attr-value,
.theme-light .token.string,
.code-theme-light .token.attr-value,
.code-theme-light .token.string {
    color: #0a3069 !important;
}

.theme-light .token.keyword,
.code-theme-light .token.keyword {
    color: #cf222e !important;
}

.theme-light .token.function,
.code-theme-light .token.function {
    color: #8250df !important;
}

.theme-light .token.class-name,
.code-theme-light .token.class-name {
    color: #953800 !important;
}

.theme-light .token.number,
.theme-light .token.boolean,
.code-theme-light .token.number,
.code-theme-light .token.boolean {
    color: #0550ae !important;
}

.theme-light .token.operator,
.code-theme-light .token.operator {
    color: #0550ae !important;
}

.theme-light .token.property,
.code-theme-light .token.property {
    color: #0550ae !important;
}

.theme-light .token.variable,
.code-theme-light .token.variable {
    color: #953800 !important;
}

/* ========================================
   Code Block Container
   ======================================== */

.code-block-wrapper {
    position: relative;
    margin: 1.75em 0;
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    animation: slideUp 0.4s ease-out;
}

.code-block-wrapper.theme-dark {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border: 1px solid rgba(48, 54, 61, 0.8);
}

.code-block-wrapper.theme-light {
    background: linear-gradient(135deg, #f6f8fa 0%, #ffffff 100%);
    border: 1px solid rgba(208, 215, 222, 0.8);
}

.code-block-wrapper:hover {
    box-shadow:
        0 10px 15px -3px rgba(0, 0, 0, 0.15),
        0 4px 6px -2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Toolbar Styling
   ======================================== */

.code-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid;
    transition: all 0.3s ease;
}

.theme-dark .code-toolbar {
    background: rgba(22, 27, 34, 0.95);
    border-color: rgba(48, 54, 61, 0.6);
}

.theme-light .code-toolbar {
    background: rgba(246, 248, 250, 0.95);
    border-color: rgba(208, 215, 222, 0.6);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Label */
.code-language-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Line Count */
.code-line-count {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.6;
}

.theme-dark .code-line-count {
    color: #8b949e;
}

.theme-light .code-line-count {
    color: #57606a;
}

/* ========================================
   Toolbar Buttons
   ======================================== */

.code-toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-dark .code-toolbar-btn {
    color: #8b949e;
}

.theme-light .code-toolbar-btn {
    color: #57606a;
}

.theme-dark .code-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
}

.theme-light .code-toolbar-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1f2328;
}

.code-toolbar-btn.copied {
    background: #22c55e;
    color: #fff;
}

.code-toolbar-btn svg {
    width: 16px;
    height: 16px;
}

.copy-btn {
    width: auto;
    padding: 0 12px;
    gap: 6px;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
}

/* ========================================
   Code Content Area
   ======================================== */

.code-content {
    position: relative;
    overflow: hidden;
}

.code-content pre {
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 20px !important;
}

.code-content pre[class*="language-"] {
    font-size: 14px;
    line-height: 1.65;
    tab-size: 4;
}

.theme-dark .code-content pre[class*="language-"] {
    background: transparent !important;
}

.theme-light .code-content pre[class*="language-"] {
    background: transparent !important;
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.code-content pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.code-content pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.code-content pre::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.4);
    border-radius: 4px;
}

.code-content pre::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* ========================================
   Line Numbers
   ======================================== */

pre[class*="language-"].line-numbers {
    position: relative;
    padding-left: 4em !important;
    counter-reset: linenumber;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 20px;
    left: 0;
    width: 3.5em;
    font-size: 100%;
    letter-spacing: -1px;
    user-select: none;
}

.theme-dark .line-numbers .line-numbers-rows {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

.theme-light .line-numbers .line-numbers-rows {
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.03);
}

.line-numbers-rows>span {
    display: block;
    counter-increment: linenumber;
    padding-right: 0.8em;
    text-align: right;
}

.theme-dark .line-numbers-rows>span {
    color: rgba(255, 255, 255, 0.3);
}

.theme-light .line-numbers-rows>span {
    color: rgba(0, 0, 0, 0.3);
}

.line-numbers-rows>span::before {
    content: counter(linenumber);
}

/* ========================================
   Zoom Feature
   ======================================== */

.code-block-wrapper.zoomed {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 10000;
    margin: 0;
    border-radius: 16px;
    animation: zoomIn 0.3s ease-out;
}

.code-block-wrapper.zoomed .code-content {
    height: calc(100% - 52px);
    overflow: auto;
}

.code-block-wrapper.zoomed .code-content pre {
    min-height: 100%;
    font-size: 16px;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.code-block-wrapper.zoomed::before {
    content: '';
    position: fixed;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: rgba(0, 0, 0, 0.8);
    z-index: -1;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .code-block-wrapper {
        margin: 1em 0;
        border-radius: 8px;
    }

    .code-toolbar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .code-language-label {
        font-size: 10px;
        padding: 3px 8px;
    }

    .code-line-count {
        display: none;
    }

    .code-toolbar-btn {
        width: 28px;
        height: 28px;
    }

    .code-content pre[class*="language-"] {
        font-size: 12px;
        padding: 16px !important;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .code-block-wrapper {
        background: #f5f5f5 !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    .code-toolbar {
        display: none !important;
    }
}