/* -----------------------------------------------------------
   1. ESTILO DEL BOTÓN DE LA HERRAMIENTA (Icono de Regla)
----------------------------------------------------------- */
.leaflet-control-measure {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important; /* Oculta la flecha fea por defecto */
    line-height: 0 !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
    background-repeat: no-repeat !important;
    background-size: 15px 15px !important; /* Tamaño equilibrado con el zoom */
    background-position: center !important;
    background-color: white !important;
    transition: all 0.2s ease !important;
    width: 30px !important; 
    height: 30px !important;
    
    /* Icono SVG de regla minimalista en gris oscuro */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.4 16.4l-14-14a2 2 0 0 0-2.8 0l-1.4 1.4a2 2 0 0 0 0 2.8l14 14a2 2 0 0 0 2.8 0l1.4-1.4a2 2 0 0 0 0-2.8z'/%3E%3Cpath d='M14 10l-2-2'/%3E%3Cpath d='M10 14l-2-2'/%3E%3Cpath d='M6 18l-2-2'/%3E%3C/svg%3E") !important;
}

.leaflet-control-measure:hover {
    background-color: #f4f4f4 !important;
}

/* -----------------------------------------------------------
   2. ESTADO ACTIVO (Cuando el usuario está midiendo)
----------------------------------------------------------- */
.leaflet-control-measure-on .leaflet-control-measure {
    /* Fondo azul muy claro y sombra interna para indicar que está presionado */
    background-color: #eef6fc !important; 
    box-shadow: inset 0 0 5px rgba(0, 112, 180, 0.2) !important;
    
    /* El ícono cambia a azul institucional para indicar que está activo */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230070b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.4 16.4l-14-14a2 2 0 0 0-2.8 0l-1.4 1.4a2 2 0 0 0 0 2.8l14 14a2 2 0 0 0 2.8 0l1.4-1.4a2 2 0 0 0 0-2.8z'/%3E%3Cpath d='M14 10l-2-2'/%3E%3Cpath d='M10 14l-2-2'/%3E%3Cpath d='M6 18l-2-2'/%3E%3C/svg%3E") !important;
}

/* -----------------------------------------------------------
   3. TOOLTIP / ETIQUETA AL MEDIR (El cuadrito con la distancia)
----------------------------------------------------------- */
.leaflet-measure-tooltip {
    font-family: "Segoe UI", Arial, sans-serif !important;
    background-color: #333333 !important; /* Fondo Dark mode */
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    
    /* ESTAS TRES LÍNEAS ARREGLAN EL TAMAÑO */
    width: auto !important;
    height: auto !important;
    white-space: nowrap !important; 
}

/* Forzar que el texto sea blanco (el JS intenta pintarlo de negro por defecto) */
.leaflet-measure-tooltip .leaflet-measure-tooltip-total {
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: bold !important;
    display: inline-block !important;
}

.leaflet-measure-tooltip .leaflet-measure-tooltip-difference {
    color: #cccccc !important; /* Gris clarito para la diferencia */
    font-size: 10px !important;
    display: inline-block !important;
    margin-left: 5px !important;
}