/* JSON to CSV & YAML Converter — content styles.
   Prefix: --jc-  /  .jc-

   Reference point: a code editor split pane — JSON in on the left, the
   converted table/document out on the right — not a form-and-result
   calculator like this cluster's other tools. The two editor panes are a
   fixed dark "console" look in BOTH site themes (a terminal doesn't
   re-theme itself); everything around them (toolbar, tabs, buttons)
   follows the site's light/dark switch normally.

   THIS FILE STYLES THE CONTENT AREA ONLY. Chrome is owned by chrome.css. */

:root {
  --jc-surface: #ffffff;
  --jc-panel:   #eef1f0;
  --jc-line:    #d7dbd8;
  --jc-text:    #12171a;
  --jc-muted:   #5b6560;
  --jc-good:    #1f7a4d;
  --jc-bad:     #b3261e;

  /* Fixed console palette — deliberately constant across both themes. */
  --jc-console-bg:   #16201d;
  --jc-console-text: #d8e6de;
  --jc-console-dim:  #7d9186;
  --jc-console-line: #2b3a35;
}

.jc-wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.jc-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.jc-field--inline {
  display: grid;
  gap: 0.375rem;
}

.jc-field--inline label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--jc-muted);
}

.jc-field--inline select {
  padding: 0.4375rem 0.625rem;
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--jc-text);
  background: var(--jc-surface);
  border: 1px solid var(--jc-line);
  border-radius: 2px;
}

.jc-presets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.jc-preset-lbl {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--jc-muted);
}

.jc-chip {
  padding: 0.3125rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--jc-text);
  background: var(--jc-surface);
  border: 1px solid var(--jc-line);
  border-radius: 2px;
  cursor: pointer;
}

.jc-chip:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

/* ── Two-pane editor ─────────────────────────────────────────────────────── */

.jc-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 48rem) {
  .jc-panes { grid-template-columns: 1fr; }
}

.jc-pane {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--jc-line);
  border-radius: 2px;
  overflow: hidden;
  background: var(--jc-surface);
}

.jc-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--jc-panel);
  border-bottom: 1px solid var(--jc-line);
}

.jc-pane-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--jc-muted);
}

.jc-status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--jc-muted);
}

.jc-status--good { color: var(--jc-good); }
.jc-status--bad  { color: var(--jc-bad); }

.jc-editor {
  margin: 0;
  padding: 0.875rem 1rem;
  min-height: 16rem;
  max-height: 26rem;
  overflow: auto;
  resize: vertical;
  border: 0;
  outline: none;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
  background: var(--jc-console-bg);
  color: var(--jc-console-text);
}

.jc-output {
  white-space: pre-wrap;
  word-break: break-word;
}

textarea.jc-editor:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: -2px;
}

.jc-error {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--jc-bad);
  background: var(--jc-surface);
  border-top: 1px solid var(--jc-line);
}

.jc-tabs {
  display: flex;
  gap: 0.25rem;
}

.jc-tab {
  padding: 0.25rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--jc-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
}

.jc-tab--active {
  color: var(--tf-accent);
  background: var(--tf-accent-wash);
  border-color: var(--tf-accent-soft);
}

.jc-pane-actions {
  display: flex;
  gap: 0.375rem;
}

.jc-icon-btn {
  padding: 0.25rem 0.625rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--jc-text);
  background: var(--jc-surface);
  border: 1px solid var(--jc-line);
  border-radius: 2px;
  cursor: pointer;
}

.jc-icon-btn:hover {
  border-color: var(--tf-accent);
  color: var(--tf-accent);
}

/* ── Primary action button ──────────────────────────────────────────────── */

.jc-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--tf-accent-ink);
  background: var(--tf-accent);
  border: 1px solid var(--tf-accent);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 1.5rem;
}

.jc-btn:hover  { background: var(--tf-accent-hover);  border-color: var(--tf-accent-hover); }
.jc-btn:active { background: var(--tf-accent-active); border-color: var(--tf-accent-active); }

.jc-btn:focus-visible {
  outline: 2px solid var(--tf-accent);
  outline-offset: 2px;
}

/* ── Ad slots ───────────────────────────────────────────────────────────── */

.jc-ad {
  min-height: 280px;
  margin: 2rem auto 0;
  max-width: 64rem;
  padding-inline: 1.5rem;
}

@media (max-width: 26rem) {
  .jc-wrap,
  .jc-ad { padding-inline: 1rem; }
  .jc-presets { margin-left: 0; }
}

/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --jc-surface: var(--tf-surface);
  --jc-panel: var(--tf-surface);
  --jc-line: var(--tf-rule);
  --jc-text: var(--tf-ink);
  --jc-muted: var(--tf-ink-soft);
  --jc-good: #61d19a;
  --jc-bad: #da8581;
  --jc-console-bg: var(--tf-ink);
  --jc-console-text: var(--tf-rule);
  --jc-console-dim: var(--tf-ink-faint);
  --jc-console-line: var(--tf-ink);
}
