/* UtilBin shared theme — edit here once, applies to every page. */
:root {
  --bg: #000000;
  --bg-alt: #000000;
  --panel: #120f22;
  --border: #2d2450;
  --border-bright: #5f46b9;
  --text: #efeaff;
  --muted: #aa9fd4;
  --purple-soft: #b79cff;
  --green: #7fffd4;
  --red: #ff7aa2;
  --yellow: #ffd479;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0, rgba(255,255,255,0.018) 1px, transparent 1px, transparent 28px),
    var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
code { color: var(--purple-soft); font-family: inherit; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }

/* ── Header / nav (injected from /partials/nav.html) ─────────────────── */
header { border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, 0.92); min-height: 57px; }
nav { display: flex; justify-content: flex-start; align-items: center; gap: 1.75rem; padding: 1rem 0; }
.logo { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; flex-shrink: 0; }
.logo span, .prompt { color: var(--purple-soft); }

/* Flat inline links next to the logo — desktop only */
.nav-links { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); align-items: center; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* Dropdown — mobile only (see media query below) */
.nav-dropdown { position: relative; display: none; }
.nav-dropdown summary { cursor: pointer; list-style: none; color: var(--muted); }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary:hover { color: var(--text); }
.nav-dropdown[open] summary { color: var(--text); }
.nav-dropdown .dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 0.6rem;
  background: var(--panel); border: 1px solid var(--border-bright); min-width: 170px; z-index: 20;
  display: flex; flex-direction: column; padding: 0.35rem 0;
}
.nav-dropdown .dropdown-menu a { padding: 0.5rem 0.9rem; color: var(--muted); }
.nav-dropdown .dropdown-menu a:hover,
.nav-dropdown .dropdown-menu a.active { color: var(--text); background: rgba(167,139,250,0.08); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-dropdown { display: block; }
}

/* ── Layout / terminal shell ─────────────────────────────────────────── */
main { padding: 2.25rem 0 3rem; }
.shell { width: min(980px, 100%); margin: 0 auto; }
.terminal {
  border: 1px solid var(--border-bright);
  background: linear-gradient(180deg, rgba(22,16,40,0.97), rgba(12,9,24,0.99));
  box-shadow: 0 0 0 1px rgba(139,92,246,0.12), 0 24px 80px rgba(0,0,0,0.45);
}
.terminal-top { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--border); padding: 0.8rem 1rem; color: var(--muted); font-size: 0.84rem; }
.terminal-body { padding: 1.15rem; }

h1 { margin: 0 0 0.5rem; font-size: clamp(1.7rem, 4vw, 2.5rem); letter-spacing: -0.04em; }
.sub { color: var(--muted); line-height: 1.7; margin: 0 0 1.2rem; }

/* ── Form controls ───────────────────────────────────────────────────── */
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: 0.45rem; color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field select, textarea {
  width: 100%; background: rgba(8, 6, 16, 0.94); color: var(--text);
  border: 1px solid var(--border); border-radius: 0; padding: 0.85rem 0.9rem; font: inherit; outline: none;
}
.field input:focus, .field select:focus, textarea:focus { border-color: var(--purple-soft); box-shadow: inset 0 0 0 1px rgba(183,156,255,0.25); }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
textarea { resize: vertical; }

.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.2rem 0 1rem; }
button { border: 1px solid var(--border-bright); background: #1b1434; color: var(--text); padding: 0.85rem 1rem; font: inherit; cursor: pointer; border-radius: 0; }
button:hover { border-color: var(--purple-soft); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.5; cursor: default; }

/* ── Shared components ────────────────────────────────────────────────── */
.mode-toggle { display: flex; gap: 0; border: 1px solid var(--border); width: fit-content; margin-bottom: 1.2rem; flex-wrap: wrap; }
.mode-toggle button { border: 0; background: transparent; color: var(--muted); padding: 0.6rem 1rem; font-size: 0.86rem; }
.mode-toggle button:hover { border-color: transparent; color: var(--text); }
.mode-toggle button + button { border-left: 1px solid var(--border); }
.mode-toggle button.active { background: var(--panel); color: var(--purple-soft); }

.panel { border: 1px solid var(--border); background: rgba(8, 6, 16, 0.94); }
.panel-head { border-bottom: 1px solid var(--border); padding: 0.7rem 0.85rem; color: var(--muted); font-size: 0.82rem; }
.panel-body { padding: 0.95rem 0.9rem; }

.output-wrap { border: 1px solid var(--border); background: rgba(8, 6, 16, 0.94); margin-top: 0.9rem; }
.output-head { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--border); padding: 0.7rem 0.85rem; color: var(--muted); font-size: 0.82rem; }
.output-label { color: var(--purple-soft); }
.output-row { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.output-row:last-child { border-bottom: 0; }
.output-row input { flex: 1; padding: 0.85rem 0.9rem; border: 0; background: transparent; color: var(--green); font: inherit; outline: none; }
.output-row button { border: 0; border-left: 1px solid var(--border); background: transparent; min-width: 90px; }
.output-row button.copied { color: var(--green); }

.result-item { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.result-item:last-child { border-bottom: 0; }
.result-item span:first-child { color: var(--muted); flex-shrink: 0; }
.result-item span:last-child { color: var(--green); text-align: right; word-break: break-all; }
.result-item.warn span:last-child { color: var(--red); }
.result-item.ok span:last-child { color: var(--green); }

.error { color: var(--red); min-height: 1.2rem; margin: 0.4rem 0 0.8rem; font-size: 0.9rem; }
.note { color: var(--muted); line-height: 1.7; margin-top: 1rem; font-size: 0.9rem; }
footer { color: var(--muted); line-height: 1.7; width: min(980px, 100%); margin: 1rem auto 0; font-size: 0.84rem; }
.help { color: var(--muted); font-size: 0.85rem; line-height: 1.7; margin-top: 0.9rem; }

@media (max-width: 640px) {
  nav { align-items: flex-start; flex-direction: column; }
  .nav-dropdown .dropdown-menu { position: static; border: 0; padding: 0.3rem 0 0; margin-top: 0.4rem; }
}
