/* ============================================================================
   Neutral Debugger UI
   Grey-black palette • seamless fixed background • clean typography
   ========================================================================= */

* { box-sizing: border-box; }
html, body { height: 100%; }

:root {
  color-scheme: dark light;

  /* Neutral palette */
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --border: #2b2b2b;
  --fg: #f2f2f2;
  --fg-muted: #b0b0b0;
  --code: #e0e0e0;

  /* Accents (light greys) */
  --accent-1: #e6e6e6;
  --accent-2: #c0c0c0;

  /* Focus & states */
  --focus: #888;
  --error-bg: #241919;
  --error-fg: #ffdcdc;
  --error-br: #b34b4b;

  /* Shape / shadow */
  --r-card: 20px;
  --r-btn: 999px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f5f5;
    --surface: #ffffff;
    --border: #e0e0e0;
    --fg: #0b0b0b;
    --fg-muted: #555;
    --code: #222;
    --accent-1: #222;
    --accent-2: #444;
    --focus: #999;
    --error-bg: #fff1f1;
    --error-fg: #800;
    --error-br: #f99;
  }
}

/* -------------------------------------------------------------------------- */
/* Base layout                                                                */
/* -------------------------------------------------------------------------- */

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Inter, Roboto, Arial;
  color: var(--fg);
  letter-spacing: .05px;
  background-color: var(--bg);

  /* Two soft vignette gradients */
  background-image:
    radial-gradient(120vw 80vh at 20% 0%, #222 0%, transparent 60%),
    radial-gradient(90vw 70vh at 80% 110%, #1e1e1e 0%, transparent 60%);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, right bottom;
  background-size: 120vw 80vh, 90vw 70vh;

  /* Optional: fixed background for subtle parallax effect */
  background-attachment: fixed, fixed;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* -------------------------------------------------------------------------- */
/* Header                                                                     */
/* -------------------------------------------------------------------------- */

header { margin: 2rem 0 1rem; }

h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--accent-1);
}

.subtle { color: var(--fg-muted); margin: 0; }

/* -------------------------------------------------------------------------- */
/* Cards / panels                                                             */
/* -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

/* -------------------------------------------------------------------------- */
/* Inputs                                                                     */
/* -------------------------------------------------------------------------- */

label {
  display: block;
  font-weight: 600;
  margin: .55rem 0 .35rem;
}

textarea, input[type="text"] {
  width: 100%;
  border-radius: 12px;
  padding: .8rem .9rem;
  border: 1px solid var(--border);
  background: #141414;
  color: var(--fg);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

textarea {
  min-height: 160px;
  resize: vertical;
  white-space: pre;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(150,150,150,.25);
  background: #161616;
}

/* -------------------------------------------------------------------------- */
/* Layout helpers                                                             */
/* -------------------------------------------------------------------------- */

.row {
  display: flex;
  gap: .9rem;
  align-items: flex-end;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.col { flex: 1 1 260px; }
.checkbox { display: flex; gap: .55rem; align-items: center; user-select: none; }
.checkbox input { width: auto; }

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

button {
  appearance: none;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #2b2b2b, #1f1f1f);
  color: var(--fg);
  padding: .7rem 1rem;
  border-radius: var(--r-btn);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #333, #252525);
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}

button:active { transform: translateY(0); }

button.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

button.ghost:hover {
  background: rgba(255,255,255,.05);
  box-shadow: none;
}

/* -------------------------------------------------------------------------- */
/* Outputs                                                                    */
/* -------------------------------------------------------------------------- */

.output {
  margin-top: 1rem;
  display: grid;
  gap: .9rem;
}

.output-block {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #161616;
}

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem .85rem;
  background: #1c1c1c;
  border-bottom: 1px solid var(--border);
  color: var(--fg-muted);
}

.copy {
  font-size: .9rem;
  padding: .45rem .7rem;
  border-radius: 6px;
  background: #232323;
  border: 1px solid #2e2e2e;
  cursor: pointer;
}
.copy:hover {
  background: #2c2c2c;
  border-color: #3a3a3a;
}

.codeblock {
  margin: 0;
  padding: .9rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: #141414;
  color: var(--code);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .95rem;
}

/* -------------------------------------------------------------------------- */
/* Error                                                                      */
/* -------------------------------------------------------------------------- */

.error {
  margin-top: .8rem;
  border: 1px solid var(--error-br);
  background: var(--error-bg);
  color: var(--error-fg);
  padding: .65rem .8rem;
  border-radius: 10px;
  font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                     */
/* -------------------------------------------------------------------------- */

footer {
  margin-top: 2rem;
  color: var(--fg-muted);
  font-size: .9rem;
  text-align: center;
}

/* -------------------------------------------------------------------------- */
/* UUID field                                                                 */
/* -------------------------------------------------------------------------- */

#uuidValue {
  background: #141414;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  font-size: .95rem;
  color: var(--fg);
  border: 1px solid var(--border);
}
