/* ============================================================
   MITGLIEDERKARTE — Leaflet-Karte + Nutzerliste
   ============================================================ */

.map_controls { display: flex; gap: 10px; margin-bottom: 15px; align-items: center; }
.map_controls input.live-search-box {
    flex: 1;
    padding: 14px 12px 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background-color: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 16px;
    box-sizing: border-box;
    transition: border 0.2s ease, background 0.2s ease;
}
.map_controls input.live-search-box::placeholder { color: #aaa; }
.map_controls button#back_button {
    padding: 8px 15px; border: none; border-radius: 5px;
    background: #3498db; color: #fff; cursor: pointer; font-weight: bold;
    transition: background 0.2s;
}
.map_controls button#back_button:hover { background: #444; }

.map_layout { display: flex; gap: 20px; flex-wrap: wrap; }
#map_wrapper { flex: 1 1 60%; min-width: 300px; height: 500px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.5); }

/* Leaflet-Kacheln vom globalen img-Reset (max-width:100%) ausnehmen,
   sonst entstehen durch minimales Verkleinern weiße Lücken zwischen den Tiles */
#map_wrapper img,
.leaflet-container img,
.leaflet-tile {
    max-width: none;
}

/* Bekannter Leaflet-Bug: Sub-Pixel-Rundungsfehler beim Kachel-Rendering
   erzeugen dünne weiße Linien zwischen den Tiles (v.a. Chrome). Der
   transparente Outline zwingt den Browser zu konsistentem Sub-Pixel-
   Snapping und schließt die Lücken, ohne das Layout zu beeinflussen. */
.leaflet-tile {
    outline: 1px solid transparent;
}

.map_userlist_container { flex: 1 1 35%; min-width: 200px; display: flex; flex-direction: column; height: 500px; }
.map_userlist_container ul#myUL {
    flex: 1; overflow-y: auto; scroll-behavior: smooth;
    margin: 0; padding: 0; list-style: none;
    scrollbar-width: none; -ms-overflow-style: none;
}
.map_userlist_container ul#myUL::-webkit-scrollbar { display: none; }
.map_userlist_container ul#myUL li {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px; margin-bottom: 3px; cursor: pointer;
    color: #fff; border-radius: 4px;
    border: 1px solid var(--border);
    background-color: rgba(30,30,40,0.6);
    box-shadow: -3px 3px 8px rgba(0,0,0,0.4), 3px 3px 8px rgba(0,0,0,0.4);
    transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(2px);
}
.map_userlist_container ul#myUL li:hover {
    background-color: rgba(50,50,70,0.8);
    box-shadow: -5px 5px 12px rgba(0,0,0,0.5), 5px 5px 12px rgba(0,0,0,0.5);
    transform: scale(1.02);
}
.map_userlist_container ul#myUL li.selected { font-weight: bold; background-color: #3498db; color: #fff; }
.map_userlist_container ul#myUL li img { width: 30px; height: 30px; border-radius: 4px; object-fit: cover; }

.pagination_buttons { display: flex; justify-content: space-between; margin-top: 5px; }
.pagination_btn {
    flex: 1; margin: 0 2px; padding: 6px 0; border: none; border-radius: 5px;
    cursor: pointer; color: #fff; font-weight: bold; transition: background 0.2s;
}
.pagination_btn.enabled       { background: #1f1f1f; }
.pagination_btn.enabled:hover { background: #444; }
.pagination_btn.disabled      { background: #555; cursor: default; color: #aaa; }

/* Popup auf der Karte */
.map-popup { display: flex; align-items: center; gap: 8px; }
.map-popup-avatar { width: 40px; height: 40px; border-radius: 4px; border: 1px solid #20222f; object-fit: cover; flex-shrink: 0; }

.map-list-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

/* Leere Liste (Suche ohne Treffer) */
.map-list-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-body);
}

/* Mobile Dropdown (ersetzt Liste unter 768px) */
.map_mobile_dropdown { display: none; margin-bottom: 15px; }

@media (max-width: 768px) {
    .map_mobile_dropdown    { display: block; }
    .map_userlist_container { display: none; }
    .map_controls            { display: none; }
    #map_wrapper             { height: 350px !important; }
}