/* ── MAP VIEW STYLES ── Salzburg AG Design Language ── */
html { font-size: 62.5%; }

.map-view { height: 100%; font-family: 'Noto Sans', Verdana, sans-serif; overflow: hidden; }

/* Header */
.map-view .mv-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 60px; background: #ffffff;
  border-bottom: 1px solid #eaeff2;
  box-shadow: 0 1px 0 rgba(145,163,175,0.08);
  display: flex; align-items: center; padding: 0 2.4rem; gap: 1.6rem;
}
.map-view .logo {
  display: flex; align-items: center; gap: 1rem;
  font-size: 1.5rem; font-weight: 600; letter-spacing: -0.03rem; color: #111d27;
  text-decoration: none;
}
.map-view .logo img { display: block; }
.map-view .logo-dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #269f4f, #175f2f);
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.map-view .logo span { color: #269f4f; }
.map-view .header-stats { margin-left: auto; display: flex; align-items: center; gap: 2.4rem; }
.map-view .stat-item {
  display: flex; align-items: center; gap: 0.6rem;
  font-size: 1.2rem; line-height: 1.8rem; color: #405361;
  background: #f5f7f9; border: 1px solid #eaeff2;
  border-radius: 8px; padding: 0.5rem 1.2rem;
}
.map-view .stat-item strong { font-size: 1.4rem; line-height: 2rem; font-weight: 700; color: #111d27; }

/* Sidebar */
#sidebar {
  position: fixed; left: 0; top: 60px; bottom: 0; width: 340px; z-index: 900;
  background: #ffffff; border-right: 1px solid #eaeff2;
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: 2px 0 12px rgba(145,163,175,0.08);
}
#sidebar.collapsed { transform: translateX(-340px); }
.sidebar-header { padding: 2rem 2rem 1.4rem; border-bottom: 1px solid #eaeff2; background: #ffffff; }
.sidebar-title { font-size: 1rem; line-height: 1.6rem; font-weight: 600; color: #405361; text-transform: uppercase; letter-spacing: 0.1rem; margin-bottom: 1.2rem; }
.search-wrap { position: relative; }
.search-wrap input {
  width: 100%; padding: 0.9rem 1.4rem 0.9rem 3.6rem;
  background: #f5f7f9; border: 1px solid #eaeff2;
  border-radius: 8px; color: #1a1a1a; font-size: 1.4rem; line-height: 2rem; font-family: inherit;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus { border-color: #007b8e; box-shadow: 0 0 0 3px rgba(0,123,142,0.12); background: #fff; }
.search-wrap input::placeholder { color: #466072; }
.search-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); color: #466072; font-size: 1.4rem; pointer-events: none; }

.filter-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.filter-chip {
  padding: 0.4rem 1rem; border-radius: 20px; font-size: 1rem; line-height: 1.6rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: all 0.2s; user-select: none;
}
.filter-chip.all { background: #269f4f; color: #fff; border-color: #269f4f; }
.filter-chip[data-type="BEG"] { background: #ebf4f6; color: #007b8e; border-color: #b3d7dd; }
.filter-chip[data-type="EEG_REGIONAL"] { background: #e9f5ed; color: #269f4f; border-color: #bee2ca; }
.filter-chip[data-type="EEG_LOCAL"] { background: #ecf2f8; color: #0c61ac; border-color: #b6d0e6; }
.filter-chip[data-type="GEA"] { background: #f5f2fc; color: #875cd5; border-color: #dbcef2; }
.filter-chip.active { opacity: 1; }
.filter-chip:not(.active):not(.all) { opacity: 0.38; }

#result-list { flex: 1; overflow-y: auto; padding: 0.8rem 0; }
#result-list::-webkit-scrollbar { width: 4px; }
#result-list::-webkit-scrollbar-track { background: transparent; }
#result-list::-webkit-scrollbar-thumb { background: #eaeff2; border-radius: 4px; }

.list-item {
  padding: 1.1rem 2rem; cursor: pointer;
  border-bottom: 1px solid #eaeff2;
  transition: background 0.15s;
  display: flex; align-items: flex-start; gap: 1rem;
}
.list-item:hover { background: #f5f7f9; }
.list-item.active { background: #ebf4f6; border-left: 2px solid #007b8e; padding-left: 1.8rem; }
.list-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 0.5rem; }
.list-content { flex: 1; min-width: 0; }
.list-name { font-size: 1.4rem; line-height: 2rem; font-weight: 500; color: #111d27; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: 1rem; line-height: 1.6rem; color: #91a3af; margin-top: 0.2rem; }
.no-results { padding: 3.2rem 2rem; text-align: center; color: #466072; font-size: 1.4rem; }

/* Map */
#map {
  position: fixed; left: 340px; top: 60px; right: 0; bottom: 0; z-index: 800;
  transition: left 0.3s cubic-bezier(.4,0,.2,1);
}
#map.full { left: 0; }

/* Toggle */
#toggle-btn {
  position: fixed; left: 350px; top: 80px; z-index: 950;
  width: 28px; height: 28px; border-radius: 8px;
  background: #ffffff; border: 1px solid #eaeff2;
  box-shadow: 0 1px 4px rgba(145,163,175,0.16);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: left 0.3s cubic-bezier(.4,0,.2,1), transform 0.3s;
  color: #466072; font-size: 1.4rem;
}
#toggle-btn.collapsed { left: 10px; }

/* Detail Panel */
#detail-panel {
  position: fixed; bottom: 20px; right: 20px; width: 340px;
  background: #ffffff; border: 1px solid #eaeff2; border-radius: 8px;
  padding: 1.8rem; z-index: 1100;
  box-shadow: 0 4px 8px 0 rgba(145,163,175,0.24);
  display: none; animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.detail-close {
  position: absolute; top: 1.2rem; right: 1.2rem;
  width: 22px; height: 22px; border-radius: 8px;
  background: #f5f7f9; border: 1px solid #eaeff2; cursor: pointer;
  color: #466072; font-size: 1.4rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.detail-close:hover { background: #eaeff2; }
.detail-type-badge {
  display: inline-flex; align-items: center;
  font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06rem;
  padding: 0.3rem 0.8rem; border-radius: 8px; margin-bottom: 0.8rem;
}
.detail-name { font-size: 1.6rem; line-height: 2.4rem; font-weight: 700; margin-bottom: 0.6rem; color: #1a1a1a; }
.detail-address { font-size: 1.2rem; line-height: 1.8rem; color: #466072; margin-bottom: 0.4rem; }
.detail-manager { font-size: 1rem; line-height: 1.6rem; color: #466072; margin-bottom: 1.2rem; }
.detail-manager a { color: #007b8e; text-decoration: none; }
.detail-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.8rem; }
.detail-stat {
  background: #f5f7f9; border: 1px solid #eaeff2; border-radius: 8px; padding: 1rem 0.8rem; text-align: center;
}
.detail-stat-val { font-size: 1.8rem; line-height: 2.8rem; font-weight: 700; font-family: 'Noto Sans', Verdana, sans-serif; color: #111d27; }
.detail-stat-lbl { font-size: 1rem; line-height: 1.6rem; color: #91a3af; margin-top: 0.2rem; }
.detail-footer { margin-top: 1.2rem; font-size: 1rem; line-height: 1.6rem; color: #466072; display: flex; align-items: center; gap: 0.5rem; }
.detail-join-btn {
  display: block; width: 100%; margin-top: 1.4rem; padding: 1rem;
  background: #007b8e; color: #fff; border: none; border-radius: 8px;
  font-family: inherit; font-size: 1.4rem; line-height: 2rem; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.detail-join-btn:hover { background: #015159; }

/* Leaflet overrides */
.leaflet-container { background: #f5f7f9; font-family: 'Noto Sans', Verdana, sans-serif; }
.custom-marker { position: relative; display: flex; align-items: center; justify-content: center; }
.marker-pulse {
  position: absolute; width: 100%; height: 100%; border-radius: 50%;
  animation: pulse 2.5s ease infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}
.leaflet-popup-content-wrapper {
  background: #fff; border: 1px solid #eaeff2;
  border-radius: 8px; box-shadow: 0 4px 8px 0 rgba(145,163,175,0.24); color: #1a1a1a;
}
.leaflet-popup-tip { background: #fff; }
.leaflet-popup-content { margin: 1.2rem 1.4rem; font-size: 1.2rem; line-height: 1.8rem; }

/* Legend */
#legend {
  position: fixed; bottom: 20px; left: 360px; z-index: 900;
  background: #ffffff; border: 1px solid #eaeff2;
  border-radius: 8px; padding: 1rem 1.6rem;
  display: flex; gap: 1.6rem; font-size: 1rem; line-height: 1.6rem; font-weight: 500; color: #111d27;
  box-shadow: 0 4px 8px 0 rgba(145,163,175,0.24);
  transition: left 0.3s;
}
#legend.full { left: 20px; }
.legend-item { display: flex; align-items: center; gap: 0.6rem; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

@media(max-width:768px) {
  #sidebar { width: 100%; }
  #map { left: 0; }
  #toggle-btn { display: none; }
  #legend { left: 20px; }
  .map-view .header-stats { display: none; }
}
