/* Prism.js Theme for Code Highlighting */

/* Base theme - Dark mode optimized for AuthMesh */
code[class*="language-"],
pre[class*="language-"] {
    color: #e2e8f0;
    background: none;
    text-shadow: 0 1px rgba(0, 0, 0, 0.3);
    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.5;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

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

/* Inline code */
:not(pre) > code[class*="language-"] {
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    white-space: normal;
    background: #1e293b;
    color: #e2e8f0;
}

/* Token colors */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #64748b;
    font-style: italic;
}

.token.punctuation {
    color: #94a3b8;
}

.token.namespace {
    opacity: 0.7;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
    color: #f87171;
}

.token.boolean,
.token.number {
    color: #fbbf24;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #34d399;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
    color: #60a5fa;
}

.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
    color: #a78bfa;
}

.token.keyword {
    color: #fb7185;
    font-weight: 600;
}

.token.regex,
.token.important {
    color: #fbbf24;
}

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

.token.italic {
    font-style: italic;
}

.token.entity {
    cursor: help;
}

/* Language-specific highlighting */

/* Go specific */
.language-go .token.keyword {
    color: #fb7185;
}

.language-go .token.function {
    color: #60a5fa;
}

.language-go .token.type {
    color: #a78bfa;
}

.language-go .token.package {
    color: #34d399;
}

/* JSON specific */
.language-json .token.property {
    color: #60a5fa;
}

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

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

.language-json .token.boolean {
    color: #f87171;
}

/* YAML specific */
.language-yaml .token.key {
    color: #60a5fa;
}

.language-yaml .token.value {
    color: #34d399;
}

/* Bash/Shell specific */
.language-bash .token.command {
    color: #34d399;
}

.language-bash .token.option {
    color: #60a5fa;
}

.language-bash .token.variable {
    color: #fbbf24;
}

/* Docker specific */
.language-dockerfile .token.instruction {
    color: #fb7185;
    font-weight: 600;
}

/* Line highlighting */
.line-highlight {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding-left: 0.5em;
    margin-left: -0.5em;
}

/* Line numbers */
.line-numbers .line-numbers-rows {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding-right: 0.5em;
    margin-right: 0.5em;
}

.line-numbers-rows > span:before {
    color: #64748b;
    content: counter(linenumber);
    counter-increment: linenumber;
    display: block;
    padding-right: 0.5em;
    text-align: right;
}

/* Command line */
.command-line-prompt > span:before {
    color: #64748b;
    content: ' ';
    display: block;
    padding-right: 0.8em;
}

.command-line-prompt > span[data-user]:before {
    content: "[" attr(data-user) "@" attr(data-host) "] $";
}

.command-line-prompt > span[data-user="root"]:before {
    content: "[" attr(data-user) "@" attr(data-host) "] #";
}

.command-line-prompt > span[data-prompt]:before {
    content: attr(data-prompt);
}

/* Copy to clipboard button styling */
.code-toolbar {
    position: relative;
}

.code-toolbar .toolbar {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    transition: opacity 0.3s ease-in-out;
    opacity: 0;
}

.code-toolbar:hover .toolbar {
    opacity: 1;
}

.code-toolbar .toolbar-item {
    display: inline-block;
}

.code-toolbar .toolbar-item button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 0.25rem;
    color: #e2e8f0;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    transition: background-color 0.2s;
}

.code-toolbar .toolbar-item button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Diff highlighting */
.token.deleted {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.token.inserted {
    background: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}

/* Selection highlighting */
::selection {
    background: rgba(59, 130, 246, 0.3);
}

::-moz-selection {
    background: rgba(59, 130, 246, 0.3);
}

/* Scrollbar styling for code blocks */
pre[class*="language-"]::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

pre[class*="language-"]::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Focus styles for accessibility */
pre[class*="language-"]:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode adjustments */
@media (prefers-contrast: high) {
    code[class*="language-"],
    pre[class*="language-"] {
        color: #ffffff;
        background: #000000;
    }
    
    .token.comment,
    .token.prolog,
    .token.doctype,
    .token.cdata {
        color: #cccccc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .code-toolbar .toolbar {
        transition: none;
    }
    
    .code-toolbar .toolbar-item button {
        transition: none;
    }
}
