/* JsonStat — custom styles (light theme) */

/* Section headings */
.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 0.75rem;
}

/* Two-column panel layout */
.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.panel {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.06);
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.panel-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

/* Input section — distinct background */
.input-section {
    padding: 1rem;
    border-radius: 0.75rem;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
}

.input-section .panel {
    border-color: #c7d2fe;
}

.input-section .panel-header {
    background: #e0e7ff;
    border-bottom-color: #c7d2fe;
}

/* Editor mount — ~30vh (half of output) */
.editor-mount {
    height: 30vh;
    min-height: 140px;
}

.editor-mount .CodeMirror {
    height: 100%;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
}

/* CodeMirror placeholder */
.CodeMirror-placeholder {
    color: #94a3b8 !important;
}

/* Output panes — ~60vh, read-only */
.output-pane {
    height: 60vh;
    min-height: 280px;
    overflow: auto;
    padding: 0;
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
}

.output-pane pre {
    margin: 0;
    padding: 0.75rem 1rem;
    white-space: pre;
    tab-size: 4;
}

/* Diff line highlights */
.diff-line {
    display: block;
    padding: 0 0.5rem;
    margin: 0 -0.5rem;
    min-height: 1.5em;
}

.diff-line.diff-removed {
    background-color: #fee2e2;
}

.diff-line.diff-added {
    background-color: #dcfce7;
}

.diff-line.diff-changed {
    background-color: #fef9c3;
}

.diff-line.diff-empty {
    background-color: #f1f5f9;
    min-height: 1.5em;
}

/* Word-level diff within a line */
.diff-word-added {
    background-color: #86efac;
    border-radius: 2px;
    padding: 0 1px;
}

.diff-word-removed {
    background-color: #fca5a5;
    border-radius: 2px;
    padding: 0 1px;
}

/* Error state */
.json-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1rem;
    color: #b91c1c;
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    margin: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
    line-height: 1.4;
}

.json-error svg {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
}

/* Empty output */
.output-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.875rem;
}

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
}
