* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: sans-serif;
  background: #0F1115;
  padding: 20px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Überschrift */
h1 {
  margin-bottom: 12px;
  font-size: 1.4rem;
}

/* Äußerer Wrapper (alles außer der Überschrift) */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px; /* rechte Spalte breiter oder schmäler machen */
  gap: 20px;
  flex: 1;
  min-height: 0;
}

/* Linke Spalte */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.map-area {
  background: #1A1D22;
  border: none;
  border-radius: 8px;
  overflow: hidden; /* wichtig: verhindert, dass die Map über die abgerundeten Ecken hinausragt */
  position: relative;
  flex: 1;
  min-height: 0;
}

/* Map-Container und Map-Canvas ebenfalls runden, damit die Kachel-Ecken konsistent sind */
#map,
#map canvas,
.maplibregl-canvas,
.map-area > #map {
  border-radius: 8px;
  display: block;
}

#map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

/* Überschrift in der Karte */
.heading {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  z-index: 100;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent; /* no hard rectangle */
  position: relative;
  /* keep size limited so blur does not span full width */
  display: inline-block;
}

.heading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* slightly larger than the heading to produce a soft halo */
  width: calc(100% + 28px);
  height: calc(100% + 12px);
  border-radius: 50% / 40%;
  pointer-events: none;
  z-index: -1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* fade edges so there is no hard cut-off */
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 45%, rgba(0,0,0,0.25) 65%, rgba(0,0,0,0) 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 45%, rgba(0,0,0,0.25) 65%, rgba(0,0,0,0) 85%);
}

/* Legende */
.legend {
  position: absolute;
  bottom: 14px;
  left: 14px;
  width: 190px;
  height: auto;
  max-height: none; /* no max height so legend can expand to fit content */
  overflow-y: visible; /* show all content without scrolling */
  border: none;
  border-radius: 8px;
  background: #ffffff50;
  padding: 10px;
  /* color: #fff; */
  font-family: sans-serif;
  font-size: 0.8rem;
}

/* Empty-overlay shown when no routes are visible. Matches legend colors/border but no blur/backdrop-filter */
.empty-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(8,8,12,0.35);
  /* background: #0F1115; */
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 1003;
  max-width: 78%;
  text-align: center;
  box-shadow: none; /* no extra glow */
  font-size: 0.95rem;
    backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.empty-overlay .close-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1;
}
.empty-overlay .empty-message {
  padding: 6px 2px;
  line-height: 1.3;
}

/* Radio Buttons für Wechsel zw. Kartenart */
.mapStyle {
  appearance: none;
  border-radius: 50%;
  width: 14px;
  height: 14px;

  border: 2px solid #ffffffcb;
  transition: 0.2s all linear;
  margin-right: 5px;

  position: relative;
  top: 4px;
}

.mapStyle:checked {
  border: 5px solid rgb(255, 255, 255);
  /* background: rgb(255, 255, 255); */
}

/* Jahres-Filter */
.year-filter {
  background: #1A1D22;
  border: none;
  border-radius: 8px;
  height: 130px;
}

/* Attribution-Button */
.maplibregl-ctrl-attrib { 
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  position: static !important;
}

.maplibregl-ctrl-attrib-button {
  position: static !important;
  bottom: auto !important;
  right: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  order: 2;
}

.maplibregl-ctrl.maplibregl-ctrl-attrib {
  padding: 2px 4px 4px 10px !important;
}

.maplibregl-ctrl-attrib-inner {
  order: 1;
  padding-right: 10px;
  margin-right: 0 !important;
  text-align: right;
  font-family: sans-serif;
  font-size: 0.8rem;
}

/* Figshare-Link */
.maplibregl-ctrl-attrib-inner a[href*="figshare"],
.maplibregl-ctrl-attrib-inner a[href*="figshare"]:visited,
.maplibregl-ctrl-attrib-inner a[href*="figshare"]:hover {
  color: #000 !important;
}

/* Rechte Spalte (drei Filter-Blöcke) */
.right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 0;
}

.filter-block {
  background: #1A1D22;
  border: none;
  border-radius: 8px;
  flex: 1;
  min-height: 100px;
  /* Abstand zum Kachelrand */
  padding: 12px;
  position: relative;
  overflow: hidden;
}


/* monthFilter Style */
#monthFilter {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 12px;
}

#monthFilter .month-filter-svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

#monthFilter .connections path {
  transition: stroke-width 0.2s, opacity 0.2s;
}

#monthFilter .nodes circle {
  cursor: pointer;
  transition: r 0.2s, opacity 0.2s;
}

#monthFilter .nodes circle:hover {
  r: 10;
  opacity: 1;
}

/* Zurück-Pfeil für monthFilter */
#monthFilter .month-filter-back-arrow {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#monthFilter .month-filter-back-arrow:hover {
  opacity: 1;
}



/* Search Bar Styles */
#searchBar {
  display: flex;
  flex-direction: column;
  padding: 8px !important;
  overflow: visible !important;
}

.searchBar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  position: relative;
}

.searchBar-inputWrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.searchBar-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.2s;
  font-family: sans-serif;
}

.searchBar-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.searchBar-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.searchBar-clearBtn {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  display: none;
  line-height: 1;
}

.searchBar-clearBtn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.searchBar-suggestions {
  flex: 1;
  overflow-y: auto;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.searchBar-group {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.searchBar-group:last-child {
  border-bottom: none;
}

.searchBar-groupLabel {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(0, 0, 0, 0.2);
}

.searchBar-suggestionItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
  user-select: none;
}

.searchBar-suggestionItem:hover,
.searchBar-suggestionItem.active {
  background: rgba(255, 255, 255, 0.08);
}

.searchBar-suggestionIcon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.searchBar-suggestionText {
  flex: 1;
  min-width: 0;
}

.searchBar-suggestionTitle {
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchBar-suggestionMeta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.searchBar-noResults {
  padding: 16px 12px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* Scrollbar-Styling für Suggestions */
.searchBar-suggestions::-webkit-scrollbar {
  width: 6px;
}

.searchBar-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.searchBar-suggestions::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.searchBar-suggestions::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Verschiedene Vorschlagstypen */
.searchBar-suggestionItem.searchBar-bird {
  border-left: 3px solid #A67458;
}

.searchBar-suggestionItem.searchBar-location {
  border-left: 3px solid #a170ba;
}

.searchBar-suggestionItem.searchBar-geolocation {
  border-left: 3px solid #a170ba;
}

/* Legende soll niemals scrollen*/
.legend {
  max-height: none !important;
  overflow: visible !important;
}

/* Gleiche Typo nehmen */
.legend * {
  color: #fff !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

/* If the legend builder inserts an inner wrapper, ensure it doesn't constrain size */
.legend > div {
  max-height: none !important;
  overflow: visible !important;
}

/* Symbole in der Legende Größe ändern*/
:root {
  --legend-symbol-width: 22px;   /* width reserved for the symbol */
  --legend-symbol-font-size: 1.2rem; /* font-size for the symbol glyph */
  --legend-symbol-gap: 6px;      /* gap between symbol and label */
}

/* Legend row / symbol classes (used by mapRoutes.js) */
.legend-row {
  display: flex;
  align-items: center;
  margin-top: 0px;
}
.legend-symbol {
  display: inline-block;
  width: var(--legend-symbol-width);
  text-align: center;
  font-size: var(--legend-symbol-font-size);
  line-height: 1;
  flex: 0 0 var(--legend-symbol-width);
}
.legend-label {
  margin-left: var(--legend-symbol-gap);
}

/* Weißes Rechteck komplett verstecken wenn Panel geschlossen */
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-inner {
  display: none !important;
}

/* i-Button immer mit weißem Hintergrund */
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-button {
  background-color: rgba(255, 255, 255, 0.9) !important;
}