/* estilos-mapa.css */

html, body {
  overflow-x: hidden;
}


body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
}

/* mapa full */
#mapa {
  width: 100vw;
  height: 100vh;
  position: relative;
}

svg path:hover {
  stroke: black;
  stroke-width: 2px;
  cursor: pointer;
}

/* etiquetas en el SVG */
.municipio-label {
  font-size: 9px;
  fill: #000;
  font-weight: bold;
  text-anchor: middle;
  pointer-events: none;
  text-shadow: 1px 1px 2px white;
}

.distrito-numero {
  font-size: 20px;
  font-weight: bold;
  fill: black;
  text-anchor: middle;
  text-shadow: 1px 1px 3px white;
}

.cabecera-punto {
  fill: #555;
  stroke: #222;
  stroke-width: 1px;
}

/* ---------------------------
   ESTILOS DEL MODAL
----------------------------*/

/* HEADER DEL MODAL */
#modalMunicipio .modal-header {
  display: flex;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  align-items: stretch !important;
}

.bg-distrito {
  background-color: #f0c6e9;
  color: #880e8c;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid #ccc;
}

.bg-clasificacion {
  background-color: #8e24aa;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* recortar texto muy largo */
.bg-clasificacion .clasificacion-texto {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bg-clasificacion .clasificacion-texto span {
  color: #f0c6e9;
}

.clasificacion-texto {
  font-size: 1.2rem;
  font-weight: 600;
}

#modalMunicipioLabel {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 0.2rem;
}

#listaMunicipios {
  font-size: 0.9rem;
  font-style: italic;
  color: #6a1b9a;
  word-break: break-word;
  line-height: 1.2;
}

/* ==============================
   Permitir que el submenu flote completo
   ============================== */
#modalMunicipio .modal-body {
  overflow: visible !important;
}

/* Asegura que el modal-content tampoco lo corte */
#modalMunicipio .modal-content {
  overflow: visible !important;
}




/* BODY DEL MODAL */
.modal-body {
  padding: 0;
  margin: 0;
  overflow: hidden; /* bloquea scroll aquí */
}

/* columnas de Bootstrap: altura total menos header */
.modal-body > .col-md-4,
.modal-body > .col-md-8 {
  height: calc(90vh - 56px);
}

/* Ajustes en la columna derecha para usar flexbox */
.modal-body > .col-md-8 {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 0; /* esencial para que funcionen los hijos flex */
}

/* SIDEBAR DE CLASIFICACIONES */
.panel-clasificaciones {
  position: relative;
  background-color: #8e24aa;
  color: white;
  padding: 1rem;
  border-right: 2px solid #ddd;
  overflow: visible; /* deja ver el submenú */
}

#listaClasificaciones {
  padding: 0;
  margin: 0;
  list-style: none;
}

#listaClasificaciones button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.5rem 0;
  color: #b20066;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Avenir';
}

#listaClasificaciones button:hover,
#listaClasificaciones button.active {
  background-color: #ec407a;  /* fondo magenta en hover/activo */
  color: #fff;                /* texto blanco para máximo contraste */
  font-weight: bold;
  border-radius: 4px;
  padding-left: 10px;
  transition: background-color 0.2s, color 0.2s;
}

/* --------------------------------------
   CONTENEDOR PRINCIPAL (SUBMENÚ) 
-------------------------------------- */
.submenu-lateral-custom {
  position: absolute;
  top: 0;
  left: 100%;
  width: 220px;

  /* fondo lavanda muy suave, sin transparencia */
  background-color: #f3e5f5;
  /* mantiene tu tono de texto principal */
  color: #b20066;
  /* borde púrpura medio */
  border: 1px solid #ba68c8;
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);

  transform: translateX(-10px);
  transition: transform 0.25s ease, opacity 0.2s ease;
  opacity: 0;
  display: block;
  z-index: 1050;
}
.submenu-lateral-custom.show {
  opacity: 1;
  transform: translateX(0);
}

/* --------------------------------------
   HEADER DEL SUBMENÚ 
-------------------------------------- */
.submenu-lateral-custom .border-bottom.bg-dark {
  /* púrpura medio sólido */
  background-color: #ba68c8 !important;
  /* texto negro para máximo contraste */
  color: #ffffff !important;

  font-family: 'Avenir', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  margin: 0;

  border-top-left-radius: 8px;
  border-top-right-radius: 8px;

  display: flex;
  align-items: center;
  justify-content: space-between;
}
.submenu-lateral-custom .border-bottom.bg-dark .close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  /* icono cerrado en negro */
  color: #000;
  cursor: pointer;
  transition: color 0.2s;
}
.submenu-lateral-custom .border-bottom.bg-dark .close:hover {
  color: rgba(0,0,0,0.6);
}

/* --------------------------------------
   ÍTEMS (BOTONES) 
-------------------------------------- */
.submenu-lateral-custom .list-group-item {
  font-family: 'Avenir';
  background-color: #e0e0e0;       
  color: #b20066;                  
  margin: 0.5rem 1rem;
  padding: 0.6rem 1rem;

  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.6),
    0 2px 4px rgba(0,0,0,0.06);

  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  cursor: pointer;
}

.submenu-lateral-custom .list-group-item:hover {
  background-color: #c8c8c8;      /* gris medio en hover */
  color: #b20066;                 /* texto morado */
  transform: translateX(3px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 4px 8px rgba(0,0,0,0.1);
}

/* --------------------------------------
   TEXTOS Y DETALLES
-------------------------------------- */
.submenu-lateral-custom .list-group-item span {
  font-weight: 500;
}


/* -------------------------------
   Posiciona el buscador arriba a la derecha
   ------------------------------- */
.search-wrapper {
  position: absolute;
  top: 106px;
  right: 22px;
  z-index: 1100; /* por encima del resto */
}

/* -------------------------------
   Estilo del “pill” de búsqueda
   ------------------------------- */
.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #b20066;
  border-radius: 999px;
  padding: 4px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* icono lupita (Bootstrap Icons) */
.search-box .bi-search {
  font-size: 1rem;
  color: #b20066;
  margin-right: 8px;
}

/* input sin borde y con placeholder uppercase */
.search-input {
  border: none;
  outline: none;
  font-family: 'Avenir', sans-serif;
  font-size: 0.9rem;
  text-transform: none;
  color: #444;
  width: 180px;
  background: transparent;
}
.search-input::placeholder {
  color: #999;
  font-weight: 600;
}



/* CONTENIDO PRINCIPAL DE DOCUMENTOS: único scroll */
#documentosView {
  flex: 1 1 auto;   /* ocupa espacio restante */
  min-height: 0;    /* permite que flexbox lo reduzca */
  overflow-y: auto;
  padding-right: 0.5rem; /* evita que el scroll tape el contenido */
}

/* PREVIEW: ocupa su espacio natural al pie */
#previewDocumento {
  flex: 0 0 auto;
  margin-top: 1rem;
}

#previewDocumento .card {
  background-color: #f5f5f5;
  border-radius: 0.5rem;
}

/* BOTÓN CERRAR */
.btn-close {
  filter: brightness(0) invert(1);
}

/* SIN BORDE INFERIOR EN HEADER */
.sin-borde {
  border-bottom: none !important;
}

/* FIJAR ANCHO MÁXIMO DEL MODAL */
.modal-dialog.modal-lg {
  max-width: 80vw;
}




/* ================================
   Estilos para #modalMorelia
   ================================ */

/* Contenedor general */
/* --------------------------------------
   MODAL MORELIA: ESQUINAS REDONDEADAS
-------------------------------------- */
#modalMorelia .modal-content {
  border-radius: 18px;                  /* como .submenu-lateral-custom */
  overflow: visible;                    /* deja ver sombras y dropdown */
  border: 1px solid #ba68c8;            /* mismo borde púrpura medio */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* --------------------------------------
   HEADER: fondo púrpura medio + texto negro
-------------------------------------- */
#modalMorelia .modal-header {
  background-color: #ba68c8;            /* igual que submenú header */
  color: #000;                          /* texto negro */
  font-family: 'Avenir', sans-serif;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: none;
  border-top-left-radius: 18px;         /* redondeo solo superior */
  border-top-right-radius: 18px;
}

/* Cerrar en negro y más grande */
#modalMorelia .modal-header .btn-close {
  color: #000;
  font-size: 1.2rem;
  filter: none;
}
#modalMorelia .modal-header .btn-close:hover {
  color: rgba(0,0,0,0.6);
}

/* --------------------------------------
   BODY: fondo lavanda muy suave
-------------------------------------- */
#modalMorelia .modal-body {
  background-color: #f3e5f5;            /* mismo lavanda que submenu */
  padding: 1rem;
  border-bottom-left-radius: 18px;      /* cierra esquinas inferior */
  border-bottom-right-radius: 18px;
}

/* --------------------------------------
   SELECTOR: acorde a pill de búsqueda
-------------------------------------- */
#modalMorelia .form-select {
  border: 2px solid #b20066;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: 'Avenir', sans-serif;
  font-size: 0.95rem;
  color: #444;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.06);
}

/* --------------------------------------
   FOOTER: fondo púrpura medio + botón pill
-------------------------------------- */
#modalMorelia .modal-footer {
  background-color: #ba68c8;
  border-top: none;
  padding: 0.75rem 1rem;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  display: flex;
  justify-content: flex-end;
}

/* Botón “Ver documentos” en pill invertido */
#modalMorelia .btn-primary {
  background-color: #f3e5f5;
  color: #880e8c;
  border: 2px solid #b20066;
  border-radius: 999px;
  font-family: 'Avenir', sans-serif;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
#modalMorelia .btn-primary:hover {
  background-color: #e0b4d5;
  color: #740d6a;
}

/* ======================
   Forzar altura del modal
   ====================== */
.modal-body .row {
  /* Ajusta 56px si tu header de modal cambia de altura */
  height: calc(90vh - 56px);
}

/* ==== Sidebar ==== */
.sidebar {
  display: flex;
  flex-direction: column;
  /* Ocupa toda la altura disponible */
  height: 100%;
  /* separación interna */
  padding: 16px 8px;
  gap: 15px;
  overflow: visible !important;
}

.sidebar-header {
  background: #fbd4f9;
  color: #9c0062;
  padding: 12px;
  text-align: center;
  text-transform: uppercase;
  font-size: 14px;
  font-weight: bold;
  border-radius: 8px;
  position: relative;
}
/* Ribete triangular gris */
.sidebar-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  border-top: 16px solid #ddd;
  border-right: 16px solid transparent;
  border-radius: 0 0 0 8px;
}



/* 1) Forzar altura útil del modal y distribuir en columnas */
.modal-body .row {
  /* Ajusta 56px si cambias la altura del header del modal */
  height: calc(90vh - 56px);
}
.modal-body .sidebar,
.modal-body .main-content {
  height: 100%;
}
.modal-body .main-content {
  display: flex;
  flex-direction: column;
}

/* ======================
   SIDEBAR (Clasificaciones)
   ====================== */
/* ==============================
   CONTENEDOR “PLECA GRIS” PARA CLASIFICACIONES
   ============================== */
.sidebar-content {
  background: linear-gradient(to bottom, #e2e5e9, #f9fafb);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  overflow: hidden;      /* para que los border-radius funcionen */
  padding: 0;            /* el padding lo ponemos en cada li */
}

/* reset de lista */
.sidebar-content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* cada elemento */
.sidebar-content li {
  position: relative;
  padding: 12px 16px;
  color: #9c0062;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s;
}

/* línea blanca entre ítems */
.sidebar-content li:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 16px;       /* mismo padding horizontal */
  right: 16px;
  height: 1px;
  background: rgba(255,255,255,0.6);
}

/* redondear esquinas de primer y último */
.sidebar-content li:first-child {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.sidebar-content li:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

/* hover y activo */
.sidebar-content li:hover,
.sidebar-content li.active {
  background: rgba(255,255,255,0.4);
  font-weight: 600;
}


/* ======================
   MAIN CONTENT (Derecha)
   ====================== */
.main-content {
  padding: 16px;
  /* Flex para distribuir internamente */
  display: flex;
  flex-direction: column;
}

hr.pink-line {
  border: none !important;
  height: 3px !important;
  background-color: #8e24aa !important;
  
  width: 40% !important;

  margin: 1rem 0 1rem 2% !important;  
  
}


/* Encabezado Distrito */
.district-header h3 {
  font-size: 18px;
  font-weight: normal;
  color: #555;
  margin: 0;
}
.district-header h3 span {
  font-weight: bold;
  color: #000;
}
.district-header p {
  margin-top: 4px;
  font-size: 14px;
  color: #a60057;
  font-style: italic;
}

/* ======================
   CAJA DE CLASIFICACIÓN
   ====================== */
/* Esta caja rosa se estira y luego su lista interna scrolla */
.classification-box {
  border: 2px solid #ff66a9;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
  /* ocupa todo el espacio que deja la cabecera y la línea */
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
   padding-top: 16px;
}
.classification-box .classification {
  background: #fbd4f9;
  padding: 12px 16px;
  border-radius: 18px;

  /* nuevo borde superior */
  border-top: 4px solid #ff66a9;
  margin: 0;
}

.classification-box .classification h4 {
  font-size: 16px;
  color: #9c0062;
  margin: 0;
}
.classification-box .classification h4 strong {
  font-weight: 700;
}

/* LISTA DE DOCUMENTOS (scroll interno) */
.document-list-wrapper {
  padding: 0 16px 16px;
  /* ocupa el resto del espacio en .classification-box */
  flex: 1 1 auto;
  overflow-y: auto;
}
.document-list-wrapper input {
  margin-bottom: 12px;
}
.document-list .document-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #ff66a9;
}
.document-list .document-item:last-child {
  border-bottom: none;
}
.document-list .document-item img {
  width: 32px;
  margin-right: 12px;
}
.document-list .document-item .btn {
  background: #cc002e;
  color: #fff;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  margin-right: 12px;
  white-space: nowrap;
}
.document-list .document-item .file-name {
  font-size: 14px;
  color: #333;
  word-break: break-all;
}
/* Scrollbar (WebKit) para documentos */
.document-list-wrapper::-webkit-scrollbar {
  width: 6px;
}
.document-list-wrapper::-webkit-scrollbar-thumb {
  background: #ff66a9;
  border-radius: 3px;
}


/* Botones de la lista de clasificaciones */
.classification-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  color: #9c0062;         /* rosa fuerte */
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}
.classification-btn:hover,
.classification-btn.active {
  background: rgba(255,255,255,0.5);
  font-weight: bold;
}

/* colores base */
.text-purple { color: #6a1b9a; }
.pink-line { border-top: 4px solid #ba68c8; }

/* lista lateral */
#listaGlosario .list-group-item {
  cursor: pointer;
  transition: background-color .2s;
}
#listaGlosario .list-group-item.active {
  background-color: #8e24aa;
  color: white;
  font-weight: bold;
}
#listaGlosario .list-group-item:hover:not(.active) {
  background-color: #ec407a;
  color: #fff;
}
