/* Modal zur manuellen Eingabe des Nutzerstandorts (Bugfix, Gitea Issue #1):
   Anders als die übrigen Modals (css/detail.css, css/form.css,
   css/promptGenerator.css - jeweils vollflächig auf Mobile, zentriertes
   Panel ab 1024px) ist dieses Modal auf allen Breakpoints ein kompaktes,
   zentriertes Panel, da es nur zwei Eingabefelder enthält und ein
   Vollbild-Modal dafür unangemessen viel Leerraum erzeugen würde. Backdrop,
   Schließen-Button und Grundstruktur folgen trotzdem demselben Muster wie
   die übrigen Modals. Das Eingabeformular selbst nutzt bewusst dieselben
   Klassen wie das Ausflugsziel-Formular (.form-field, ...) aus css/form.css
   statt sie zu duplizieren. Struktur wird von js/ui/manualLocation.js in
   #manual-location-modal eingehängt. */

.manual-location-modal {
  position: fixed;
  inset: 0;
  z-index: 2300;
}

.manual-location-modal[hidden] {
  display: none;
}

.manual-location-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.manual-location-modal__panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* Seit der Ortssuche etwas breiter: Feld und Suchknopf stehen in einer
     Zeile, und Treffer wie "Bahnhofstraße 1, Ingolstadt, Bayern" sollen nicht
     dreizeilig umbrechen. */
  width: min(420px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  padding-top: calc(var(--space-lg) + 36px);
}

.manual-location-modal__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  z-index: 1;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.manual-location-form__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.manual-location-form__intro {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: var(--space-md);
}

.manual-location-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Ortssuche ---------------------------------------------------------
   Feld und Knopf in einer Zeile, darunter Rückmeldung und Treffer. Dieselbe
   Anordnung wie im Einbettungs-Baukasten (css/help.css -> embed-guide), nur
   auf die Breite des Modals gebracht. */

.manual-location-form__search {
  display: flex;
  gap: var(--space-sm);
}

.manual-location-form__search input {
  /* min-width: 0 ist Pflicht: Ein Eingabefeld bringt eine Standardbreite mit
     und schöbe den Knopf sonst aus dem schmalen Modal heraus. */
  flex: 1;
  min-width: 0;
}

.manual-location-form__search .btn {
  flex-shrink: 0;
}

.manual-location-form__status {
  margin-top: var(--space-xs);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.manual-location-form__status:empty {
  display: none;
}

.manual-location-form__status--warn {
  color: var(--color-danger);
}

.manual-location-form__results {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.manual-location-form__result {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

.manual-location-form__result:hover,
.manual-location-form__result:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

/* Der seltene Weg, deshalb eingeklappt und unaufdringlich. */
.manual-location-form__coords > summary {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.manual-location-form__coords[open] > summary {
  margin-bottom: var(--space-sm);
}

.manual-location-form__coords .form-field + .form-field {
  margin-top: var(--space-sm);
}

.manual-location-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
}
