/* Enhanced Map Styles with Clustering and Search
   Copyright (c) 2023-2025 Christian Werner, WERNER.Solutions <office@werner.solutions> */

/* Marker Cluster Styles */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 50%;
    font: 12px Arial, Helvetica, sans-serif;
    color: white;
    font-weight: bold;
    line-height: 30px;
}

.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.6);
}

/* Search Control Styles */
.leaflet-control-search {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    padding: 0;
}

.leaflet-control-search .search-input {
    width: 250px;
    height: 44px;
    padding: 0 12px;
    margin-bottom: 0;
    border: none;
    border-radius: 4px;
    font-size: 16px; /* >=16px prevents iOS Safari auto-zoom-on-focus */
    outline: none;
}

.leaflet-control-search .search-input:focus {
    background-color: #f8f8f8;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-top: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
}

.search-result-item {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f0f0f0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-more {
    padding: 8px 10px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.search-no-results {
    padding: 10px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

/* Popup Styles */
.grenzstein-popup {
    max-width: 300px;
}

.grenzstein-popup h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.grenzstein-popup p {
    margin: 5px 0;
    font-size: 13px;
}

.grenzstein-popup .historie {
    margin: 10px 0;
    font-size: 13px;
    line-height: 1.4;
    max-height: 200px;
    overflow-y: auto;
}

.grenzstein-popup img {
    display: block;
    margin: 10px auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Gallery Link Button */
.gallery-map-link {
    display: inline-block;
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 12px;
    margin-top: 5px;
    transition: background-color 0.3s;
}

.gallery-map-link:hover {
    background: #45a049;
}

/* Individual Map Container */
.grenzstein-single-map {
    width: 100%;
    height: 400px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .leaflet-control-search .search-input {
        width: 190px;
        font-size: 16px; /* keep >=16px even at the narrower mobile width */
    }

    .grenzstein-single-map {
        height: 300px;
    }

    /* Keep cluster bubbles at a comfortable touch size on mobile instead
       of shrinking them — smaller targets are harder to tap, not easier. */
    .marker-cluster div {
        width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 12px;
    }
}