/**
 * MaklerRank - Leaflet Map Styles
 * Region-Style Kreise mit Punktzahl-Labels
 */

/* Map Container */
.makler-map {
    height: 450px;
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-darker);
}

.map-card .card-header {
    border-bottom: 1px solid var(--color-border);
}

/* Legende Gradient */
.map-legend-gradient {
    display: inline-block;
    width: 100px;
    height: 12px;
    background: linear-gradient(to right,
        hsl(0, 70%, 50%),      /* Rot - niedrig */
        hsl(30, 70%, 46%),     /* Orange */
        hsl(60, 70%, 42%),     /* Gelb */
        hsl(90, 70%, 38%),     /* Hellgrün */
        hsl(120, 70%, 35%)     /* Mitteldunkelgrün - hoch */
    );
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 0.25rem;
}

/* Punktzahl Labels auf der Karte */
.city-points-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 1000 !important; /* Labels immer über Polygonen */
}

/* Standard Leaflet Marker-Bilder ausblenden */
.city-points-label img {
    display: none !important;
}

.leaflet-marker-icon.city-points-label {
    background-image: none !important;
}

/* Marker-Shadow ausblenden */
.leaflet-marker-shadow {
    display: none !important;
}

.points-label-inner {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 1),
        0 0 10px rgba(0, 0, 0, 0.9),
        2px 2px 4px rgba(0, 0, 0, 0.9),
        -2px -2px 4px rgba(0, 0, 0, 0.9);
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease;
}

.city-points-label:hover .points-label-inner {
    transform: scale(1.2);
}

/* Polygon Layer Cursor */
.leaflet-interactive {
    cursor: pointer !important;
}

/* Fokus-Outline beim Draggen ausblenden */
.leaflet-interactive:focus {
    outline: none !important;
}

.leaflet-container:focus {
    outline: none !important;
}

/* Tooltip für Stadtnamen */
.city-name-tooltip {
    background: var(--color-bg-dark, #1A1A1A) !important;
    color: var(--color-text, #F5F5F5) !important;
    border: 1px solid var(--color-border, #404040) !important;
    border-radius: var(--radius, 6px) !important;
    padding: 6px 10px !important;
    font-family: 'Open Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.city-name-tooltip::before {
    border-top-color: var(--color-bg-dark, #1A1A1A) !important;
}

/* Leaflet Tooltip Arrow Override */
.leaflet-tooltip-top:before {
    border-top-color: var(--color-bg-dark, #1A1A1A) !important;
}

.leaflet-tooltip-bottom:before {
    border-bottom-color: var(--color-bg-dark, #1A1A1A) !important;
}

/* Karten-Tiles heller machen für bessere Lesbarkeit */
.leaflet-tile-pane {
    filter: brightness(2.0) contrast(1.2);
}

/* Leaflet Controls - Dark Theme Override */
.leaflet-control-zoom a {
    background: var(--color-bg-dark, #1A1A1A) !important;
    color: var(--color-text, #F5F5F5) !important;
    border-color: var(--color-border, #404040) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--color-bg-darker, #0D0D0D) !important;
}

.leaflet-control-attribution {
    background: rgba(26, 26, 26, 0.8) !important;
    color: var(--color-text-muted, #999) !important;
    font-size: 10px !important;
}

.leaflet-control-attribution a {
    color: var(--color-primary, #C4A484) !important;
}

/* Loading State */
.makler-map .loading-spinner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* No Data State */
.map-no-data {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .makler-map {
        height: 350px;
    }

    .map-legend-gradient {
        width: 60px;
    }

    .points-label-inner {
        font-size: 12px;
    }
}
