﻿body {
  font-family: Arial, sans-serif;
  margin: 20px;
  padding: 0.5rem;
  background-color: #F9FAFB !important;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #919191;
}

::-webkit-scrollbar-thumb {
  background: #4e4e4e;
}

::-webkit-scrollbar-thumb:hover {
  background: #d6d6d6;
}

/* style.css */
.cell-content {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px; /* Ajusta este valor según tus necesidades */
  display: inline-block;
  vertical-align: middle;
}

.expand-button {
  display: none;
  margin-left: 10px;
  cursor: pointer;
  color: #007bff;
}

.expandable-cell:hover .expand-button {
  display: inline;
}

table {
  width: 80%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border: 1px solid #ddd;
  padding: 0px;
  text-align: left;
  font-size: 12px;
}

th {
  background-color: #f2f2f2;
  cursor: default;
  position: relative;
}

th {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  /* flex-direction: row; */
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-left: 2rem;
  /* margin-bottom: 20px; */
  margin-top: 10px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: #333;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 10px;
  animation: fadeIn 0.5s;
  color: hsl(0, 0%, 100%);
  /* &:hover {
    background-color: #555 !important;
  } */
}

.filter-tag span {
  margin-left: 5px;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
/* 
.sort-button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: none;
  background-color: red;
  cursor: pointer;
}

.sort-button::before,
.sort-button::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 4px solid transparent;
}
.sort-button::before {
  top: 0;
  border-bottom-color: #ff0000;
}
.sort-button::after {
  bottom: 0;
  border-top-color: #ff0000;
} */
.btn-informe {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  &:hover {
    background-color: #4ca2ff;
  }
}
.btn-informe2 {
  background-color: blue;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  &:hover {
    background-color: rgb(83, 83, 255);
  }
}

.print-button {
  position: fixed;
  top: 10px;
  right: 12px;
  padding: 5px 10px;
  background-color: red;
  color: white;
  border: none;

  cursor: pointer;
  width: 100px;
  border-radius: 0.5rem;
  height: 35px;
  z-index: 1;
  &:hover {
    background-color: #939393;
  }
}

.container-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-container {
  /* margin-bottom: 5px; */
  margin-left: 2rem;
  display: flex;
  justify-content: start;
  /* align-items: center; */
  gap: 10px;
  font-size: 0.8em;
  flex: wrap;
  /* padding: 1rem; */
}

.search-input {
  border: none;
  height: 30px;
  /* outline: none; */
  border-radius: 10px;
  padding: 8px;
  background-color: #ffff;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  /* box-shadow: inset 2px 5px 10px rgba(0, 0, 0, 0.3); */
  transition: 300ms ease-in-out;
}

/* .search-input:focus {
  background-color: white;
  transform: scale(1.05);
  box-shadow: 13px 13px 100px #969696, -13px -13px 100px #ffffff;
  border: 1px solid black;
}

.search-input::placeholder {
  color: #000000;
  font-weight: 600;
} */

.clear-filters {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 45px;
  height: 30px;
  border: none;
  /* border-radius: 50%; */
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition-duration: 0.3s;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  background-color: #ffff;
}

.clear-filters .sign {
  width: 100%;
  transition-duration: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* div:where(.swal2-container) .swal2-input {
  height: auto !important;
} */

/* .clear-filters {
  background-color: #007bff;
  color: #fff;
  border: none;
  height: 2rem;
  border-radius: 5px;
  &:hover {
    background-color: red;
  }
} */

/* .clear-filters .sign svg {
  width: 17px;
}

.clear-filters .sign svg path {
  fill: white;
} */

/* .clear-filters .text {
  position: absolute;
  right: 0%;
  width: 0%;
  opacity: 0;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  transition-duration: 0.3s;
} */

/* .clear-filters:hover .sign {
  width: 30%;
  transition-duration: 0.3s;
  padding-left: 20px;
} */

/* .clear-filters:hover .text {
  opacity: 1;
  width: 70%;
  transition-duration: 0.3s;
  padding-right: 10px;
} */

/* .clear-filters:active {
  transform: translate(2px, 2px);
} */

.filterSelect {
  height: 30px;
  width: 200px;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  border: none;
}

.page-button {
  border-radius: 1rem;
  padding: 0.5rem;
  gap: 2px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  accent-color: #2196f3;
  cursor: pointer;
  border-radius: 4px;
  /* box-shadow: 0 0 0 1px #ccc; */
  transition: box-shadow 0.2s, border-radius 0.2s;
}

input[type="checkbox"]:hover {
  box-shadow: 0 0 0 2px #2196f3;
}

.choices__list--multiple .choices__item {
  background-color: rgb(131, 131, 131) !important;
  border: 2px solid #fff !important;
}

.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.option-span {
  background-color: red;
  color: white;
  padding: 4px 10px 4px 10px;
  min-width: 40px;
  border-radius: 5px;
  white-space: nowrap;
  text-align: center;
  font-weight: 500;
}

.option-span + .option-span {
  margin-left: 3px;
}

.option-span-linked {
  /* background-color: rgb(228, 228, 228); */
  background-color: #55d1fe;
  /* color: #000000; */
  color: #fff;
  border-radius: 5px;
  flex: wrap;
  padding: 4px 10px;
  gap: 10px;
  text-align: center;
  font-weight: 500;
  margin-right: 5px;
  display: inline-block;
  margin-top: 5px;
}

/* Estilos para el Spinner Principal */
.spinner {
  border: 6px solid rgba(0, 0, 0, 0.1);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border-left-color: rgb(255, 106, 0);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Estilos específicos para el Spinner dentro del Botón "Cargar más" */
.button-spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ff6600;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

#loadMoreButton.pulse {
  animation: pulse 2s infinite;
}

#loadMoreButton {
  /* height: 30px; */
  width: 200px;
  text-align: center;
  border-radius: 10px;
  background-color: #fff;
  color: #181717;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  border: none;
}

/* #loadMoreButton:hover {
  background-color: #f7f7f7; 
} */

.delete-button {
  position: absolute;
  top: 5px;
  right: 5px;
  color: red;
  cursor: pointer;
  z-index: 1;
  background: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-container {
  position: relative;
  display: inline-block;
  margin: 5px;
}

.file-container img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

div:where(.swal2-container) .swal2-html-container {
  height: auto;
}

div:where(.swal2-container.swal2-double-click-modal) .swal2-html-container {
  height: 200px;
  overflow-y: auto; /* Añadir scroll si el contenido excede la altura */
}

/* Ocultar el spinner por defecto */
.spinner {
  display: none;
}

.showColumns {
  background-color: #ffff;
  border-radius: 10px;
  border: none;
  color: black;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);

  /* outline: 3px #181717 solid; */
  /* outline-offset: -3px; */
  height: 30px;
  padding: 0.5rem;
  font-weight: 400;
  font-size: 0.9em;
  &:hover {
    background-color: #ffff;
    transition: 400ms;
    color: #181717;
  }
}

.controls {
  display: flex;
  gap: 10px;
  /* padding: 1rem; */
  justify-content: start;
  align-items: center;
  margin-left: 35px;
}

.controls button {
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  border: none;
  color: black;
  /* outline: 3px #181717 solid; */
  /* outline-offset: -3px; */
  padding: 0.5rem;
  width: 40px;
  height: 30px;
  font-weight: 400;
  font-size: 0.9em;
}

.controls select {
  height: 30px;
  width: 200px;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  border: none;
}

#updateStatus {
  font-size: 0.8em;
}

@media print {
  /* Ocultar botones y elementos que no se deben imprimir */
  #printTableBtn,
  #resetColumnsBtn,
  #filterSelect,
  .search-container {
    display: none;
  }

  @media (min-width: 480px) {
    /* Ajustes para móviles */
    #updateStatus {
      display: none;
    }

    .search-input {
      width: 5rem;
    }
  }

  /* Ocultar la columna "Editar" al imprimir */
  th[data-field-name="Editar"],
  td[data-field-name="Editar"] {
    display: none;
  }

  /* Ajustar estilos de la tabla para impresión */
  table {
    width: 100%;
    border-collapse: collapse;
  }

  table,
  th,
  td {
    border: 1px solid black;
  }

  th,
  td {
    padding: 8px;
    text-align: left;
  }

  /* Opcional: Ajustar tamaño de fuente para impresión */
  body {
    font-size: 12px;
  }

  /* Ocultar la columna "Editar" al imprimir */
  th:nth-child(1),
  td:nth-child(1) {
    display: none;
  }
}

.option-span-linked-fallback {
  color: red; /* Resalta los registros cuyo displayField no está disponible */
  font-weight: bold;
}

#toggleSection {
  padding: 5px;
  background-color: #ececec; /*color de fondo encabezado*/
  border-radius: 5px;
  /* border: 1px solid #ddd; */
  /* margin: 20px; */
}

/* Clase para ocultar la sección */
.hidden {
  display: none;
}

.fixed-button {
  position: fixed;
  top: 10px;
  right: 120px;
  background-color: #1b1b1b;
  color: white;
  border: none;
  border-radius: 0.5rem;
  width: 55px;
  height: 36px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.fixed-button:hover {
  background-color: gray; /* Color al pasar el ratón */
}

@-webkit-keyframes sk-rotateplane {
  0% {
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
  }
  100% {
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
  }
}

@keyframes sk-rotateplane {
  0% {
    transform: perspective(120px) rotateX(0deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg);
  }
  50% {
    transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
    -webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
  }
  100% {
    transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
    -webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
  }
}

/* Botón habilitado */
.btn-enabled {
  background-color: #ff6600;
  color: white;
  transition: background-color 0.3s ease;
}

.btn-enabled:hover {
  background-color: #e65c00;
}

/* Botón deshabilitado */
.btn-disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: none;
}

/* Estilos para el menú de sort */
.sort-menu {
  width: 150px;
  z-index: 999 !important;
}

.sort-menu div {
  padding: 10px;
  cursor: pointer;
  /* z-index: 99999 !important; */
}

.sort-menu div:hover {
  background-color: #f0f0f0;
}

/* Estilos para el indicador de sort */
.sort-arrow {
  margin-left: 5px;
  font-size: 12px;
  color: #333;
}

#openFormBtn {
  position: static;
  top: 10px;
  right: 180px;
  background-color: #1b1b1b;
  color: white;
  border: none;
  border-radius: 0.5rem;
  width: 36px;
  height: 25px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

/* #openFormBtn {
  padding: 10px 20px;
  background-color: #1d1e1d;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
} */

.modal {
  /* padding: 40px; */
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 50px;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fefefe;
  position: absolute;
  top: 5%; /* Ajusta este valor según tus necesidades */
  left: 50%;
  transform: translateX(-50%);
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 600px;
}

.close {
  color: #aaa;
  position: absolute;
  top: -7px;
  right: 2px;
  font-size: 45px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
}

.modal-iframe {
  width: 100%;
  height: 600px;
  border: none;
}

@media (max-width: 600px) {
  .modal-content {
    width: 95%;
  }
}

/* Estilos para el overlay */
#modalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Fondo semitransparente */
  display: none; /* Oculto por defecto */
  justify-content: center; /* Centrado horizontal */
  align-items: center; /* Centrado vertical */
  z-index: 1000; /* Asegura que esté por encima de otros elementos */
}

/* Estilos para el contenido del modal */
#modalContent {
  position: relative;
  width: 600px;
  max-width: 900px;
  height: 80%;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Estilos para el iframe */
#editIframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Estilos para el botón de cerrar */
#closeModal {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 30px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  z-index: 1001;
}

#closeModal:hover {
  color: #000;
}

/* .custom-scrollbar-container {
  width: 100%;
  height: 15px;
  overflow: hidden;
  background-color: #f1f1f1;
  margin-bottom: 10px;
} */

/* .custom-scrollbar-container {
  width: 100%;
  height: 25px;
  overflow: hidden;
  background-color: #f1f1f1;
  margin-bottom: 10px;
  position: fixed;
  bottom: -10px;
} */

/* .custom-scrollbar {
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  cursor: pointer;
  min-width: 20px;
} */

/* .table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
} */

/* .table-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
} */

/* .table {
  width: 100%;
} */
/* Estilo para la cabecera de grupo */
/* Estilos para el menú de agrupación */
.grouping-menu {
  position: relative;
  display: inline-block;
  margin-right: 10px;
  z-index: 100;
}

.grouping-menu-button {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.grouping-menu-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 101;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  left: 0;
}

.grouping-menu-content a {
  color: #333;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  font-size: 13px;
  transition: background-color 0.2s ease;
}

.grouping-menu-content a:hover {
  background-color: #f5f5f5;
}

/* Mostrar el menú al hacer hover */
.grouping-menu:hover .grouping-menu-content {
  display: block;
}

/* Estilos para los grupos */
.group-header {
  background-color: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #333;
}

.group-header:hover {
  background-color: #f0f0f0;
}

.group-header .header-container {
  display: flex;
  align-items: center;
}

.group-header .toggle-icon {
  font-size: 16px;
  color: #666;
  margin-right: 12px;
  transition: transform 0.2s ease;
}

.group-header .group-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.group-header .group-count {
  font-size: 13px;
  color: #666;
  font-weight: normal;
}

/* Estilo para las filas dentro de un grupo */
tr[data-group] {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

tr[data-group].collapsed {
  display: none !important;
}

/* Estilo para los botones de control de grupo */
.grouping-controls {
  margin: 15px 0;
  display: flex;
  gap: 10px;
}

.table-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#groupingSelect {
  height: 30px;
  width: 200px;
  border-radius: 10px;
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.199);
  border: none;
  font-size: 12px;
}

.group-header .header-container {
  display: flex;
  align-items: center;
  padding: 0.5rem;
}
/* Contenedor .table-responsive como el ancestro de scroll */
.table-responsive {
  max-height: 80vh;
  overflow: auto;
  position: relative;
}

/* Hacer que el thead completo sea sticky */
#airtableData thead.table-header-sticky {
  position: -webkit-sticky; /* Safari */
  position: sticky;
  top: 0;
  /* ---> AUMENTAR z-index del thead principal <--- */
  z-index: 20; /* Un valor más alto que el de las cabeceras de grupo */
}

/* Estilos para las celdas de la cabecera (th) DENTRO del thead sticky */
#airtableData thead.table-header-sticky th {
  background-color: #f8f9fa; /* O el color de tu cabecera */
  border-top-width: 0;
  /* El z-index aquí no es tan crítico si el del thead es alto,
     pero puedes mantenerlo o quitarlo */
  /* z-index: 10; */
}

/* Estilos para las CABECERAS DE GRUPO (tus <tr class="group-header">) */
/* Asumimos que las celdas dentro de group-header son <td> */
#airtableData tbody tr.group-header {
  position: -webkit-sticky; /* Safari */
  position: sticky;
  /* Que se peguen justo DEBAJO de la cabecera principal */
  /* Necesitas saber la altura de tu cabecera principal. */
  /* Si tu cabecera principal tiene, por ejemplo, 40px de alto: */
  top: 25px; /* AJUSTA ESTE VALOR A LA ALTURA DE TU THEAD */
  background-color: #e9ecef; /* Un color ligeramente diferente para las cabeceras de grupo */
  z-index: 15; /* Menor que el thead principal, pero mayor que el tbody normal */
  /* Puedes darle un borde para separarlo si quieres */
  border-bottom: 1px solid #ccc;
}

#airtableData tbody tr.group-header td {
  /* Asegurar que la celda de la cabecera de grupo tenga fondo */
  background-color: inherit; /* Hereda del tr.group-header */
  font-weight: bold;
}
