/* nullphase dark theme for HTTP Graph Viewer */

:root {
  --bg-page: #0d1117;
  --bg-card: #161b22;
  --bg-input: #1c2129;
  --bg-hover: #1f2937;
  --border: #30363d;
  --border-focus: #3b82f6;
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted: #6b7280;
  --blue: #3b82f6;
  --blue-hover: #2563eb;
  --green: #10b981;
  --red: #ef4444;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

#sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg-card);
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
}

#sidebar h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

#sidebar h2 {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

section { display: flex; flex-direction: column; gap: 6px; }

.hint {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.hint a, #sidebar a {
  color: var(--blue);
  text-decoration: none;
}

.hint a:hover, #sidebar a:hover {
  text-decoration: underline;
}

.hidden { display: none !important; }

/* File input / buttons */
.file-btn {
  display: inline-block;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.15s;
}
.file-btn:hover { background: var(--blue-hover); }
.file-btn input { display: none; }

/* Live connection */
#live-status {
  font-size: 11px;
  margin-top: 2px;
}
#live-status.connected { color: var(--green); }
#live-status.error { color: var(--red); }
#live-status.disconnected { color: var(--text-muted); }

button {
  padding: 6px 10px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.15s;
}
button:hover { background: var(--bg-hover); }
button.active { background: var(--blue); border-color: var(--blue); }

.btn-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* FA2 settings */
#fa2-settings { margin-top: 6px; }
.setting-row { margin-bottom: 4px; }
.setting-row label { font-size: 11px; display: flex; justify-content: space-between; color: var(--text-secondary); }
.setting-row label span { color: var(--blue); font-variant-numeric: tabular-nums; min-width: 3em; text-align: right; }
.setting-row input[type="range"] { width: 100%; margin-top: 1px; }
.setting-checks { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; }
.setting-checks label { font-size: 11px; cursor: pointer; color: var(--text-secondary); }
.fa2-mode-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* Inputs */
input[type="text"] {
  padding: 6px 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--border-focus); }

input[type="range"] { width: 100%; accent-color: var(--blue); }
input[type="checkbox"] { accent-color: var(--blue); }

/* Type & domain filter checkboxes */
#type-filters, #domain-filters {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 160px;
  overflow-y: auto;
}

#type-filters label, #domain-filters label {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

#type-filters label .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

#graph-stats {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Info panel */
#info-content {
  font-size: 12px;
  line-height: 1.5;
}
#info-content .attr-key { color: var(--text-muted); }
#info-content .attr-val { color: var(--text-primary); word-break: break-all; }
#info-content .info-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
  border-bottom: 1px solid var(--bg-page);
}

/* Focus controls */
.focus-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.focus-controls label { font-size: 12px; }

/* Graph container — absolute position so sigma always gets real dimensions */
#graph-container {
  position: absolute;
  top: 0;
  left: 280px;
  right: 0;
  bottom: 0;
  background: var(--bg-page);
}

/* Tooltip */
#tooltip {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 10;
  max-width: 340px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
#tooltip .tt-label { font-weight: 600; color: var(--blue); margin-bottom: 3px; }
#tooltip .tt-row { color: var(--text-secondary); }
#tooltip .tt-key { color: var(--text-muted); }

/* Context menu */
#context-menu {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 0;
  font-size: 13px;
  z-index: 20;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
#context-menu .menu-item {
  padding: 6px 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color 0.15s;
}
#context-menu .menu-item:hover { background: var(--bg-hover); }
#context-menu .menu-label {
  padding: 4px 14px 2px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

/* Show-hidden toggle */
#show-hidden-label {
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
}
