* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* light theme tokens */
    --bg: #ffffff;
    --bg-muted: #f6f8fa;
    --surface: #f6f8fa;
    --surface-2: #eef1f4;
    --border: #d0d7de;
    --text: #24292f;
    --text-muted: #57606a;
    --primary: #0969da;
    --accent: #0969da;
    --code-bg: #f6f8fa;
}

[data-theme="dark"] {
    --bg: #0d1117;
    --bg-muted: #0d1117;
    --surface: #161b22;
    --surface-2: #161b22;
    --border: #30363d;
    --text: #e6edf3;
    --text-muted: #7d8590;
    --primary: #2f81f7;
    --accent: #2f81f7;
    --code-bg: #0d1117;
}

/* Light theme is configured via CSS variables above */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* Main Editor Container */
.editor-container {
    display: flex;
    height: 100vh;
    background-color: var(--bg);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
}

/* Main Heading */
.seo-heading {
    font-size: 1.4rem;
    color: var(--text);
    margin: 8px 0 12px;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    padding: 0 16px;
    background: linear-gradient(90deg, var(--text), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 36px;
}

.tab {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.15s ease;
    min-width: 120px;
}

.tab:hover {
    background-color: var(--surface-2);
}

.tab.active {
    background-color: var(--bg);
    border-bottom: 1px solid var(--bg);
}

.tab-icon {
    margin-right: 6px;
    font-size: 14px;
}

.tab-name {
    font-size: 13px;
    color: var(--text);
    flex: 1;
}

.tab-close {
    margin-left: 6px;
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.tab-close:hover {
    background-color: var(--surface-2);
    color: var(--text);
}

/* Editor Panels */
.editor-panels {
    flex: 1;
    display: flex;
    background-color: var(--bg);
    overflow: hidden;
    height: calc(100vh - 36px);
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
}

/* JSON Panel - flexible width */
.json-panel {
    flex: 1;
    min-width: 300px;
}

/* Dart Panel - fixed width with scroll */
.dart-panel {
    flex: 0 0 50%;
    max-width: 50%;
    min-width: 400px;
}

.panel:last-child {
    border-right: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.copy-btn {
    padding: 6px 12px;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--primary);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.copy-btn:hover {
    background-color: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.panel-content {
    flex: 1;
    overflow: auto;
    position: relative;
    min-height: 0;
    height: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg);
}

/* JSON Editor Styling */
#origJsonContainer {
    height: 100%;
    width: 100%;
}

/* Dart Code Output */
.dart-panel .panel-content {
    background-color: var(--code-bg);
    overflow: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    padding-bottom: 0; /* Removed excessive padding */
}

.dart-panel pre {
    white-space: pre;
    word-wrap: normal;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.3;
    background-color: var(--code-bg);
    box-sizing: border-box;
    overflow: auto !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
    padding: 8px;
    margin: 0;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    max-height: none;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg);
}

/* Custom scrollbar styling for Webkit browsers (Chrome, Safari, etc.) */
/* Shared scrollbar styling for all panels */
.dart-panel pre::-webkit-scrollbar,
.panel-content::-webkit-scrollbar,
.jsoneditor::-webkit-scrollbar,
.ace_scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dart-panel pre::-webkit-scrollbar-track,
.panel-content::-webkit-scrollbar-track,
.jsoneditor::-webkit-scrollbar-track,
.ace_scrollbar::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 4px;
}

.dart-panel pre::-webkit-scrollbar-thumb,
.panel-content::-webkit-scrollbar-thumb,
.jsoneditor::-webkit-scrollbar-thumb,
.ace_scrollbar::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
    border: 2px solid var(--bg);
}

.dart-panel pre::-webkit-scrollbar-thumb:hover,
.panel-content::-webkit-scrollbar-thumb:hover,
.jsoneditor::-webkit-scrollbar-thumb:hover,
.ace_scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #9da1a6;
}

.dart-panel code {
    color: var(--text);
    background: transparent;
}

/* GitHub Dark Theme Syntax Highlighting for Dart */
[data-theme="dark"] .dart-panel .hljs {
    color: var(--text) !important;
    background: var(--code-bg) !important;
}

/* Dark theme - Comments */
[data-theme="dark"] .dart-panel .hljs-comment {
    color: #7d8590 !important;
    font-style: italic;
}

/* Dark theme - Keywords */
[data-theme="dark"] .dart-panel .hljs-keyword {
    color: #ff7b72 !important;
    font-weight: 600;
}

/* Dark theme - Built-in types and classes */
[data-theme="dark"] .dart-panel .hljs-built_in,
[data-theme="dark"] .dart-panel .hljs-type {
    color: #ffa657 !important;
}

/* Dark theme - Strings */
[data-theme="dark"] .dart-panel .hljs-string {
    color: #a5d6ff !important;
}

/* Dark theme - Numbers */
[data-theme="dark"] .dart-panel .hljs-number {
    color: #79c0ff !important;
}

/* Dark theme - Class names and types */
[data-theme="dark"] .dart-panel .hljs-class .hljs-title,
[data-theme="dark"] .dart-panel .hljs-title.class_ {
    color: #ffa657 !important;
    font-weight: 600;
}

/* Dark theme - Function names */
[data-theme="dark"] .dart-panel .hljs-title.function_ {
    color: #d2a8ff !important;
    font-weight: 600;
}

/* Dark theme - Variables and identifiers */
[data-theme="dark"] .dart-panel .hljs-variable,
[data-theme="dark"] .dart-panel .hljs-attr {
    color: #79c0ff !important;
}

/* Dark theme - Literals (true, false, null) */
[data-theme="dark"] .dart-panel .hljs-literal {
    color: #79c0ff !important;
}

/* Dark theme - Operators */
[data-theme="dark"] .dart-panel .hljs-operator {
    color: #ff7b72 !important;
}

/* Dark theme - Punctuation */
[data-theme="dark"] .dart-panel .hljs-punctuation {
    color: #e6edf3 !important;
}

/* Dark theme - Meta annotations (@override, etc.) */
[data-theme="dark"] .dart-panel .hljs-meta {
    color: #79c0ff !important;
}

/* Dark theme - Symbols and special characters */
[data-theme="dark"] .dart-panel .hljs-symbol {
    color: #79c0ff !important;
}

/* VS Code Light Theme Syntax Highlighting for Dart */
[data-theme="light"] .dart-panel .hljs {
    color: var(--text) !important;
    background: var(--code-bg) !important;
}

/* Light theme - Comments */
[data-theme="light"] .dart-panel .hljs-comment {
    color: #008000 !important;
    font-style: italic;
}

/* Light theme - Keywords */
[data-theme="light"] .dart-panel .hljs-keyword {
    color: #0000ff !important;
    font-weight: 600;
}

/* Light theme - Built-in types and classes */
[data-theme="light"] .dart-panel .hljs-built_in,
[data-theme="light"] .dart-panel .hljs-type {
    color: #267f99 !important;
}

/* Light theme - Strings */
[data-theme="light"] .dart-panel .hljs-string {
    color: #a31515 !important;
}

/* Light theme - Numbers */
[data-theme="light"] .dart-panel .hljs-number {
    color: #098658 !important;
}

/* Light theme - Class names and types */
[data-theme="light"] .dart-panel .hljs-class .hljs-title,
[data-theme="light"] .dart-panel .hljs-title.class_ {
    color: #267f99 !important;
    font-weight: 600;
}

/* Light theme - Function names */
[data-theme="light"] .dart-panel .hljs-title.function_ {
    color: #795e26 !important;
    font-weight: 600;
}

/* Light theme - Variables and identifiers */
[data-theme="light"] .dart-panel .hljs-variable,
[data-theme="light"] .dart-panel .hljs-attr {
    color: #001080 !important;
}

/* Light theme - Literals (true, false, null) */
[data-theme="light"] .dart-panel .hljs-literal {
    color: #0000ff !important;
}

/* Light theme - Operators */
[data-theme="light"] .dart-panel .hljs-operator {
    color: #000000 !important;
}

/* Light theme - Punctuation */
[data-theme="light"] .dart-panel .hljs-punctuation {
    color: #000000 !important;
}

/* Light theme - Meta annotations (@override, etc.) */
[data-theme="light"] .dart-panel .hljs-meta {
    color: #795e26 !important;
}

/* Light theme - Symbols and special characters */
[data-theme="light"] .dart-panel .hljs-symbol {
    color: #001080 !important;
}

/* Modern Settings Panel */
.settings-panel {
    width: 350px;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.2);
}

.settings-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    background-color: var(--surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.settings-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    margin-top: 0;
}

.settings-header h3::before {
    content: '⚙️';
    font-size: 16px;
}

.settings-content {
    padding: 8px 10px 6px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--surface);
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: #1f2937;
}

.settings-content::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 3px;
}

.setting-group {
    margin-bottom: 8px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    border-radius: 4px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.setting-group:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.setting-group h4 {
    font-size: 10px;
    color: var(--text-muted);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.setting-group h4::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 2px 2px;
    border-radius: 2px;
    font-size: 12px;
    line-height: 1.2;
}

.setting-item:hover {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.setting-item input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    margin-right: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
    background-color: var(--surface);
    flex-shrink: 0;
}

.setting-item input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.setting-item input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
}

.input-group {
    margin-bottom: 18px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-group input[type="text"]:hover {
    border-color: var(--border);
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

.input-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input[type="text"] {
    flex: 1;
    min-width: 0;
}

.download-btn {
    background: linear-gradient(135deg, #1e40af, #1e3a8a);
    border: none;
    color: #ffffff;
    border-radius: 8px;
    padding: 0 12px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    background: linear-gradient(135deg, #1e3a8a, #1e3a8a);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* Disabled state for input */
.input-group input[type="text"]:disabled {
    background-color: var(--surface);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Tooltip for disabled inputs */
.input-group input[type="text"]:disabled::after {
    content: attr(title);
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
.settings-panel {
        width: 100%;
        border-left: none;
    border-top: 1px solid var(--border);
    }
    
    .setting-group {
        padding: 14px;
    }
}

.settings-content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    cursor: pointer;
    padding: 4px 0;
    transition: background-color 0.15s ease;
    border-radius: 3px;
}

.setting-item:hover {
    background-color: var(--surface-2);
}

.setting-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin-right: 6px;
    cursor: pointer;
    transform: scale(0.9);
    accent-color: var(--primary);
}

.setting-item span {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: #7d8590;
    margin-bottom: 4px;
    font-weight: 500;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    transition: border-color 0.15s ease;
}

.input-with-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-button input[type="text"] {
    flex: 1;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-btn:hover {
    background-color: var(--surface-2);
    border-color: var(--primary);
}

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

.input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

.input-group input[type="text"]:disabled {
    background-color: #21262d;
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

/* JSONEditor Theme Overrides */
.jsoneditor {
    background-color: var(--surface) !important;
    border: none !important;
    border-radius: 0 !important;
}

.jsoneditor-menu {
    background-color: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
}

.jsoneditor-tree,
.jsoneditor-code {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.ace-jsoneditor {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.ace-jsoneditor .ace_gutter {
    background-color: var(--surface) !important;
    color: var(--text-muted) !important;
    border-right: 1px solid var(--border) !important;
}

.ace-jsoneditor .ace_content {
    background-color: var(--surface) !important;
}

/* Make sure Ace uses theme-appropriate base colors */
[data-theme="dark"] .ace-jsoneditor,
[data-theme="dark"] .ace-jsoneditor .ace_content,
[data-theme="dark"] #origJsonContainer .ace_editor,
[data-theme="dark"] #origJsonContainer .ace_scroller,
[data-theme="dark"] .jsoneditor-code,
[data-theme="dark"] .jsoneditor-text
{ background-color: #1e1e1e !important; color: #d4d4d4 !important; }

[data-theme="light"] .ace-jsoneditor,
[data-theme="light"] .ace-jsoneditor .ace_content,
[data-theme="light"] #origJsonContainer .ace_editor,
[data-theme="light"] #origJsonContainer .ace_scroller,
[data-theme="light"] .jsoneditor-code,
[data-theme="light"] .jsoneditor-text
{ background-color: #ffffff !important; color: #24292f !important; }

/* Gutters and active line per theme */
[data-theme="dark"] #origJsonContainer .ace_gutter { background-color: #252526 !important; color: #858585 !important; border-right: 1px solid var(--border) !important; }
[data-theme="light"] #origJsonContainer .ace_gutter { background-color: #ffffff !important; color: #57606a !important; border-right: 1px solid var(--border) !important; }
[data-theme="dark"] #origJsonContainer .ace_active-line { background-color: #2d2d30 !important; }
[data-theme="light"] #origJsonContainer .ace_active-line { background-color: #f6f8fa !important; }

/* Light theme ACE editor overrides */
[data-theme="light"] .ace-jsoneditor .ace_string {
    color: #a31515 !important;
}

[data-theme="light"] .ace-jsoneditor .ace_constant.ace_numeric {
    color: #098658 !important;
}

[data-theme="light"] .ace-jsoneditor .ace_constant.ace_language {
    color: #0000ff !important;
}

[data-theme="light"] .ace-jsoneditor .ace_keyword {
    color: #0000ff !important;
}

[data-theme="light"] .ace-jsoneditor .ace_variable {
    color: #001080 !important;
}

[data-theme="light"] .ace-jsoneditor .ace_paren,
[data-theme="light"] .ace-jsoneditor .ace_punctuation {
    color: #000000 !important;
}

[data-theme="light"] .ace-jsoneditor .ace_cursor {
    color: #000000 !important;
}

[data-theme="light"] .ace-jsoneditor .ace_marker-layer .ace_selection {
    background-color: #add6ff !important;
}

[data-theme="light"] .ace-jsoneditor .ace_marker-layer .ace_active-line {
    background-color: #f0f0f0 !important;
}

/* Dark theme ACE editor overrides */
[data-theme="dark"] .ace-jsoneditor .ace_string { color: #ce9178 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_constant.ace_numeric { color: #b5cea8 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_constant.ace_language { color: #569cd6 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_keyword { color: #569cd6 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_variable { color: #9cdcfe !important; }

[data-theme="dark"] .ace-jsoneditor .ace_paren,
[data-theme="dark"] .ace-jsoneditor .ace_punctuation { color: #d4d4d4 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_cursor { color: #d4d4d4 !important; }

[data-theme="dark"] .ace-jsoneditor .ace_marker-layer .ace_selection {
    background-color: #264f78 !important;
}

[data-theme="dark"] .ace-jsoneditor .ace_marker-layer .ace_active-line { background-color: #2d2d30 !important; }

.jsoneditor-statusbar {
    background-color: var(--surface) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text) !important;
}

/* Light theme JSONEditor colors */
[data-theme="light"] .jsoneditor-tree .jsoneditor-value,
[data-theme="light"] .jsoneditor-tree .jsoneditor-string {
    color: #a31515 !important;
}

[data-theme="light"] .jsoneditor-tree .jsoneditor-property {
    color: #001080 !important;
}

[data-theme="light"] .jsoneditor-tree .jsoneditor-number {
    color: #098658 !important;
}

[data-theme="light"] .jsoneditor-tree .jsoneditor-boolean {
    color: #0000ff !important;
}

[data-theme="light"] .jsoneditor-tree .jsoneditor-null {
    color: #008000 !important;
}

/* Dark theme JSONEditor colors */
[data-theme="dark"] .jsoneditor-tree .jsoneditor-value,
[data-theme="dark"] .jsoneditor-tree .jsoneditor-string { color: #ce9178 !important; }
[data-theme="dark"] .jsoneditor-tree .jsoneditor-property { color: #9cdcfe !important; }
[data-theme="dark"] .jsoneditor-tree .jsoneditor-number { color: #b5cea8 !important; }
[data-theme="dark"] .jsoneditor-tree .jsoneditor-boolean { color: #569cd6 !important; }
[data-theme="dark"] .jsoneditor-tree .jsoneditor-null { color: #569cd6 !important; }

/* JSONEditor Menu Button Styling */
.jsoneditor-menu .jsoneditor-button {
    background-color: transparent !important;
    border: none !important;
    color: var(--text) !important;
    opacity: 0.8 !important;
    transition: opacity 0.2s ease !important;
}

.jsoneditor-menu .jsoneditor-button:hover {
    opacity: 1 !important;
    background-color: color-mix(in srgb, var(--surface) 80%, transparent) !important;
}

.jsoneditor-menu .jsoneditor-button:disabled {
    opacity: 0.3 !important;
}

/* Specific styling for undo/redo buttons */
.jsoneditor-menu .jsoneditor-undo,
.jsoneditor-menu .jsoneditor-redo {
    color: var(--text) !important;
}

/* Ensure JSONEditor toolbar icons adapt to theme */
/* The menu uses direct buttons (no .jsoneditor-button class). Target them explicitly. */
[data-theme="light"] .jsoneditor-menu > button,
[data-theme="light"] .jsoneditor-menu > .jsoneditor-modes > button {
    /* Default sprite icons are light; invert to make them dark on light background */
    filter: invert(1) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .jsoneditor-menu > button,
[data-theme="dark"] .jsoneditor-menu > .jsoneditor-modes > button {
    /* Keep original (light) icons on dark background */
    filter: none !important;
    opacity: 0.9 !important;
}

/* Also adjust search/navigation bar icons */
[data-theme="light"] .jsoneditor-search button { filter: invert(1) !important; }
[data-theme="dark"] .jsoneditor-search button { filter: none !important; }

/* Sticky Copy Button */
.sticky-button-container {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface);
    padding: 8px;
    border-top: 1px solid var(--border);
    z-index: 10;
    margin-top: 0;
}

.sticky-copy-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* About page styles */
.about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav a {
    color: var(--primary);
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: var(--surface-2);
}

nav a.active {
    font-weight: bold;
    background-color: var(--surface-2);
}

.about-content {
    flex: 1;
}

.about-content section {
    margin-bottom: 2rem;
}

.about-content h2 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-content p, .about-content li {
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.about-content ul, .about-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Site footer */
.site-footer {
    text-align: center;
    padding: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Theme toggle UI */
.theme-toggle {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    gap: 0;
    flex-shrink: 0;
    width: fit-content;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 32px;
    height: 32px;
}

.theme-btn:hover {
    color: var(--text);
    background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.theme-btn.active {
    background: var(--bg);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.theme-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Dark theme adjustments */
[data-theme="dark"] .theme-btn.active {
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}