/*estilos para el control de capas*/
/* Estilo general para la sección principal */
.leaflet-control-layers-list {
    font-family: Arial, sans-serif; /* Fuente básica */
    background-color: #f9f9f9; /* Fondo claro */
    border: 1px solid #ccc; /* Borde gris claro */
    border-radius: 8px; /* Esquinas redondeadas */
    padding: 10px; /* Espaciado interno */
    max-width: 300px; /* Ancho máximo */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Sombra suave */
    overflow: auto; /* Scroll automático si el contenido excede el tamaño */
  }

/* Div que contiene las capas base */
  .leaflet-control-layers-base {
    margin-bottom: 10px; /* Margen inferior */
  }
  
  /* Estilo para el separador */
  .leaflet-control-layers-separator {
    height: 1px; /* Línea separadora */
    background-color: #e0e0e0; /* Color de fondo del separador */
    margin: 10px 0; /* Margen superior e inferior */
  }
  
  /* Div que contiene las superposiciones */
  .leaflet-control-layers-overlays {
    margin-top: 10px; /* Margen superior */
  }
  
  /* Estilo para el label que contiene el checkbox y el texto */
  .leaflet-control-layers-overlays label {
    display: flex !important;
    align-items: center;
    padding: 5px;
    margin: 0;
  }
  
  /* Ocultar los indicadores de color */
  .layer-color-indicator {
    display: none !important;
  }

  /* Mostrar el texto de las capas */
  .leaflet-control-layers-overlays label span {
    display: inline-block !important;
    font-size: 14px; /* Tamaño de fuente */
    color: #333; /* Color del texto */
    margin-left: 8px;
  }
  
  /* Estilo para el checkbox */
  .leaflet-control-layers-selector {
    margin-right: 8px; /* Separación entre el checkbox y el texto */
    vertical-align: middle; /* Alinear el checkbox con el texto */
  }
  
  /* Efecto hover para el label */
  .leaflet-control-layers-overlays label:hover {
    background-color: #e6e6e6; /* Fondo gris claro al pasar el cursor */
  }
  
  /* Efecto para cuando el checkbox está activo */
  .leaflet-control-layers-selector:checked + span {
    font-weight: bold; /* Negrita para el texto cuando está seleccionado */
  }

  .leaflet-control-layers-expanded {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  }

  /* Estilo para los grupos de capas */
  .layer-group-title {
    font-weight: bold;
    margin: 10px 0 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: #333;
  }
  
  /* Ajustes para pantallas pequeñas */
  @media (max-width: 600px) {
    .leaflet-control-layers-list {
      max-width: 100%; /* Hacer que la sección ocupe todo el ancho disponible */
      font-size: 12px; /* Reducir el tamaño de la fuente en pantallas pequeñas */
    }
  }
  
  /* Contenedor de los controles superiores */

#nm-top-controls {
    position: absolute;
    top: 10px; /* Ajusta según sea necesario */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
}

/* Estilos para los botones */
.nm-control-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    margin: 0 5px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.nm-control-button:hover {
    background-color: #f0f0f0;
}

.nm-control-button i {
    font-size: 18px;
    color: #333;
}

/* Estilos para el buscador */

.nm-search-container {
    display: flex;
    align-items: center;
}

.nm-search-input {
    position: absolute;
    top: 50px; /* Ajusta según sea necesario */
    left: 40%;
    margin-left: 5px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 150px; /* Ajusta el ancho según tus necesidades */
}

.nm-search-input:focus {
    outline: none;
    border-color: #aaa;
}


/* Estilos para el panel de filtros flotante */
/* Estilos para el panel de filtros */
.nm-filters-container {
  position: relative;
  background: transparent;
  padding: 0;
  box-shadow: none;
  z-index: 1000;
}

.nm-filters-toggle {
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
  cursor: pointer;
  margin: 10px;
  z-index: 998;
}

/* Estilos para el panel de filtros */
.nm-filters-panel {
  position: absolute;
  left: 50px;
  top: 10px;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
  width: 280px;
  max-height: 60vh; /* Altura máxima del 80% del viewport */
  overflow-y: auto; /* Habilita el scroll vertical */
  z-index: 9999;
}

/* Estilos para el scroll */
.nm-filters-panel::-webkit-scrollbar {
  width: 8px;
}

.nm-filters-panel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.nm-filters-panel::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

.nm-filters-panel::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.nm-filters-panel.collapsed {
  display: none;
}

.nm-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.nm-filters-title {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
}

.nm-close-filters {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0 5px;
}

.nm-filter-group {
  margin-bottom: 15px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 4px;
}

.nm-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.nm-filter-button {
  padding: 5px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.nm-filter-button.active {
  background: #007bff;
  color: white;
  border-color: #b90903;
}


/* Estilos para el botón y el panel de la leyenda */
.map-legend-control {
    background-color: white;
    padding: 8px 10px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.map-legend-control:hover {
    background-color: #f4f4f4;
}

.map-legend-control:active {
    background-color: #e6e6e6;
}

.map-legend-panel {
    display: none;
    position: absolute;
    bottom: 30px;
    right: 10px;
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    z-index: 1000;
    max-width: 250px;
    max-height: 400px;
    overflow-y: auto;
}

.map-legend-panel.visible {
    display: block;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border: 1px solid #ccc;
    margin-right: 8px;
    border-radius: 3px;
}

.legend-label {
    font-size: 14px;
    color: #333;
}

/* Estilos para el nuevo botón de leyenda personalizado */
.legend-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 8px 12px;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    z-index: 99999; /* Aumentar el z-index para estar por encima de los controles de Leaflet */
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}

.legend-button:hover {
    background-color: #f4f4f4;
}

/* Estilos para el panel de leyenda */
.legend-panel {
  display: none;
  position: absolute;
  bottom: 70px; /* Posición desde abajo */
  right: 20px;
  background: white;
  padding: 15px;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 250px;
  max-height: calc(100% - 100px); /* Altura máxima adaptativa */
  overflow-y: auto;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.legend-panel.visible {
  display: block;
  transform: translateY(0);
  opacity: 1;
}


/* Ajustes para pantallas pequeñas */
@media screen and (max-width: 768px) {
  .legend-panel {
      right: 10px;
      left: 10px;
      max-width: calc(100% - 20px);
      bottom: 60px;
  }
  
  .legend-button {
      right: 10px;
      bottom: 10px;
  }
}

/* Ajustes para pantallas muy pequeñas */
@media screen and (max-height: 500px) {
  .legend-panel {
      max-height: calc(100% - 80px);
      bottom: 50px;
  }
}

.legend-group {
    margin-bottom: 15px;
}

.legend-group strong {
    display: block;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.nm-conditional-group {
    border-left: 3px solid #198754;
    margin: 15px 0;
    padding: 10px 0 10px 15px;
}

.nm-conditional-fields {
    margin-left: 20px;
    padding-top: 10px;
}

.nm-conditional-field {
    color: #666;
    font-size: 0.95em;
}
