/* Route planner: top-of-screen collapsible dropdown.
 *
 * When the user activates the route button, a slim bar slides into the
 * top of the viewport showing a one-line summary (waypoint count +
 * total distance + any error). Clicking the bar expands a panel with
 * the profile picker, waypoint inspector, and Save / Clear actions.
 * Same magenta accent as the route line so it's visually tied to the
 * overlay it controls. */

.tme-route-bar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  width: min(680px, calc(100vw - 140px));
  background: rgba(20, 20, 22, 0.96);
  color: #eee;
  border: 1px solid rgba(255, 0, 200, 0.45);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font: 13px/1.4 system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

/* Header row — always visible. Click toggles expansion. */
.tme-route-bar-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
}
.tme-route-bar-head:hover {
  background: rgba(255, 0, 200, 0.06);
}

.tme-route-bar-icon {
  font-family: "Material Symbols Outlined";
  font-size: 22px;
  color: #ff00c8;
  line-height: 1;
  flex: 0 0 auto;
}

.tme-route-bar-title {
  font-weight: 600;
  font-size: 14px;
  flex: 0 0 auto;
}

.tme-route-bar-summary {
  flex: 1;
  color: #cfcfcf;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tme-route-bar-summary.error {
  color: #ffb4b4;
}

.tme-route-bar-caret {
  font-family: "Material Symbols Outlined";
  font-size: 22px;
  color: #888;
  flex: 0 0 auto;
  transition: transform 0.18s;
}
.tme-route-bar.open .tme-route-bar-caret {
  transform: rotate(180deg);
}

/* Body — expanded contents. */
.tme-route-bar-body {
  display: none;
  padding: 4px 14px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tme-route-bar.open .tme-route-bar-body {
  display: block;
}

.tme-route-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.tme-route-row .label {
  flex: 0 0 70px;
  color: #aaa;
  font-size: 12px;
}
.tme-route-row select,
.tme-route-row input[type="text"] {
  flex: 1;
  background: #1a1a1c;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  cursor: pointer;
}
.tme-route-row select:focus { outline: none; border-color: #ff00c8; }

.tme-route-profile-help {
  font-size: 11px;
  color: #888;
  margin: 2px 0 0 80px;
  line-height: 1.35;
}

.tme-route-waypoints {
  max-height: 220px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  margin-top: 4px;
}
.tme-route-waypoints:empty::before {
  content: "Click the map to drop waypoints. Click a pin (or row here) to remove it.";
  display: block;
  padding: 12px;
  color: #888;
  font-size: 12px;
}
.tme-route-wp {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.tme-route-wp:last-child { border-bottom: 0; }
.tme-route-wp:hover { background: rgba(255, 0, 200, 0.08); }
.tme-route-wp .num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff00c8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.tme-route-wp .ll {
  flex: 1;
  font: 11px/1.3 ui-monospace, monospace;
  color: #cfcfcf;
}
.tme-route-wp .seg {
  flex: 0 0 auto;
  font-size: 11px;
  color: #aaa;
}
.tme-route-wp .seg.failed { color: #ff8b8b; }
.tme-route-wp .remove {
  flex: 0 0 auto;
  color: #888;
  font-family: "Material Symbols Outlined";
  font-size: 18px;
  line-height: 1;
}
.tme-route-wp:hover .remove { color: #ff5252; }

.tme-route-errors {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(180, 30, 30, 0.18);
  border: 1px solid rgba(255, 90, 90, 0.45);
  border-radius: 6px;
  color: #ffd3d3;
  font-size: 12px;
}
.tme-route-errors:empty { display: none; }
.tme-route-errors .err + .err { margin-top: 4px; }

.tme-route-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.tme-route-actions .grow { flex: 1; }
.tme-route-btn {
  background: #2a2a2c;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.tme-route-btn:hover { background: #3a3a3c; }
.tme-route-btn.primary {
  background: #ff00c8;
  color: #fff;
  border-color: #ff00c8;
}
.tme-route-btn.primary:hover { background: #ff33d4; }
.tme-route-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Active state on the route map button: magenta accent rather than
 * the default blue used by other map buttons. */
.tme-map-button.tme-route-button.active {
  background: #ff00c8;
  border-color: #ff00c8;
  color: #fff;
}
.tme-map-button.tme-route-button.active:hover {
  background: #ff33d4;
}
