* {
  box-sizing: border-box;
  font-family: system-ui, sans-serif;
}

body {
  margin: 0;
}

header {
  background: #222;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

header a {
	
}

#layout {
  display: flex;
  height: 100vh;
}

#list {
  width: 400px; /* Breit genug für lange Kategorien */
  max-width: 100%;
  overflow-y: auto;
  border-right: 1px solid #ddd;
  padding: 10px;
  box-sizing: border-box;
}

#locate-icon {
  vertical-align: middle;
}

#login label {
  display:block;
  margin-top:8px
}

/* Textareas should not be too narrow */

/* --- Beginn: anmelden/style.css --- */
main {
  max-width: 700px;
  margin: 2rem auto;
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

form section {
  margin-bottom: 2rem;
}

label.required:after {
  content: " *";
  color: #e00;
}

.edit input, textarea {
  display: block;
  width: 100%;
  font-size: 1.1em;
  margin-top: 0.3em;
  margin-bottom: 1em;
  padding: 0.5em;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fafbfc;
  transition: border 0.2s;
}

input:focus, textarea:focus {
  border-color: #0077ff;
  outline: none;
}

.white-link,
.white-link:visited,
.white-link:hover,
.white-link:active {
  color: white;
}

.grey-link,
.grey-link:visited,
.grey-link:hover,
.grey-link:active {
  color: grey;
}

/* textarea-Regeln zusammengefasst */
textarea {
  min-width: 400px;
  max-width: 100%;
  min-height: 70px;
  resize: vertical;
  display: block;
  width: 100%;
  font-size: 1.1em;
  margin-top: 0.3em;
  margin-bottom: 1em;
  padding: 0.5em;
  border: 1px solid #bbb;
  border-radius: 4px;
  background: #fafbfc;
  transition: border 0.2s;
}

.hint {
  color: #666;
  font-size: 0.95em;
  margin-bottom: 0.5em;
}

.error {
  color: #e00;
  margin-top: 0.5em;
  font-size: 1em;
}

.actions {
  display: flex;
  align-items: center;
  gap: 1.5em;
}

.actions button {
  background: #0077ff;
  color: #fff;
  border: none;
  padding: 0.7em 1.5em;
  border-radius: 4px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.2s;
}

.actions button:hover {
  background: #005fcc;
}

/* --- Ende: anmelden/style.css --- */
#filters label {
  display: inline-block; /* Nebeneinander, nicht block */
  white-space: nowrap; /* Kein Zeilenumbruch */
  margin-right: 12px; /* Abstand zwischen Kategorien */
  font-size: 0.95em;
}

#map {
  flex: 1;
}

/* -------------------------------
   MOBILE HOCHFORMAT
-------------------------------- */
@media (max-width: 768px) and (orientation: portrait) {
  #layout {
    flex-direction: column;
  }

  #list {
    width: 100%;
    height: 45vh;
    border-right: none;
    border-top: 1px solid #ddd;
  }

  #map {
    height: 55vh;
  }
}

/* -------------------------------
   MOBILE QUERFORMAT
-------------------------------- */
@media (max-width: 768px) and (orientation: landscape) {
  #layout {
    flex-direction: row;
  }

  #list {
    width: 40%;
    max-width: 360px;
    height: 100vh;
    border-right: 1px solid #ddd;
  }

  #map {
    width: 60%;
    height: 100vh;
  }
}

/* Optional: bessere Scroll-Performance auf Mobile */
#list {
  -webkit-overflow-scrolling: touch;
}

.list-item {
  padding: 0.5rem;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

.list-item.active {
  background: #e6f2ff;
  border-left: 4px solid #0077ff;
}

.number {
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Adressfeld breiter machen */
#address {
  width: 100%;
  max-width: 700px; /* ca. doppelt so breit wie Standard */
}

#filters {
  padding: 0.5rem;
  border-bottom: 1px solid #ccc;
}

/* Header inside filters: label left, clear button right */
#filters .filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

#clear-filters {
  background: #f4f4f4;
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

#clear-filters:hover {
  background: #e9e9e9;
}

#categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
}

@media (max-width: 768px) {
  #layout {
    flex-direction: column;
  }

  #list {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid #ccc;
  }
}

#suggestions {
  border: 1px solid #ccc;
  background: #fff;
  position: relative;
  z-index: 1000;
}

#suggestions div {
  padding: 0.5rem;
  cursor: pointer;
}

#suggestions div:hover {
  background: #eee;
}

.gmaps-btn {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.3rem 0.5rem;

  font-size: 0.85rem;
  text-decoration: none;

  background: #1a73e8;
  color: #fff !important;
  border-radius: 4px;
}

.gmaps-btn:hover {
  background: #155ec0;
}

/* Tooltip */
.map-actions-title {
  font-weight: bold;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-icon {
  position: relative;
  cursor: help;
  font-size: 14px;
}

.tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;

  max-width: 300px; /* 🔑 Breite begrenzen */
  white-space: normal; /* 🔑 Zeilenumbruch erlauben */
  text-align: left;
  line-height: 1.4;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

/* Pfeil */
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Hover + Focus (Touch & Keyboard) */
.info-icon:hover .tooltip,
.info-icon:focus .tooltip,
.info-icon:focus-within .tooltip {
  opacity: 1;
  pointer-events: auto;
}

.locate-control {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  width: 38px;
  padding: 0;
}

.locate-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding: 0;
}

.locate-control svg {
  display: block;
  margin: 0;
}

/* Tabellenrahmen für Admin-Seiten */
table {
  border-collapse: collapse;
  width: 100%;
}
table, th, td {
  border: 1px solid #888;
}
th, td {
  padding: 6px 8px;
}
