/* Shared layout for the "JSON editor on the left, live preview on the
   right" pages (/me/cv, /me/rubric - see docs/ui-terminal-redesign-plan.md).
   Global rather than per-page scoped CSS because both pages are the exact
   same shape; a page adds its own scoped .razor.css only for whatever is
   actually specific to it. Variables come from wwwroot/terminal-shell.css. */

.edx {
    color: var(--term-fg);
}

.edx-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.edx-title {
    font-size: 18px;
    letter-spacing: .04em;
    color: var(--term-fg-bright);
    margin: 0;
}

.edx-link {
    color: var(--term-fg-dim);
    font-size: 12px;
    text-decoration: underline;
}

.edx-link:hover {
    color: var(--term-fg-bright);
}

.edx-banner {
    padding: 6px 10px;
    border: 1px solid var(--term-line);
    margin: 8px 0;
    font-size: 13px;
}

.edx-banner.ok { color: var(--term-fg-bright); }
.edx-banner.err { color: var(--term-err); border-color: var(--term-err); }
.edx-banner.info { color: var(--term-fg-dim); }

.edx-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.edx-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.edx-btn {
    background: transparent;
    border: 1px solid var(--term-line);
    color: var(--term-fg);
    font: inherit;
    font-size: 12px;
    padding: 6px 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.edx-select {
    background: var(--term-bg);
    border: 1px solid var(--term-line);
    color: var(--term-fg-bright);
    font: inherit;
    font-size: 12px;
    padding: 5px 8px;
}

.edx-select option {
    background: var(--term-bg);
    color: var(--term-fg-bright);
}

/* Text/email/textarea fields - same look as .edx-select, block width, for a
   real form embedded in an otherwise text-document page (ContactRequestPanel). */
.edx-input {
    display: block;
    width: 100%;
    background: var(--term-bg);
    border: 1px solid var(--term-line);
    color: var(--term-fg-bright);
    font: inherit;
    font-size: 13px;
    padding: 6px 8px;
}

.edx-input::placeholder {
    color: var(--term-fg-dim);
}

.edx-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.edx-field .validation-message {
    color: var(--term-err);
    font-size: 12px;
}

.edx-btn:hover {
    border-color: var(--term-fg-bright);
    color: var(--term-fg-bright);
}

.edx-btn.primary {
    border-color: var(--term-accent);
    color: var(--term-accent);
}

/* Irreversible actions only (delete forever) - the one colour on these
   screens that means "this cannot be undone". */
.edx-btn.danger {
    border-color: var(--term-err);
    color: var(--term-err);
}

.edx-btn:disabled {
    opacity: .5;
    cursor: default;
}

.edx-btn-label {
    color: var(--term-fg-dim);
    font-size: 12px;
    margin-right: 2px;
}

.edx-columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 900px) {
    .edx-columns {
        grid-template-columns: 1fr 1fr;
    }
}

.edx-col {
    min-width: 0;
}

.edx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.edx-hint {
    color: var(--term-fg-dim);
    font-size: 12px;
    margin-top: 6px;
}

/* The preview side renders CvMarkdown/MarkdownConsole. Transparent, not a
   light card: dark-modernist.css (--color-bg: #1a1614, --color-text:
   #faf6ef) is itself already a dark theme, so this already reads fine
   against the terminal shell's own dark background - a forced light card
   was an unneeded assumption, not something it actually needs. Also used,
   without the fixed height, to group the same content on the public
   /cv/{slug} page - see CvPage.razor. */
.edx-card {
    border: 1px solid var(--term-line);
    padding: 14px;
    background: transparent;
}

.edx-preview {
    height: 60vh;
    overflow-y: auto;
}

/* JsonEditor's CodeMirror instance ships with the "dracula" theme, a
   different shade of dark than the terminal shell - side by side with
   .edx-preview it read as an unwanted colored box, not part of the same
   page. Override its background/gutter/cursor/scrollbar to the same
   --term-* palette instead of switching client-side themes; dracula's own
   syntax-highlight token colors are left alone, they read fine on any dark
   background. dark-modernist.css's .json-editor border (--color-divider) is
   a light-theme color, so it's overridden here too. */
.json-editor {
    border: 1px solid var(--term-line);
    border-radius: 0;
    background: var(--term-bg);
    overflow: hidden;
}

.json-editor .CodeMirror {
    height: 100%;
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--term-bg);
    color: var(--term-fg-bright);
}

.json-editor .CodeMirror-gutters {
    background: var(--term-bg);
    border-right: 1px solid var(--term-line);
}

.json-editor .CodeMirror-linenumber {
    color: var(--term-fg-dim);
}

.json-editor .CodeMirror-cursor {
    border-left-color: var(--term-fg-bright);
}

.json-editor .CodeMirror-selected {
    background: color-mix(in srgb, var(--term-accent) 18%, transparent);
}

.json-editor .CodeMirror-scroll {
    scrollbar-color: #000 var(--term-bg);
}

.json-editor .CodeMirror-vscrollbar,
.json-editor .CodeMirror-hscrollbar,
.json-editor .CodeMirror-scrollbar-filler {
    background: var(--term-bg);
}

.json-editor .CodeMirror-vscrollbar::-webkit-scrollbar,
.json-editor .CodeMirror-hscrollbar::-webkit-scrollbar,
.json-editor .CodeMirror-scroll::-webkit-scrollbar {
    background: var(--term-bg);
    width: 12px;
    height: 12px;
}

.json-editor .CodeMirror-vscrollbar::-webkit-scrollbar-thumb,
.json-editor .CodeMirror-hscrollbar::-webkit-scrollbar-thumb,
.json-editor .CodeMirror-scroll::-webkit-scrollbar-thumb {
    background: #000;
    border: 2px solid var(--term-bg);
}

.edx-preview-empty {
    color: var(--term-fg-dim);
    font-size: 13px;
}

/* A plain HTML table that needs real inputs per cell (admin pages editing a
   list) - can't be a MarkdownConsole table, but should still look native to
   the shell. */
.edx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    overflow-x: auto;
    display: block;
}

.edx-table th,
.edx-table td {
    text-align: left;
    padding: 6px 10px 6px 0;
    border-bottom: 1px solid var(--term-line);
    vertical-align: middle;
}

.edx-table th {
    color: var(--term-fg-bright);
    font-weight: 700;
    white-space: nowrap;
}

.edx-checkbox {
    accent-color: var(--term-accent);
}

/* PageSuggestionBar.razor - the "next, you can also..." box driven by
   IPageSuggestions. Darker than the page around it (--term-pane-bg, the same
   shade the command bar and window chrome use - see terminal-shell.css) so
   it reads as a distinct callout rather than another line of body text, per
   direct feedback asking for a highlighted background here. A plain full
   border, same as .edx-banner's own callout box below - not a colored
   left-accent stripe, which doesn't otherwise appear anywhere in this app's
   own highlight vocabulary. */
.edx-suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin: 18px 0;
    padding: 10px 14px;
    background: var(--term-pane-bg);
    border: 1px solid var(--term-line);
    font-size: 13px;
}

.edx-suggest-label {
    color: var(--term-fg-dim);
}

.edx-suggest-link {
    color: var(--term-accent);
    text-decoration: underline;
    cursor: pointer;
}

.edx-suggest-link:hover {
    color: var(--term-fg-bright);
}

.edx-suggest-sep {
    color: var(--term-fg-dim);
}
