/* Park graph editor — phase 1 of #568.
   Standalone maintainer tool, not under the app's CSP. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ---- Sidebar ---- */
#sidebar {
  width: 320px;
  min-width: 320px;
  height: 100%;
  overflow-y: auto;
  background: #f6f7f9;
  border-right: 1px solid #d7dbe0;
  padding: 14px 16px;
}

#sidebar h1 {
  font-size: 17px;
  margin: 0 0 2px;
}

#sidebar .subtitle {
  font-size: 12px;
  color: #6a7280;
  margin: 0 0 14px;
}

.panel {
  background: #fff;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.panel h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a7280;
  margin: 0 0 8px;
}

label.file-row {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}

label.file-row span {
  display: block;
  font-weight: 600;
  margin-bottom: 3px;
}

input[type="file"] {
  width: 100%;
  font-size: 11px;
}

/* ---- Mode buttons ---- */
.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.modes button {
  padding: 8px 6px;
  font-size: 12px;
  border: 1px solid #c8ced5;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.modes button:hover {
  background: #eef1f4;
}

.modes button.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.mode-indicator {
  margin-top: 8px;
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
}

.mode-indicator b {
  font-weight: 700;
}

/* ---- Stats ---- */
.stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 2px 0;
}

.stat-line .val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.warn {
  background: #fee2e2;
  color: #991b1b;
}

.issue-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  max-height: 120px;
  overflow-y: auto;
}

.issue-list li {
  padding: 2px 0;
  color: #991b1b;
  word-break: break-all;
}

.issue-list li.muted {
  color: #6a7280;
}

/* ---- Legend ---- */
.legend-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  padding: 2px 0;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  flex: none;
}

.swatch.node {
  background: #2563eb;
}

.swatch.attr-node {
  background: #f59e0b;
}

.swatch.edge {
  border-radius: 2px;
  height: 4px;
  background: #10b981;
  border: none;
}

.swatch.attraction {
  background: #ef4444;
  border-radius: 2px;
  transform: rotate(45deg);
}

.help {
  font-size: 11px;
  color: #4b5563;
  line-height: 1.5;
}

.help kbd {
  background: #eef1f4;
  border: 1px solid #c8ced5;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 10px;
}

button.primary {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: #16a34a;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

button.primary:hover {
  background: #15803d;
}

button.primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* ---- Map ---- */
#map {
  flex: 1;
  height: 100%;
}

#toast {
  position: fixed;
  bottom: 16px;
  left: 336px;
  z-index: 1000;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  background: #1f2937;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
}

#toast.error {
  background: #b91c1c;
}

/* Selected node highlight while adding an edge. */
.node-selected {
  filter: drop-shadow(0 0 4px #fff);
}

/* Route-preview result line in the stats panel. */
.route-stat {
  margin-top: 8px;
  font-size: 12px;
  color: #f97316;
  font-weight: 600;
  min-height: 1em;
}
.route-stat.warn {
  color: #ef4444;
}

/* City/village reference labels (opt-in Overpass overlay). */
.place-label {
  background: rgba(17, 24, 39, 0.82);
  color: #fde68a;
  border: none;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.place-label::before {
  display: none; /* no tooltip arrow for these labels */
}
