/* dead-drop — dark theme UI */

:root {
  --bg: #0d0f14;
  --surface: #161920;
  --surface2: #1e2230;
  --border: #2a2f3f;
  --accent: #00e5ff;
  --accent-dim: #00b8cc;
  --accent-glow: rgba(0, 229, 255, 0.15);
  --text: #e0e6ef;
  --text-muted: #6b7591;
  --success: #00e5a0;
  --error: #ff4d6a;
  --warning: #ffb830;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-decoration: none;
}

.logo span { color: var(--text); }

.tagline {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-left: auto;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Cards / sections ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ─── Dropzone ───────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.dropzone.has-image { border-style: solid; border-color: var(--accent-dim); }

.dropzone-icon {
  font-size: 2rem;
  opacity: 0.5;
}

.dropzone-text { color: var(--text-muted); font-size: 0.9rem; }
.dropzone-sub  { color: var(--text-muted); font-size: 0.78rem; }
.dropzone input[type="file"] { display: none; }

/* ─── Preview ────────────────────────────────────────────────── */
.preview-wrap {
  display: none;
  background: var(--surface2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  text-align: center;
}

.preview-wrap canvas {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ─── Form controls ──────────────────────────────────────────── */
.field { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.6rem 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea { min-height: 100px; }

/* ─── Range slider ───────────────────────────────────────────── */
.range-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}

.range-label {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
  min-width: 3.5rem;
  text-align: right;
}

/* ─── Checkboxes ─────────────────────────────────────────────── */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text);
}

input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: filter 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:hover { filter: brightness(1.12); }

.btn-primary {
  background: var(--accent);
  color: #0d0f14;
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* ─── Capacity indicator ─────────────────────────────────────── */
.capacity {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-top: 0.5rem;
}

/* ─── Status messages ────────────────────────────────────────── */
.status {
  font-size: 0.875rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  display: none;
}

.status-success { background: rgba(0,229,160,0.12); color: var(--success); border: 1px solid rgba(0,229,160,0.25); }
.status-error   { background: rgba(255,77,106,0.12); color: var(--error);   border: 1px solid rgba(255,77,106,0.25); }
.status-info    { background: rgba(0,229,255,0.08); color: var(--accent);   border: 1px solid rgba(0,229,255,0.2); }

/* ─── Decode output ──────────────────────────────────────────── */
.decode-result {
  display: none;
  margin-top: 1rem;
}

.decode-output {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

/* ─── Auto-detect results ────────────────────────────────────── */
.autodetect-result { display: none; margin-top: 1rem; }

.detect-hit {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.detect-hit:hover,
.detect-hit:focus-visible,
.detect-hit.active {
  border-color: var(--accent);
  background: var(--accent-glow);
  outline: none;
}

.detect-hit.active .detect-hit-action {
  opacity: 1;
}

.detect-hit-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.detect-hit:hover .detect-hit-action,
.detect-hit:focus-visible .detect-hit-action {
  opacity: 1;
}

/* ─── Visualizer grid ────────────────────────────────────────── */
.viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.viz-cell {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.viz-label {
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.viz-cell canvas {
  width: 100%;
  display: block;
}

/* ─── Demo section ───────────────────────────────────────────── */
.demo-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.demo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* ─── How it works ───────────────────────────────────────────── */
.how-it-works {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.how-it-works h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.how-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.how-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.how-text strong { display: block; font-size: 0.875rem; margin-bottom: 0.2rem; }
.how-text p { font-size: 0.8rem; color: var(--text-muted); }

/* ─── Select ─────────────────────────────────────────────────── */
select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.55rem 0.875rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus { border-color: var(--accent); }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.muted { color: var(--text-muted); font-size: 0.875rem; }

.channel-note {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  margin-top: 0.75rem;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  color: var(--text-muted);
  display: none;
}
.channel-note strong { color: var(--accent); }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; padding: 1rem; }
  .tagline { margin-left: 0; width: 100%; }
  .container { padding: 1.25rem 1rem; }
  .how-grid { grid-template-columns: 1fr; }
}
