/* Reset and Control Button Styles */
.leaflet-control-reset,
.leaflet-control-basemaps {
    width: 40px;
    height: 40px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: white;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: #333;
}

.leaflet-control-reset:hover,
.leaflet-control-basemaps:hover {
    background-color: #f8f9fa;
    border-color: #0b6efd;
    color: #0b6efd;
    box-shadow: 0 2px 8px rgba(11, 110, 253, 0.15);
}

.leaflet-control-reset:active,
.leaflet-control-basemaps:active {
    background-color: #e7f3ff;
    border-color: #0b6efd;
}

/* Hide old menu toggle buttons */
.leaflet-control-materials-menu,
.leaflet-control-dji-menu {
    display: none;
}

/* Increase popup width - removed global override to allow specific popup widths */

/* Tooltip Styling */
.leaflet-tooltip {
    background-color: rgba(11, 110, 253, 0.95);
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(11, 110, 253, 0.95);
}

.leaflet-tooltip-bottom:before {
    border-bottom-color: rgba(11, 110, 253, 0.95);
}

/* Basemaps Menu Styles */
.basemaps-menu {
    display: none;
    position: absolute;
    top: 0;
    right: 100%;
    background-color: white;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
    margin-right: 8px;
    overflow: hidden;
}

.basemaps-menu.active {
    display: block;
}

/* Basemap Option Container Styles */
.basemap-option-container {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
}

.basemap-option-container:last-child {
    border-bottom: none;
}

.basemap-option-container:hover {
    background-color: #f8f9fa;
}

.basemap-option-container.active {
    background-color: #e7f3ff;
    border-left: 4px solid #0b6efd;
    padding-left: 11px;
}

/* Basemap Checkbox Styles */
.basemap-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #0b6efd;
    flex-shrink: 0;
}

/* Basemap Label Styles */
.basemap-label {
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    flex: 1;
    color: #333;
}

.basemap-label.active {
    font-weight: 600;
    color: #0b6efd;
}

/* Position top-right controls */
.leaflet-top.leaflet-right {
    top: 10px;
    right: 10px;
}

/* Stack controls vertically with gap */
.leaflet-top.leaflet-right .leaflet-control {
    margin: 0 0 5px 5px;
}

/* Popup image */
.popup-image{max-width:280px;max-height:300px;height:auto;display:block;margin:8px auto;border-radius:6px}
.popup-meta{font-size:0.95rem;color:#222;margin-top:6px;text-align:center}

/* Ensure Leaflet popup content centers images and text */
.leaflet-popup-content { text-align: center; }
.leaflet-popup-content img{display:block;margin:0 auto}

/* Tooltip for markers */
.marker-tooltip{
	background: rgba(11,110,253,0.95);
	color: #fff;
	border-radius: 4px;
	padding: 4px 8px;
	box-shadow: 0 1px 2px rgba(0,0,0,0.2);
	font-size: 0.85rem;
}

/* Distance Label Styling */
.distance-label {
    z-index: 500;
}

.distance-label-box {
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Area Label Styling */
.area-label {
    z-index: 600;
    pointer-events: none;
}

.area-label-box {
    background: rgba(52, 152, 219, 0.95);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 220px;
    line-height: 1.4;
}

/* Measurement Shape Styling */
.leaflet-draw-polyline,
.leaflet-draw-polygon,
.leaflet-draw-rectangle {
    color: #3498db;
}

.leaflet-draw-layer {
    stroke: #3498db;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill-opacity: 0.15;
}

.leaflet-draw-layer:hover {
    stroke: #2980b9;
    stroke-width: 4;
}

/* SVG Hatch Pattern for Polygons */
svg defs {
    display: none;
}

/* Map Container */
#map-container{
    flex:1;
    display:flex;
    transition:flex 0.3s ease;
    min-width: 0;
}
#map{flex:1}

