/* ============================================================
   ADD STOP INPUT – inline waypoint entry
   ============================================================ */

/* Container that appears when "Add a stop" is clicked */
.add-stop-panel {
  display: none;
  margin-bottom: 16px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  background: var(--color-bg);
  overflow: hidden;
  animation: addStopSlideIn 0.25s ease-out;
}

@keyframes addStopSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.add-stop-panel.is-visible {
  display: block;
}

.add-stop-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--color-bg-off);
}

.add-stop-panel-header span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-primary);
}

.add-stop-panel-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  border-radius: 4px;
  transition: all 0.2s;
  font-size: 16px;
  line-height: 1;
}
.add-stop-panel-close:hover {
  color: var(--color-error);
  background: rgba(211, 47, 47, 0.08);
}

.add-stop-panel-body {
  padding: 10px 12px 12px;
}

/* Tabs: Address / Coordinates */
.add-stop-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.add-stop-tab {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: var(--color-text-light);
  background: var(--color-bg-off);
  transition: all 0.2s;
  letter-spacing: 0.3px;
}
.add-stop-tab:first-child {
  border-right: 1px solid var(--color-border);
}
.add-stop-tab.is-active {
  background: var(--color-primary);
  color: #fff;
}
.add-stop-tab:not(.is-active):hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* Input area for address */
.add-stop-input-group {
  display: none;
}
.add-stop-input-group.is-active {
  display: block;
}

.add-stop-input-wrap {
  display: flex;
  gap: 6px;
  margin-bottom: 0;
}

.add-stop-input-wrap input {
  flex: 1;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-body);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
  min-width: 0;
}
.add-stop-input-wrap input:focus {
  border-color: var(--color-primary);
}
.add-stop-input-wrap input::placeholder {
  color: #aaa;
}

.add-stop-submit-btn {
  padding: 8px 14px;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}
.add-stop-submit-btn:hover {
  background: var(--color-primary-hover);
}
.add-stop-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Coordinate inputs */
.add-stop-coords {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.add-stop-coord-field {
  flex: 1;
  min-width: 0;
}

.add-stop-coord-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-light);
  margin-bottom: 4px;
}

.add-stop-coord-field input {
  width: 100%;
  padding: 9px 10px;
  font-size: 13px;
  font-family: var(--font-body);
  border: 2px solid var(--color-border);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
}
.add-stop-coord-field input:focus {
  border-color: var(--color-primary);
}
.add-stop-coord-field input::placeholder {
  color: #aaa;
}

/* Search results dropdown inside panel */
.add-stop-results {
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
}

.add-stop-results:empty {
  display: none;
}

.add-stop-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 12px;
  border-bottom: 1px solid var(--color-bg-off);
}
.add-stop-result-item:last-child {
  border-bottom: none;
}
.add-stop-result-item:hover {
  background: var(--color-bg-off);
}

.add-stop-result-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.add-stop-result-text {
  flex: 1;
  min-width: 0;
}
.add-stop-result-text strong {
  display: block;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.add-stop-result-text small {
  color: var(--color-text-light);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Hint text */
.add-stop-hint {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 8px;
  line-height: 1.4;
}

/* Loading spinner */
.add-stop-loading {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: var(--color-text-light);
}

/* Error message */
.add-stop-error {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.add-stop-error:empty {
  display: none;
}
