/* GeoJSON Editor Styles */

.geojson-editor-container {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.geojson-editor-container .leaflet-container {
    font-family: inherit;
    z-index: 1;
}

/* Draw toolbar styling to match SWBNO admin theme */
.geojson-editor-container .leaflet-draw-toolbar a {
    background-color: #fff;
    border: 1px solid #ccc;
}

.geojson-editor-container .leaflet-draw-toolbar a:hover {
    background-color: #e3f2fd;
    border-color: #0066CC;
}

.geojson-editor-container .leaflet-draw-actions a {
    background-color: #0066CC;
    color: #fff;
    border: none;
    font-size: 12px;
}

.geojson-editor-container .leaflet-draw-actions a:hover {
    background-color: #0052A3;
}

/* Map attribution styling */
.geojson-editor-container .leaflet-control-attribution {
    font-size: 10px;
    background-color: rgba(255, 255, 255, 0.8);
}

/* Ensure map z-index does not interfere with modals */
.geojson-editor-container .leaflet-pane {
    z-index: 1;
}

.geojson-editor-container .leaflet-top,
.geojson-editor-container .leaflet-bottom {
    z-index: 2;
}

/* Fix: MapLibre GL canvas intercepts clicks needed by Leaflet.Draw.
   The GL layer must not block pointer events on the overlay/marker panes
   where draw vertices, edit handles, and guide lines are rendered. */
.geojson-editor-container .leaflet-gl-layer {
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Leaflet.Draw edit handles (vertex drag squares) must be visible and clickable */
.geojson-editor-container .leaflet-marker-pane {
    z-index: 600 !important;
    pointer-events: auto !important;
}

.geojson-editor-container .leaflet-marker-pane .leaflet-marker-icon {
    pointer-events: auto !important;
}

/* Overlay pane (polygons, polylines) must be clickable for edit mode activation */
.geojson-editor-container .leaflet-overlay-pane {
    pointer-events: auto !important;
}

.geojson-editor-container .leaflet-overlay-pane svg,
.geojson-editor-container .leaflet-overlay-pane canvas {
    pointer-events: auto !important;
}

/* Fullscreen mode */
.geojson-editor-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    border: none;
    margin: 0;
}

.geojson-editor-fullscreen .leaflet-container {
    height: 100vh !important;
    width: 100vw !important;
    border-radius: 0 !important;
    border: none !important;
}

.geojson-fullscreen-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    width: 34px;
    height: 34px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #333;
    padding: 0;
}

.geojson-fullscreen-btn:hover {
    background: #e3f2fd;
    border-color: #0066CC;
}

.geojson-editor-fullscreen .geojson-fullscreen-btn {
    bottom: 15px;
    left: 15px;
    z-index: 10000;
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Hide body scroll when map is fullscreen */
body.geojson-fullscreen-active {
    overflow: hidden;
}

/* Textarea for raw GeoJSON */
#geojson-textarea {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    line-height: 1.4;
    tab-size: 2;
    resize: vertical;
    min-height: 80px;
}

#geojson-textarea:focus {
    border-color: #0066CC;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}
