/* ================================================= */
/* BASE POLICÍA - DISEÑO PRINCIPAL          */
/* ================================================= */

/* --- Contenedor de la tabla de estructura de Excel --- */
.tabla-base-de-datos-policia {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: auto;
  border: none;
  /* Estilo del scroll */
  scrollbar-width: thin;
  scrollbar-color: var(--first-color) transparent;
  scrollbar-track-border-radius: 4px;
  margin: 0 auto;
  margin-top: 69px;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 4.9rem;
}

/* --- Título de la sección de Excel (estructura y resultados) --- */
.TitleExcel {
  text-align: center;
  font-size: var(--h2-font-size);
  font-weight: bold;
  background: linear-gradient(to right, #2daf0c, #00d6ba, #2daf0c);
  background-size: 200% 100%;
  animation: gradientAnimationTitle 4s linear infinite;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Animación para el gradiente del título */
@keyframes gradientAnimationTitle {
  0% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* --- Estilos Generales de la Tabla (para ambas, estructura y resultados si son similares) --- */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th,
td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid var(--text-color-light);
  white-space: nowrap;
}

thead {
  background-color: #27293d;
  color: #fff;
}

thead th {
  vertical-align: middle;
}

thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #27293d;
  color: #fff;
}

tbody td {
  vertical-align: middle;
}

/* ================================================= */
/* CONTENEDOR DE RESULTADOS DE CARGA       */
/* ================================================= */
.resultado-carga {
  margin-top: 2rem;
  margin-bottom: 4.9rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  max-height: 500px; /* **ALTURA MÁXIMA PARA EL SCROLL VERTICAL** */
  overflow-y: auto; /* Habilita el scroll vertical */
  overflow-x: auto; /* Habilita el scroll horizontal */

  scrollbar-width: thin;
  scrollbar-color: var(--first-color) transparent;
  scrollbar-track-border-radius: 4px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  box-sizing: border-box;
}

.resultado-carga h2 {
  text-align: center;
  font-size: var(--h2-font-size);
  font-weight: bold;
  color: var(--first-color);
  margin-top: 0;
  margin-bottom: 1rem;
}

/* ================================================= */
/* INPUT Y BOTONES DE CARGA             */
/* ================================================= */

.GroupInput {
  display: flex;
  gap: 1rem;
}

.InputBox {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  background-color: var(--container-color);
  border-radius: 1rem;
}

/* El `input type="file"` oculto */
.InputBox input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

/* El botón visible "Agregar archivo de excel" (.AggExcel) */
.AggExcel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2.5rem;
  width: 100%;
  height: 100%;
  color: var(--text-color);
  background-color: var(--container-color);
  border-radius: 1rem;
  border: 3px solid var(--border-color);
  cursor: pointer;
  transition: border-color 0.4s, color 0.4s, background-color 0.4s;
  z-index: 2;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
}

/*
 * NUEVO: Efecto hover para el botón ANTES de seleccionar un archivo.
 * Se aplica solo cuando no tiene la clase 'file-selected'.
 */
.AggExcel:not(.file-selected):hover {
  border-color: var(--first-color);
  color: var(--first-color);
}

/* Estilo para el botón cuando un archivo está seleccionado */
.AggExcel.file-selected {
  border-color: var(--first-color);
  color: var(--first-color);
  background-color: var(--first-color-lighten);
}

/* Estilo para el span dentro de AggExcel que contiene el nombre del archivo */
.AggExcel span {
  flex-grow: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 1rem; /* Espacio para que no se pegue a la 'x' */
}

/* Estilo para el ícono 'X' para quitar el archivo seleccionado */
.remove-file-btn {
  color: var(--cancel-color);
  font-size: 1.25rem;
  cursor: pointer;
  pointer-events: auto; /* Permite que el clic en la 'x' se capture */
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.remove-file-btn:hover {
  color: var(--second-color);
}

/* --- Estilos para los botones generales (ButtonSubir, etc.) --- */
.Buttons {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ButtonDescargar,
.ButtonSubir,
.ButtonDescargarCC,
.ButtonActualizar {
  padding: 1rem 2rem;
  border-radius: 4.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background-image: linear-gradient(
    to right,
    var(--first-color),
    var(--second-color),
    var(--first-color)
  );
  background-size: 200% 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-position 0.5s ease;
  color: white;
  min-width: 150px;
}

.ButtonDescargar:hover,
.ButtonSubir:hover,
.ButtonDescargarCC:hover,
.ButtonActualizar:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  background-position: 100% 0;
}

/* Estilo para el botón "Cargar Excel" cuando un archivo está listo para subir */
.ButtonSubir.ready-to-upload {
  box-shadow: 0 0 10px rgba(0, 255, 128, 0.6), 0 0 20px rgba(0, 200, 100, 0.4);
  transform: scale(1.02);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: none;
  background-position: 50% 0;
}

/* ================================================= */
/* MEDIA QUERIES (RESPONSIVE)        */
/* ================================================= */
@media (max-width: 768px) {
  .GroupInput {
    flex-direction: column;
  }
}