/* ======================================
   Reset universal y box-sizing
   ====================================== */
   *,
   *::before,
   *::after {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
   }
   
   /* ======================================
      Estilos básicos para html y body
      ====================================== */
   html, body {
     width: 100%;
     height: 100%;
     overflow: hidden; /* Evita scroll extra */
     font-family: "Montserrat";
     font-weight: 500;
     margin: 0;
     padding: 0;
     background-color: rgb(84, 0, 0);
   }
   
   /* ======================================
      Barra de navegación
      ====================================== */

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: rgb(84, 0, 0);
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        overflow: visible;
        padding: 0.5em 1em;
        color: white;
        height: auto;
        z-index: 2000;
        min-height: 60px;
        margin: 0;
        border: none;
        border-bottom: none;
      }
   
   .navbar-brand {
     display: flex;
     align-items: center;
     gap: 1em;
     text-decoration: none;
     color: inherit;}

     .navbar-nav {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      width: 100%;
      
  }
  
     .navbar-collapse {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      border-radius: 0.5em;
      padding-left: 1em;
      padding-right: 1em;

      background-color: rgb(97, 0, 0); 
  }
  
   
   .navbar-text {
     font-size: 0.7em;
     color:white;
   }
   
   .logo {
     width: 120px;
     padding-left: 1em;
   }
   
   .nav-link {
     color: #fff;
   }

   .social-icons {
    display: flex;
    gap: 20px; /* Espacio entre los iconos */
    align-items: center;
    text-align: center;
    padding-left: 1em;
}

.social-icons a {
    color: white; /* Asegura que los íconos sean visibles */
    font-size: 1.2em; /* Tamaño de los íconos */
    text-decoration: none;
}

.social-icons a:hover {
    color: hsl(0, 1%, 77%); /* Efecto hover para mejorar accesibilidad */
}



   
   /* ======================================
      Sidebar (panel lateral) y botón toggle
      ====================================== */
   .sidebar-container {
     position: fixed;
     top: 0;
     left: 0;
     width: 340px;
     height: 100vh;
     z-index: 500;
     transition: transform 0.3s ease;
     transform: translateX(0);
     overflow-y: auto;
     margin: 0;
     padding: 0;
     border: none;
   }

   /* Barra de desplazamiento personalizada */
   .sidebar-container::-webkit-scrollbar {
     width: 8px;
   }

   .sidebar-container::-webkit-scrollbar-track {
     background: rgba(255, 255, 255, 0.1);
     border-radius: 10px;
   }

   .sidebar-container::-webkit-scrollbar-thumb {
     background: rgba(108, 1, 1, 0.6);
     border-radius: 10px;
   }

   .sidebar-container::-webkit-scrollbar-thumb:hover {
     background: rgb(108, 1, 1);
   }
   
   .sidebar-container.oculto {
     transform: translateX(-340px);
   }
   
   .informacion {
     position: relative;
     width: 340px;
     min-height: 100%;
     background-color: rgba(57, 0, 0, 0.735);
     color: #fff;
     backdrop-filter: blur(5px);
   }
   
   .contenido-informacion {
     width: 95%;
     margin: 0 auto;
     padding: 20px 0;
   }
   
   .toggle-btn {
     position: fixed;
     top: 20px;
     left: 300px;
     width: 40px;
     height: 40px;
     background-color: rgb(108, 1, 1);
     border: none;
     border-radius: 0 4px 4px 0;
     cursor: pointer;
     z-index: 501;
     display: flex;
     align-items: center;
     justify-content: center;
     transition: left 0.3s ease;
   }
   
   .sidebar-container.oculto + .toggle-btn {
     left: 0;
   }
   
   .hamburger {
     width: 20px;
     height: 2px;
     background-color: #fff;
     position: relative;
   }
   
   .hamburger::before,
   .hamburger::after {
     content: "";
     position: absolute;
     left: 0;
     width: 20px;
     height: 2px;
     background-color: #fff;
   }
   
   .hamburger::before {
     top: -6px;
   }
   
   .hamburger::after {
     top: 6px;
   }
   
   /* ======================================
      Contenedor principal y mapa
      ====================================== */
   .main-container {
     position: relative;
     width: 100%;
     height: 100vh;
     margin-top: 0;
     margin-bottom: 0;
     padding: 0;
     border: none;
   }
   
   .map-container {
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     z-index: 1;
     margin: 0;
     padding: 0;
     border: none;
   }
   
   #map {
     width: 100%;
     height: 100%;
     background-color: rgb(203, 203, 203);
     margin: 0;
     padding: 0;
     border: none;
   }
   
   /* ======================================
      Formularios y sugerencias
      ====================================== */
   .form {
     text-align: center;
     padding: 1em;
   }
   
   .label_buscar_colonia {
     text-align: right;
   }
   
   .suggestions {
     position: absolute;
     width: 100%;
     background: #fff;
     border: 1px solid #ccc;
     border-radius: 5px;
     max-height: 200px;
     overflow-y: auto;
     z-index: 1000;
     box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
     display: none;
     color: #000;
   }
   
   .suggestions .suggestion-item {
     padding: 10px;
     cursor: pointer;
     transition: background-color 0.2s ease-in-out;
   }
   
   .suggestions .suggestion-item:hover {
     background-color: #f0f0f0;
   }

   /* Botón limpiar búsqueda */
   .btn-limpiar-busqueda {
     margin-top: 8px;
     padding: 6px 16px;
     background-color: #922B21;
     color: white;
     border: none;
     border-radius: 4px;
     cursor: pointer;
     font-family: 'Montserrat', sans-serif;
     font-size: 12px;
     font-weight: 500;
     transition: background-color 0.3s ease;
     width: 100%;
   }

   .btn-limpiar-busqueda:hover {
     background-color: #7a1f1a;
   }

   .btn-limpiar-busqueda:active {
     background-color: #641E16;
   }

   /* Tooltips de búsqueda (para mostrar múltiples resultados) */
   .tooltip-busqueda {
     background-color: white;
     color: #333;
     border: 2px solid #922B21;
     border-radius: 6px;
     padding: 8px 12px;
     font-family: 'Montserrat', sans-serif;
     font-size: 12px;
     font-weight: 500;
     box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
     white-space: nowrap;
     opacity: 0.95 !important;
     pointer-events: auto;
   }

   .tooltip-busqueda::before {
     border-top-color: #922B21 !important;
   }

   /* Tooltips simplificados para búsqueda de actividades (solo nombre) */
   .tooltip-busqueda-simple {
     background-color: white;
     color: #333;
     border: 2px solid #922B21;
     border-radius: 4px;
     padding: 6px 10px;
     font-family: 'Montserrat', sans-serif;
     font-size: 11px;
     font-weight: 600;
     box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
     white-space: nowrap;
     opacity: 0.95 !important;
     pointer-events: auto;
     cursor: pointer;
     margin-bottom: 15px !important;
   }

   .tooltip-busqueda-simple::before {
     border-top-color: white !important;
   }

   .tooltip-busqueda-simple:hover {
     opacity: 1 !important;
     box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
     border-color: #7a1f1a;
   }

   /* Etiquetas de colonias */
   .colonia-label {
     background-color: rgba(255, 255, 255, 0.9);
     color: #333;
     border: 1px solid #922B21;
     border-radius: 3px;
     padding: 4px 8px;
     font-family: 'Montserrat', sans-serif;
     font-size: 10px;
     font-weight: 600;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
     white-space: nowrap;
     pointer-events: none;
   }

   .colonia-label::before {
     display: none;
   }

      /* ======================================
      POPUP
      ====================================== */

/* Aplicar Montserrat Medium al popup de estadísticas */
.popup, .modal-content, #estadisticasModalLabel, #estadisticasInfo {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 500 !important;
  color: #333;
}

/* Reducir tamaño de letra del contenido del modal de estadísticas */
#estadisticasInfo {
  font-size: 12px !important;
}

#estadisticasInfo p {
  font-size: 12px !important;
  margin: 3px 0 !important;
}

#estadisticasInfo table {
  font-size: 11px !important;
}

#estadisticasInfo th,
#estadisticasInfo td {
  padding: 4px 6px !important;
  font-size: 11px !important;
}

#estadisticasModalLabel {
  font-size: 18px !important;
}

/* Ajustes en la apariencia del popup */
.leaflet-popup-content-wrapper {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1em;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid #180000;
}


/* Cambia el fondo del popup */
.leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 1em;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  border: 2px solid #180000;
}

/* Cambia la apariencia de la flecha del popup */
.leaflet-popup-tip {
  background: #99ff00;
}


   /* ======================================
      Botón de estadísticas
      ====================================== */
   .estadisticasBoton {
     text-align: center;
     padding: 1em;
   }
   
   .VerEstadisticas {
     background-color: rgb(106, 0, 0);
     color: #ffffff;
     padding: 0.5em 1em;
     border: none;
     cursor: pointer;
   }
   
   /* ======================================
      Panel de capas
      ====================================== */
   .control-capas-panel {
     background-color: #fff;
     padding: 1em;
     border-radius: 1em;
     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
     margin: 10px 1em 0;
     overflow: hidden;
     color: #000;
   }

   /* ======================================
      Sidebar Footer y botón consulta
      ====================================== */
   .sidebar-footer {
     margin: 20px 1em 15px;
     padding-bottom: 15px;
   }

   #consultaMapasBtn {
     width: 100%;
     padding: 12px;
     font-size: 13px;
     line-height: 1.3;
     white-space: normal;
     min-height: 45px;
   }

   /* Estilos para las capas base (Colonias, IDS, Zonas) */
   .control-capas-panel .form-check {
     margin-bottom: 8px;
   }

   .control-capas-panel .form-check-label {
     font-size: 11px;
     margin-left: 5px;
   }
   
   .lista-capas {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important; /* Medium */
    font-size: 1em;
    color: #333;
    width: 100%;
  }
   
  .lista-capas li {
    display: block;
    padding: 1px 0;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 500 !important;
    width: 100%;
  }
   
   .lista-capas input[type="checkbox"] {
     margin-right: 8px;
   }

   /* Estilos para el grupo de infraestructuras */
   .lista-capas-infraestructura {
     list-style: none;
     padding-left: 0 !important;
     margin: 0;
     background-color: #f9f9f9;
     border-left: 2px solid #922B21;
     padding: 8px 0 8px 12px !important;
     border-radius: 4px;
     display: block;
     width: 100%;
   }

   .lista-capas-infraestructura li {
     padding: 4px 0;
     font-size: 0.95em;
     display: flex;
     align-items: center;
     flex-wrap: wrap;
     width: 100%;
   }

   .lista-capas-infraestructura li input[type="checkbox"] {
     flex-shrink: 0;
   }

   .lista-capas-infraestructura li label {
     flex: 1;
     word-wrap: break-word;
     max-width: calc(100% - 30px);
   }

   /* Estilos para el grupo de equipamientos urbanos */
   .lista-capas-equipamientos {
     list-style: none;
     padding-left: 0 !important;
     margin: 0;
     background-color: #f0f8ff;
     border-left: 2px solid #1e5a8e;
     padding: 8px 0 8px 12px !important;
     border-radius: 4px;
     display: block;
     width: 100%;
   }

   .lista-capas-equipamientos li {
     padding: 4px 0;
     font-size: 0.95em;
     display: flex;
     align-items: center;
     flex-wrap: wrap;
     width: 100%;
   }

   .lista-capas-equipamientos li input[type="checkbox"] {
     flex-shrink: 0;
   }

   .lista-capas-equipamientos li label {
     flex: 1;
     word-wrap: break-word;
     max-width: calc(100% - 30px);
   }

   /* Estilos para los iconos emoji en el mapa */
   .emoji-icon {
     background: transparent !important;
     border: none !important;
     text-align: center;
     display: flex;
     align-items: center;
     justify-content: center;
   }

   .emoji-icon div {
     filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
     text-shadow: 0 0 3px #922B21, 0 0 3px #922B21, 0 0 3px #922B21, 0 0 5px #922B21;
   }

   /* Halo blanco para iconos de infraestructuras PNG */
   .icono-infraestructura {
     filter: drop-shadow(0 0 1px #922B21) drop-shadow(0 0 1px #922B21) drop-shadow(0 0 2px #922B21);
   }
   
   /* ======================================
      Mensaje de rotación para móviles
      ====================================== */
   #rotation-message {
     display: none;
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(84, 0, 0, 0.98);
     z-index: 10000;
     justify-content: center;
     align-items: center;
     flex-direction: column;
     color: white;
     text-align: center;
     padding: 20px;
     font-family: 'Montserrat', sans-serif;
   }

   #rotation-message .rotation-icon {
     font-size: 80px;
     margin-bottom: 20px;
     animation: rotate 2s infinite ease-in-out;
   }

   @keyframes rotate {
     0%, 100% { transform: rotate(0deg); }
     50% { transform: rotate(90deg); }
   }

   #rotation-message h2 {
     font-size: 24px;
     margin-bottom: 15px;
     font-weight: 600;
   }

   #rotation-message p {
     font-size: 16px;
     font-weight: 400;
   }

   /* ======================================
      Estilos Responsivos
      ====================================== */
   
   /* Tablets y pantallas medianas */
   @media (max-width: 768px) {
     .sidebar-container {
       width: 85%;
       max-width: 320px;
       left: 0;
       max-height: calc(100vh - 100px);
       z-index: 400;
     }

     .toggle-btn {
       left: 85%;
       z-index: 401;
     }

     .sidebar-container.oculto + .toggle-btn {
       left: 0;
     }

     .navbar {
       min-height: 70px;
     }

     .navbar h1 {
       font-size: 18px;
     }

     .logo {
       width: 100px;
     }

     .lista-capas li {
       font-size: 12px;
     }

     .form-check-label {
       font-size: 11px !important;
     }

     .sidebar-footer {
       margin: 15px 1em 10px;
     }

     #consultaMapasBtn {
       padding: 10px;
       font-size: 12px;
       min-height: 40px;
     }
   }

   /* Móviles pequeños */
   @media (max-width: 480px) {
     .sidebar-container {
       width: 80%;
       left: 0;
       max-height: calc(100vh - 100px);
       z-index: 400;
     }

     .toggle-btn {
       left: 80%;
       width: 35px;
       height: 35px;
       z-index: 401;
     }

     .sidebar-container.oculto + .toggle-btn {
       left: 0;
     }

     .navbar {
       padding: 0.3em 0.5em;
       min-height: 60px;
     }

     .navbar h1 {
       font-size: 14px;
     }

     .logo {
       width: 80px;
     }

     .lista-capas li {
       font-size: 11px;
     }

     .lista-capas img {
       max-width: 18px !important;
     }

     .form-check-label {
       font-size: 10px !important;
     }

     .control-capas-panel {
       padding: 0.5em;
       margin: 8px 0.5em 0;
     }

     .sidebar-footer {
       margin: 12px 0.5em 8px;
       padding-bottom: 10px;
     }

     #consultaMapasBtn {
       padding: 8px;
       font-size: 11px;
       min-height: 38px;
       line-height: 1.2;
     }

     /* Asegurar que los controles del mapa sean visibles */
     .leaflet-control-container {
       z-index: 600 !important;
     }

     .leaflet-control-zoom,
     .leaflet-control-layers {
       z-index: 600 !important;
     }
   }

   /* Mostrar mensaje de rotación solo en orientación portrait en móviles */
   @media screen and (max-width: 768px) and (orientation: portrait) {
     #rotation-message {
       display: flex !important;
     }
   }

   @media (max-width:300px) {
     .sidebar-container {
       width: 70%;
       max-width: 300px;
     }
     
     .informacion {
        width: 100%;
        backdrop-filter: blur(10px);
        background-color: rgb(57, 0, 0);
        color: #ffffff;
     }
     
     .sidebar-container.oculto {
       transform: translateX(-100%);
     }
     
     .toggle-btn {
       left: calc(100% + 0px);
     }


     .map-container {
      z-index: 1 !important;
  }

  .sidebar-container {
      z-index: 10;
  }

  .informacion {
      z-index: 5; 
  }

  .leaflet-pane {
      z-index: 2 !important;
  }


  /* MODAL GRAFICA MOVIL */
  .modal-content {
    height: 80vh;
    overflow-y: auto;
}

/* Asegurar que el modal tenga un margen en la parte superior e inferior */
.modal-dialog {
    margin: 0;
    height: 95vh;
    display: flex;
    align-items: center;
}

/* Ajustar el body del modal para que no se desborde */
.modal-body {
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Contenedor del gráfico para que ocupe el espacio disponible */
.chart-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%; /* Ocupa todo el espacio posible */
    min-height: 300px; /* Altura mínima para evitar que sea demasiado pequeño */
}

/* Hacer que el canvas se ajuste */
#estadisticasChart {
    width: 10% !important;
    height: 10% !important;
}

/* ======================================
   Animación para el botón de geolocalización
   ====================================== */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animación de pulso para el marcador de ubicación */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(2.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}


   }