﻿/*
 * Dark theme for JSONEditor - v5 (Fix for Search Highlight Contrast)
 * This theme uses MudBlazor CSS variables for perfect theme integration.
 */

div.jsoneditor-dark,
div.jsoneditor-dark .jsoneditor-menu {
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    border-color: var(--mud-palette-lines-default);
}

    div.jsoneditor-dark div.jsoneditor-frame {
        background: var(--mud-palette-surface) !important;
        border: 1px solid var(--mud-palette-lines-default) !important;
        border-radius: 4px;
    }

    div.jsoneditor-dark .jsoneditor-tree,
    div.jsoneditor-dark .jsoneditor-preview {
        background-color: var(--mud-palette-background-gray);
    }

    div.jsoneditor-dark td,
    div.jsoneditor-dark th,
    div.jsoneditor-dark tr {
        border-color: var(--mud-palette-lines-default);
    }

    div.jsoneditor-dark div.jsoneditor-field,
    div.jsoneditor-dark div.jsoneditor-value,
    div.jsoneditor-dark div.jsoneditor-readonly {
        color: var(--mud-palette-text-primary);
    }

        div.jsoneditor-dark div.jsoneditor-value.jsoneditor-string {
            color: #90ee90;
        }

        div.jsoneditor-dark div.jsoneditor-value.jsoneditor-number {
            color: #add8e6;
        }

        div.jsoneditor-dark div.jsoneditor-value.jsoneditor-boolean {
            color: #ffb6c1;
        }

        div.jsoneditor-dark div.jsoneditor-value.jsoneditor-null {
            color: #d3d3d3;
        }

    div.jsoneditor-dark .jsoneditor-selected {
        background-color: rgba(var(--mud-palette-primary-rgb), 0.2) !important;
    }

    div.jsoneditor-dark button,
    div.jsoneditor-dark .jsoneditor-menu button,
    div.jsoneditor-dark .jsoneditor-search button,
    div.jsoneditor-dark .jsoneditor-search input,
    div.jsoneditor-dark .jsoneditor-search input:focus,
    div.jsoneditor-dark .jsoneditor-search input:active {
        background-color: var(--mud-palette-background-gray) !important;
        color: var(--mud-palette-text-secondary) !important;
        border: 1px solid var(--mud-palette-lines-inputs) !important;
        outline: none !important;
        box-shadow: none !important;
    }

        div.jsoneditor-dark button:hover,
        div.jsoneditor-dark .jsoneditor-search input:focus {
            border-color: var(--mud-palette-primary) !important;
        }

        div.jsoneditor-dark .jsoneditor-search input::placeholder {
            color: var(--mud-palette-text-disabled) !important;
        }

    div.jsoneditor-dark .jsoneditor-contextmenu {
        background: var(--mud-palette-surface);
        border-color: var(--mud-palette-lines-default);
    }

    /* --- FINAL FIX FOR SEARCH HIGHLIGHT CONTRAST --- */
    /* This rule targets the highlighted search results specifically */
    div.jsoneditor-dark .jsoneditor-highlight {
        color: var(--mud-palette-black) !important; /* Force dark text on the yellow background */
        background-color: #ffc107; /* A pleasant, less harsh yellow */
        border-radius: 3px;
    }
