/**
 * LohiBW Karten CSS - Final Version mit Responsive Height
 */

.lohibw-map-container {
    position: relative;
    background: #f9f9f9;
    border: 1px solid #bbbbbb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 300px; /* Mindesthöhe */
    max-height: 90vh;  /* Maximalhöhe */
}

/* Suchleiste */
.map-search-bar {
    background: #fff;
    padding: 15px;
    border-bottom: 1px solid #bbbbbb;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0; /* Verhindert Schrumpfen */
}

.map-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #bbbbbb;
    border-radius: 0;
    font-size: 16px;
    background: #fff;
    color: #333333;
    transition: border-color 0.3s ease;
}

.map-search-input:focus {
    outline: none;
    border-color: #ffee00;
    box-shadow: 0 0 0 2px rgba(255, 238, 0, 0.2);
}

.map-search-button,
.map-reset-button {
    padding: 10px 20px;
    border: 2px solid #ffee00;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.map-search-button {
    background: #ffee00;
    color: #333333;
}

.map-search-button:hover {
    background: #333333;
    color: #ffee00;
    border-color: #333333;
}

.map-reset-button {
    background: transparent;
    color: #333333;
    border-color: #bbbbbb;
}

.map-reset-button:hover {
    background: #bbbbbb;
    color: #fff;
}

/* Leaflet Map */
.lohibw-leaflet-map {
    border: none;
    flex: 1; /* Nimmt verfügbaren Platz ein */
    min-height: 250px; /* Mindesthöhe für die Karte selbst */
}

/* Popup Styles - ALLE LINKS #333333 */
.leaflet-popup-content-wrapper {
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.5;
}

.map-popup-content {
    padding: 5px;
    min-width: 280px;
    max-width: 320px;
}

.popup-title {
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #ffee00;
    font-size: 18px;
    font-weight: 600;
}

.popup-title a {
    color: #333333 !important;
    text-decoration: none;
    border-bottom: 1px dotted #bbbbbb;
    transition: border-color 0.3s ease;
}

.popup-title a:hover {
    color: #333333 !important;
    border-bottom-color: #333333;
}

.popup-address {
    margin: 12px 0;
    color: #333333;
    line-height: 1.6;
}

.popup-address strong {
    color: #333333;
    font-weight: 600;
}

.popup-contact {
    margin: 15px 0;
}

.popup-contact p {
    margin: 8px 0;
    color: #333333;
}

.popup-contact a {
    color: #333333 !important;
    text-decoration: none;
    border-bottom: 1px dotted #bbbbbb;
    transition: border-color 0.3s ease;
}

.popup-contact a:hover {
    color: #333333 !important;
    border-bottom-color: #333333;
}

/* E-Mail Styling spezifisch */
.popup-contact .lohibw-email a {
    color: #333333 !important;
    text-decoration: none;
    border-bottom: 1px dotted #bbbbbb;
}

.popup-contact .lohibw-email a:hover {
    color: #333333 !important;
    border-bottom-color: #333333;
}

.popup-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.popup-website-btn {
    display: inline-block;
    padding: 10px 15px;
    background: #ffee00;
    color: #333333 !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #ffee00;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.popup-website-btn:hover {
    background: #333333;
    color: #ffee00 !important;
    border-color: #333333;
}

.popup-badge {
    /* Entfernt - keine Auszeichnung mehr */
    display: none !important;
}

/* Marker Cluster - Gelb */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(255, 238, 0, 0.8);
    border: 2px solid #333333;
    color: #333333;
    font-weight: 600;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: rgba(255, 238, 0, 0.9);
    color: #333333;
    font-weight: 600;
}

/* Loading State */
.lohibw-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border: 2px solid #333333;
    text-align: center;
    z-index: 1000;
}

.lohibw-map-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 3px solid #bbbbbb;
    border-top-color: #333333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .lohibw-map-container {
        min-height: 250px;
        height: 60vh !important; /* Kleinere Höhe auf Tablets */
    }
    
    .map-search-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .map-search-input,
    .map-search-button,
    .map-reset-button {
        width: 100%;
    }
    
    .map-popup-content {
        min-width: 250px;
        max-width: 280px;
    }
    
    .popup-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .lohibw-map-container {
        min-height: 200px;
        height: 50vh !important; /* Noch kleinere Höhe auf Smartphones */
    }
    
    .map-search-input {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    .lohibw-leaflet-map {
        min-height: 150px;
    }
}

/* Landscape Modus auf Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .lohibw-map-container {
        height: 80vh !important; /* Mehr Platz im Landscape */
    }
}

/* Sehr große Bildschirme */
@media (min-width: 1400px) {
    .lohibw-map-container {
        max-height: 800px; /* Begrenzung auf sehr großen Screens */
    }
}