/*
 * OmicVerse Code Editor Dark Theme
 * Dark mode styles for code editor components
 * ===========================================
 */

/* ========================================
   Dark Theme - Code Cells
   ======================================== */
html.app-skin-dark .code-cell {
    background: #0f172a;
    border-color: #1f2937;
}

html.app-skin-dark .code-cell-header {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .code-cell-input textarea {
    caret-color: #e5e7eb;
}

html.app-skin-dark .code-cell-input .code-highlight {
    color: #e5e7eb;
    background: transparent !important;
}

html.app-skin-dark .code-cell-input pre[class*="language-"] {
    background: #0f172a;
}

html.app-skin-dark code[class*="language-"],
html.app-skin-dark pre[class*="language-"] {
    color: #e5e7eb;
    text-shadow: none;
}

html.app-skin-dark .code-cell-input .code-highlight code {
    background: transparent !important;
}

html.app-skin-dark .token {
    text-shadow: none;
    background: transparent !important;
}

/* ========================================
   Dark Theme - Syntax Highlighting
   ======================================== */
html.app-skin-dark .token.comment,
html.app-skin-dark .token.prolog,
html.app-skin-dark .token.doctype,
html.app-skin-dark .token.cdata {
    color: #9ca3af;
}

html.app-skin-dark .token.punctuation {
    color: #e5e7eb;
}

html.app-skin-dark .token.property,
html.app-skin-dark .token.tag,
html.app-skin-dark .token.constant,
html.app-skin-dark .token.symbol,
html.app-skin-dark .token.deleted {
    color: #fda4af;
}

html.app-skin-dark .token.boolean,
html.app-skin-dark .token.number {
    color: #fcd34d;
}

html.app-skin-dark .token.selector,
html.app-skin-dark .token.attr-name,
html.app-skin-dark .token.string,
html.app-skin-dark .token.char,
html.app-skin-dark .token.builtin,
html.app-skin-dark .token.inserted {
    color: #86efac;
}

html.app-skin-dark .token.operator,
html.app-skin-dark .token.entity,
html.app-skin-dark .token.url,
html.app-skin-dark .token.variable {
    color: #93c5fd;
}

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

html.app-skin-dark .token.keyword {
    color: #38bdf8;
}

/* ========================================
   Dark Theme - Code Output
   ======================================== */
html.app-skin-dark .code-cell-output {
    background: #111827;
    color: #e5e7eb;
    border-top-color: #1f2937;
}

html.app-skin-dark .code-cell-output.markdown {
    background: #0f172a;
    color: #e5e7eb;
}

html.app-skin-dark .code-cell-output.error {
    background: #3f1d1d;
    color: #fca5a5;
}

/* ========================================
   Dark Theme - Markdown
   ======================================== */
html.app-skin-dark .markdown-render {
    color: #e5e7eb;
}

html.app-skin-dark .markdown-render h1,
html.app-skin-dark .markdown-render h2,
html.app-skin-dark .markdown-render h3 {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .markdown-render code {
    background: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .markdown-render pre {
    background: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .markdown-render blockquote {
    border-left-color: #1f2937;
    color: #94a3b8;
}

html.app-skin-dark .code-cell.cell-markdown .code-input,
html.app-skin-dark .code-cell.cell-raw .code-input {
    color: #e5e7eb !important;
    -webkit-text-fill-color: #e5e7eb;
}

html.app-skin-dark .md-preview {
    background: #0f172a;
    border-color: #1f2937;
    color: #e5e7eb;
}

html.app-skin-dark .md-preview a {
    color: #93c5fd;
}

html.app-skin-dark .md-preview pre {
    background: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .md-preview table th,
html.app-skin-dark .md-preview table td {
    border-color: #1f2937;
}

html.app-skin-dark .md-preview table th {
    background: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .md-preview tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.45);
}

html.app-skin-dark .md-preview blockquote {
    border-left-color: #1f2937;
    color: #94a3b8;
}

html.app-skin-dark .md-preview h1,
html.app-skin-dark .md-preview h2,
html.app-skin-dark .md-preview h3 {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .md-preview code {
    background: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .md-preview hr {
    border-top-color: #1f2937;
}

html.app-skin-dark .md-editor textarea {
    background: #0f172a;
    color: #e5e7eb;
}

html.app-skin-dark .md-editor .CodeMirror {
    border-color: #1f2937;
}

/* ========================================
   Dark Theme - File Viewers
   ======================================== */
html.app-skin-dark .text-file-view {
    background: #0f172a;
}

html.app-skin-dark .text-file-view textarea {
    background: #0f172a;
    color: #e5e7eb;
}

html.app-skin-dark .image-file-view {
    background: #0f172a;
}

/* ========================================
   Dark Theme - File Manager
   ======================================== */
html.app-skin-dark .file-manager-title {
    color: #e5e7eb;
}

html.app-skin-dark .file-manager-path,
html.app-skin-dark .file-manager-meta {
    color: #94a3b8;
}

html.app-skin-dark .file-manager-item {
    color: #e5e7eb;
}

html.app-skin-dark .file-manager-item:hover {
    background: #111827;
}

html.app-skin-dark .file-manager-item .file-icon {
    color: #94a3b8;
}

html.app-skin-dark .file-manager-item.is-dir .file-icon {
    color: #60a5fa;
}

html.app-skin-dark .fm-section-title {
    color: #e5e7eb;
}

html.app-skin-dark .file-tree-node {
    color: #e5e7eb;
}

html.app-skin-dark .file-tree-node:hover {
    background: #111827;
}

html.app-skin-dark .file-context-menu {
    background: #0f172a;
    border-color: #1f2937;
}

html.app-skin-dark .file-context-menu-item {
    color: #e5e7eb;
}

html.app-skin-dark .file-context-menu-item:hover {
    background: #111827;
}

/* ========================================
   Dark Theme - Kernel Monitor
   ======================================== */
html.app-skin-dark .kernel-metric {
    background: #111827;
    border-color: #1f2937;
}

html.app-skin-dark .kernel-metric-title {
    color: #9ca3af;
}

html.app-skin-dark .kernel-metric-value {
    color: #e5e7eb;
}

html.app-skin-dark .kernel-var-bar {
    background: #1f2937;
}

html.app-skin-dark .var-table th,
html.app-skin-dark .var-table td {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .var-table th,
html.app-skin-dark .var-preview {
    color: #94a3b8;
}

html.app-skin-dark .var-detail-view {
    background: #0f172a;
}

html.app-skin-dark .var-detail-meta {
    color: #94a3b8;
}

html.app-skin-dark .var-table-view th,
html.app-skin-dark .var-table-view td {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .code-toolbar-mini-label {
    color: #9ca3af;
}

html.app-skin-dark .code-toolbar-mini-input {
    background: #111827 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

/* ========================================
   Dark Theme - Toolbars & Headers
   ======================================== */
html.app-skin-dark .page-toolbar {
    background: #0f172a;
    border-bottom-color: #1f2937;
}

html.app-skin-dark .header-pagebar {
    background: #0f172a;
    border-top-color: #1f2937;
}

html.app-skin-dark .header-pagebar .page-header-title h5 {
    color: #e5e7eb;
    border-right-color: #1f2937;
}

html.app-skin-dark .header-pagebar .breadcrumb,
html.app-skin-dark .header-pagebar .breadcrumb a {
    color: #9ca3af;
}

html.app-skin-dark .code-toolbar-group {
    background: #111827;
    border-color: #1f2937;
}

html.app-skin-dark .code-toolbar-group .btn {
    border-right-color: #1f2937;
    color: #e5e7eb;
}

html.app-skin-dark .code-toolbar-group .form-select {
    background-color: #111827;
    color: #e5e7eb;
}

html.app-skin-dark .code-toolbar-label {
    color: #9ca3af;
}

/* ========================================
   Dark Theme - Agent Panel
   ======================================== */
html.app-skin-dark .agent-panel {
    background: #0f172a;
    border-color: #1f2937;
}

html.app-skin-dark .agent-panel-header {
    border-bottom-color: #1f2937;
}

html.app-skin-dark .agent-panel-title {
    color: #e5e7eb;
}

html.app-skin-dark .agent-harness-panel {
    background: #111827;
    border-bottom-color: #1f2937;
}

html.app-skin-dark .agent-harness-title,
html.app-skin-dark .agent-harness-subtitle {
    color: #cbd5e1;
}

html.app-skin-dark .agent-harness-badge {
    background: #1e293b;
    color: #c4b5fd;
    border-color: #4338ca55;
}

html.app-skin-dark .agent-harness-column {
    background: #0f172a;
    border-color: #1f2937;
}

html.app-skin-dark .agent-harness-list,
html.app-skin-dark .agent-harness-trace {
    color: #cbd5e1;
}

html.app-skin-dark .agent-harness-empty {
    color: #64748b;
}

html.app-skin-dark .agent-harness-approval {
    background: #172554;
    border-color: #1d4ed855;
}

html.app-skin-dark .agent-harness-approval-title {
    color: #93c5fd;
}

html.app-skin-dark .agent-harness-trace pre {
    background: #020617;
}

html.app-skin-dark .agent-messages {
    background: #0b1220;
}

html.app-skin-dark .agent-message.user {
    background: #1e3a8a;
    color: #e0e7ff;
}

html.app-skin-dark .agent-message.assistant {
    background: #064e3b;
    color: #d1fae5;
}

html.app-skin-dark .agent-message pre {
    background: #0b1220;
}

html.app-skin-dark .agent-input {
    border-top-color: #1f2937;
    background: #0f172a;
}

html.app-skin-dark .agent-input textarea {
    background: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
}

/* ---- Dark: streaming cursor ---- */
html.app-skin-dark .agent-streaming .agent-llm-text::after {
    background: #6ee7b7;
}

/* ---- Dark: inline cards ---- */
html.app-skin-dark .agent-card-tool {
    background: #1e3a5f;
    border-color: #2563eb40;
    color: #93c5fd;
}

html.app-skin-dark .agent-card-detail {
    color: #9ca3af;
}

html.app-skin-dark .agent-card-code {
    background: #0b1220;
}

html.app-skin-dark .agent-card-result {
    background: #064e3b;
    border-color: #065f4660;
    color: #a7f3d0;
}

html.app-skin-dark .agent-card-error {
    background: #450a0a;
    border-color: #7f1d1d60;
    color: #fca5a5;
}

html.app-skin-dark .agent-session-badge {
    background: #374151;
    color: #9ca3af;
}

/* ========================================
   Dark Theme - Editor Tabs
   ======================================== */
html.app-skin-dark .editor-tabs {
    background: #0f172a;
    border-bottom-color: #1f2937;
}

html.app-skin-dark .editor-tab {
    background: #111827;
    border-color: #1f2937;
    color: #e5e7eb;
}

html.app-skin-dark .editor-tab.active {
    border-color: #60a5fa;
    color: #60a5fa;
}

html.app-skin-dark .editor-tab .tab-close {
    color: #9ca3af;
}
