/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Map Container */
#map {
    width: 100%;
    height: 600px;
}

/* Pin Icon Styles */
.pin-active,
.pin-inactive {
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

.pin-active {
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4));
}

/* Tropfenförmiges Popup - nur Bild */
.teardrop-popup {
    width: 280px;
    height: 280px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    background: #f0f0f0;
    border: 6px solid #1e40af;
    box-sizing: border-box;
    position: relative;
}

.teardrop-popup img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(45deg) scale(1.5);
    transform-origin: center;
}

/* Custom Popup Container */
.leaflet-popup-content-wrapper {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.leaflet-popup-tip {
    display: none !important;
}

.leaflet-popup-close-button {
    display: none !important;
}

/* Fixe Info-Box oben rechts */
.info-box-control {
    background: #e8edf5;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin: 10px;
    min-width: 280px;
    max-width: 320px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.info-box-control.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.info-box-content {
    padding: 20px;
    position: relative;
}

.info-box-placeholder {
    color: #9ca3af;
    font-size: 14px;
    text-align: center;
    padding: 20px 10px;
    font-style: italic;
}

.info-box-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    padding: 0;
}

.info-box-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.info-box-content h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e40af;
    padding-right: 30px;
}

.info-address {
    margin-bottom: 16px;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.6;
}

.info-address div {
    margin-bottom: 4px;
}

.info-features {
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.info-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-features li {
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
}

.info-features li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b5998;
    font-weight: bold;
    font-size: 16px;
}

.info-features li[data-emoji]:before {
    content: attr(data-emoji);
    font-weight: normal;
    font-size: 14px;
}

.info-features li:last-child {
    margin-bottom: 0;
}

/* Website Button in Info-Box */
.info-website-button {
    display: block;
    margin-top: 16px;
    padding: 10px 16px;
    background: #1e40af;
    color: white !important;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.info-website-button:hover {
    background: #1e3a8a;
    color: white !important;
}

/* Popup-Bild klickbar */
.popup-image-link {
    display: block;
    cursor: pointer;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.popup-image-link img {
    cursor: pointer;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(45deg) scale(1.5);
    transform-origin: center;
}

/* Legende unten links */
.map-legend {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-left: 10px;
    margin-bottom: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.legend-item img {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Zoom Controls */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom a {
    background-color: white !important;
    color: #333 !important;
    border: none !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f0f0f0 !important;
}

/* Mobile Optimierung */
@media (max-width: 768px) {
    #map {
        height: 100vh;
        height: 100dvh;
    }
    
    .info-box-control {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        margin: 10px;
        background: #dde3f0;
    }
    
    .teardrop-popup {
        width: 220px;
        height: 220px;
    }
    
    .leaflet-popup-content {
        width: 220px !important;
    }
    
    .leaflet-control-zoom {
        margin-bottom: 20px !important;
        margin-right: 10px !important;
    }
    
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out {
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 20px !important;
    }
    
    .map-legend {
        margin-bottom: 20px;
    }
}

/* Tablet Optimierung */
@media (min-width: 769px) and (max-width: 1024px) {
    #map {
        height: 70vh;
    }
}

/* Loading State */
.leaflet-container {
    background-color: #f5f5f5;
}

/* Orts- und Stadtteil-Labels */
.map-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    white-space: nowrap;
    pointer-events: none;
    font-weight: 600;
}

.map-label.city-label {
    font-size: 16px;
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 1px;
    background: #004488ff !important;
    padding: 8px 16px !important;
    border-radius: 2px;
    text-shadow: none;
}

.map-label.district-label {
    font-size: 14px;
    color: #3b4d8a;
    font-weight: 700;
    text-shadow: 0 0 3px #fff, 0 0 6px #fff;
}

@media (max-width: 768px) {
    .map-label.city-label {
        font-size: 13px;
        padding: 6px 12px !important;
    }

    .map-label.district-label {
        font-size: 11px;
    }
}

/* SVG Overlay Cursor Fix */
.leaflet-image-layer {
    cursor: inherit !important;
    pointer-events: none !important;
}

.leaflet-container {
    cursor: grab;
}

.leaflet-container.leaflet-dragging {
    cursor: grabbing;
}
