/* MODULE: mitglieder-map – Interaktive Karte im Mitglieder-Bereich
══════════════════════════════════════════════════════════════ */

/* Leaflet global overrides (gleicher Reset wie in map.css, damit
   Polylines nicht vom globalen svg{width:20px;height:20px} zerstört werden) */
.leaflet-container svg,
.leaflet-pane svg,
.leaflet-overlay-pane svg {
  width: auto;
  height: auto;
  fill: none;
  stroke-width: initial;
}
.leaflet-overlay-pane svg path { fill: none; }

/* Section-Wrapper */
.members-map-section {
  margin: 0 0 40px;
}

.members-map-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.members-map-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.03em;
  color: var(--text);
  margin: 0;
}

.members-map-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Filter-Toolbar */
.members-map-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.members-map-filter-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 100px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
}

.members-map-filter-btn:hover {
  color: var(--text);
  border-color: rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.members-map-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Squadrats-Toggle: visuell vom exklusiven Filter abgehoben */
.members-map-filter-btn--toggle {
  margin-left: 6px;
  padding-left: 12px;
  padding-right: 12px;
  border-style: dashed;
}

.members-map-filter-btn--toggle.active {
  background: rgba(255, 107, 0, 0.12);
  border-color: #FF6B00;
  border-style: solid;
  color: #FF6B00;
}

.members-map-sq-icon {
  font-size: 12px;
  letter-spacing: -1px;
  margin-right: 2px;
}

.members-map-sq-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
  margin-left: 2px;
}

/* Karten-Container */
.members-map-wrap {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 420px;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: var(--shadow);
}

.members-map {
  width: 100%;
  height: 100%;
}

/* Status-Overlay (Loading / leere Karte) */
.members-map-status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 400;
}

.members-map-status[hidden] { display: none; }

/* Legende */
.members-map-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.members-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.members-map-legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.members-map-legend-swatch--orange  { background: #FF6B00; }
.members-map-legend-swatch--red     { background: #E53935; }
.members-map-legend-swatch--mine    { background: #16a34a; }

.members-map-legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #FF6B00;
}

.members-map-legend-line--mine { background: #16a34a; }

.members-map-legend-sq {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: rgba(255, 107, 0, 0.18);
  border: 1px solid #FF6B00;
  border-radius: 2px;
}

/* "Meine Events"-Hervorhebung: dicker grüner Stroke */
.mb-members-line-mine {
  filter: drop-shadow(0 0 4px rgba(22, 163, 74, 0.45));
}

/* Popup-Erweiterungen (Teilnehmerliste) */
.mb-members-popup {
  font-family: var(--font-body, Inter, sans-serif);
  font-size: 13px;
  line-height: 1.4;
  min-width: 200px;
}

.mb-members-popup-title {
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}

.mb-members-popup-meta {
  font-size: 11px;
  color: #6B6B80;
  margin: 0 0 8px;
}

.mb-members-popup-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.mb-members-popup-attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 4px;
}

.mb-members-popup-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.mb-members-popup-avatar-fallback {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FF6B00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid #fff;
}

.mb-members-popup-link {
  display: inline-block;
  margin-top: 6px;
  color: #FF6B00;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.mb-members-popup-link:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .members-map-wrap { height: 52vh; min-height: 340px; }
  .members-map-head { flex-direction: column; align-items: flex-start; }
  .members-map-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .members-map-wrap { height: 46vh; min-height: 300px; }
  .members-map-filter-btn { padding: 6px 12px; font-size: 12px; }
}
