/* ===================================================================
   LEAFLET MAP STYLES FOR NEXORA
   Based on ZichtOpGrond implementation
   =================================================================== */

/* ===================================================================
   Z-INDEX FIX FOR TOPROW OVERLAP
   Ensure Leaflet controls don't overlap the main navigation toprow
   =================================================================== */

/* Leaflet zoom control */
.leaflet-top.leaflet-left .leaflet-control-zoom {
    z-index: 800;
}

/* Leaflet layers control */
.leaflet-top.leaflet-right .leaflet-control-layers {
    z-index: 800;
}

/* All top Leaflet controls */
.leaflet-top {
    z-index: 800;
}

/* All bottom Leaflet controls (attribution) */
.leaflet-bottom {
    z-index: 800;
}

/* Leaflet attribution control */
.leaflet-control-attribution {
    z-index: 800;
}

/* Additional cursor styles for compatibility */
path.leaflet-interactive.pointer {
    cursor: pointer;
}

/* Crosshair cursor during measurements */
.leaflet-container.crosshair,
.leaflet-container.crosshair *,
path.leaflet-interactive.crosshair {
    cursor: crosshair !important;
}

/* Ensure crosshair is visible during measurement mode */
.leaflet-container.measuring {
    cursor: crosshair !important;
}

/* ===================================================================
   MEASUREMENT TOOLS STYLES
   =================================================================== */

/* Measurement point markers (draggable circles at corners) */
.measurement-point {
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    cursor: grab;
}

.measurement-point:hover {
    transform: scale(1.2);
}

.measurement-point:active {
    cursor: grabbing;
}

/* Distance measurement points (red) */
.measurement-point.distance {
    border: 2px solid #FF4136;
}

.measurement-point.distance:hover {
    background-color: #FF725C;
}

/* Area measurement points (blue) */
.measurement-point.area {
    border: 2px solid #007bff;
}

.measurement-point.area:hover {
    background-color: #007bff;
}

/* Measurement point marker container */
.measurement-point-marker {
    background: none !important;
    border: none !important;
}

/* Measurement label styling */
.measurement-label-text {
    padding-left: 8px;
    padding-right: 4px;
    border-radius: 4px 12px 12px 4px;
    height: 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;

    background-color: white;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Close button for measurement labels */
.measurement-close {
    width: 22px;
    height: 24px;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border-radius: 0 12px 12px 0;
    line-height: 16px;
    font-size: 14px;
    border: solid 1px #ccc;
    border-left: none;
    background-color: white;
    color: #dc3545;
    font-weight: bold;
}

.measurement-close:hover {
    background-color: #f8f8f8;
    color: #a71d2a;
}

/* ===================================================================
   STREETVIEW STYLES
   =================================================================== */

/* Streetview direction arrow */
.streetview-arrow-container {
    background: none !important;
    border: none !important;
}

.streetview-arrow {
    width: 20px;
    height: 60px;
    background-image: url('data:image/svg+xml,<svg viewBox="0 0 50 75" xmlns="http://www.w3.org/2000/svg"><path stroke="null" d="m0,74.97103l24.98655,-74.97103l24.98655,74.97103l-24.98655,-21.05263l-24.98655,21.05263z" fill="%23C1272D"/></svg>');
    background-repeat: no-repeat;
    transform-origin: center center;
}

/* Streetview panel */
.leaflet-streetview-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 400px;
    height: 300px;
    z-index: 1000;
    padding: 10px;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 2px solid #ccc;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Streetview close button */
.leaflet-streetview-close {
    position: absolute;
    bottom: calc(20px + 300px - 12px);
    left: calc(20px + 400px - 12px);
    width: 24px;
    height: 24px;
    z-index: 1001;
    text-align: center;
    line-height: 24px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: pointer;
    font-weight: bold;
    color: #333;
}

.leaflet-streetview-close:hover {
    background-color: #f8f8f8;
    color: #000;
}

/* ===================================================================
   LEAFLET POPUP CUSTOMIZATION
   =================================================================== */

.leaflet-popup-content {
    margin: 0;
}

.leaflet-popup-close-button {
    margin: 1.25rem;
    font-size: 20px;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media only screen and (max-width: 767px) {
    /* Smaller streetview on mobile */
    .leaflet-streetview-container {
        width: 300px;
        height: 225px;
        left: 10px;
        bottom: 10px;
    }

    .leaflet-streetview-close {
        bottom: calc(10px + 225px - 12px);
        left: calc(10px + 300px - 12px);
    }

    /* Smaller measurement labels */
    .measurement-label-text {
        font-size: 11px;
        height: 22px;
    }

    .measurement-close {
        height: 22px;
        width: 20px;
        font-size: 12px;
    }

    .measurement-point {
        width: 14px;
        height: 14px;
    }
}
