/* Frontend CSS för Interactive Map Plugin */

.interactive-map-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow:0!important;
    background: #f7f7f7!important;
}

.interactive-map-container .leaflet-container {
    background: #000 !important; /* Svart bakgrund som inte syns när bilden täcker */
    border-radius: 8px;
}

/* Dölja eventuell grå bakgrund från Leaflet */
.interactive-map-container .leaflet-layer,
.interactive-map-container .leaflet-control-container {
    background: transparent !important;
}

.interactive-map-container .leaflet-tile {
    background: transparent !important;
}

/* Kart-kontroller */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.map-controls button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.map-controls button:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.map-controls button:active {
    transform: scale(0.95);
}

/* Markers */
.interactive-map-marker {
    cursor: pointer;
    transition: all 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
}

.interactive-map-marker:hover {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4)) brightness(1.1);
    z-index: 1000;
    transform: scale(1.05);
    transform-origin: center bottom;
}

/* Popup styling */
.interactive-map-popup .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.interactive-map-popup .leaflet-popup-content {
    margin: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.interactive-map-popup .leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.marker-popup {
    text-align: center;
    min-width: 120px;
}

.marker-popup strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
    font-size: 14px;
}

.marker-popup small {
    color: #666;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 768px) {
    .map-controls {
        top: 5px;
        right: 5px;
    }
    
    .map-controls button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .interactive-map-container {
        border-radius: 4px;
    }
    
    /* Mindre markers på mobil */
    .interactive-map-marker img {
        width: 24px !important;
        height: 24px !important;
    }
}

@media (max-width: 480px) {
    .map-controls {
        gap: 3px;
    }
    
    .map-controls button {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    /* Ännu mindre markers på mycket små skärmar */
    .interactive-map-marker img {
        width: 20px !important;
        height: 20px !important;
    }
}

/* Loading state */
.interactive-map-container.loading {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading-animation 1s linear infinite;
}

@keyframes loading-animation {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

/* Touch-specific styles */
@media (hover: none) and (pointer: coarse) {
    .interactive-map-marker:hover {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        transform: none;
        z-index: auto;
    }
    
    .map-controls button:hover {
        background: rgba(255, 255, 255, 0.9);
        transform: none;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .interactive-map-marker {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Accessibility */
.map-controls button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.interactive-map-marker:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
    border-radius: 50%;
}

/* Print styles */
@media print {
    .map-controls {
        display: none;
    }
    
    .interactive-map-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}