.table-container {
  overflow-x: auto;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
}

.styled-table thead {
  display: flex;
}

.styled-table tbody {
  display: flex;
  flex-direction: column;
}

.styled-table tr {
  display: flex;
  flex-grow: 1;
  width: 100%;
}

.styled-table th,
.styled-table td {
  box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
  border: 1px solid #b5b6b7;
  padding: 8px;
  text-align: center;
  color: #eee;
  flex-basis: 0;
  flex-grow: 1;
  word-break: break-word; /* Rompe palabras largas para evitar el desbordamiento */
  display: flex;
  align-items: center;
  justify-content: center;
}

.styled-table th {
  background-color: #05b4df;
  border: inherit;
}

.styled-table th {
  border-top: 1px solid #b5b6b7;
  
}

.styled-table th:first-child {
  border-top-left-radius: 10px; /* Añade redondeado a la esquina superior izquierda */
  border-left: 1px solid #b5b6b7;
}

.styled-table th:last-child {
  border-top-right-radius: 10px; /* Añade redondeado a la esquina superior derecha */
  border-right: 1px solid #b5b6b7;
}

.styled-table tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

.styled-table tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}

.styled-table td:nth-last-child(-n + 2),
.styled-table th:nth-last-child(-n + 2),
.styled-table td:first-child,
.styled-table th:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.styled-table td:nth-last-child(-n + 2),
.styled-table th:nth-last-child(-n + 2) {
  max-width: 90px;
  min-width: 60px;
}

.styled-table td:first-child,
.styled-table th:first-child {
  max-width: 150px;
}

/* .styled-table .toggle-switch-cell {
  min-width: 60px;
} */

.styled-table label.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.styled-table label.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.styled-table label.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  -webkit-transition: background-color 0.4s, transform 0.4s;
  transition: background-color 0.4s, transform 0.4s;
}

.styled-table label.switch .slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  -webkit-transition: transform 0.4s;
  transition: transform 0.4s;
}

.styled-table input:checked + .slider {
  background-color: #04b4e0;
}

.styled-table input:checked + .slider:before {
  -webkit-transform: translateX(23px);
  -ms-transform: translateX(23px);
  transform: translateX(23px);
}

/* Añade este estilo para ajustar el enfoque del input */
.styled-table input:focus {
  outline: none; /* Elimina el contorno predeterminado al hacer clic */
}

@media screen and (max-width: 768px) {
  .styled-table label.switch {
    width: 40px;
    height: 24px;
  }

  .styled-table label.switch .slider {
    border-radius: 20px;
  }

  .styled-table label.switch .slider:before {
    height: 16px;
    width: 16px;
    left: 5px;
    bottom: 4px;
  }

  .styled-table input:checked + .slider:before {
    -webkit-transform: translateX(14px);
    -ms-transform: translateX(14px);
    transform: translateX(14px);
  }

  .styled-table td,
  .styled-table th {
    max-height: 50px; /* Ajusta el alto fijo según tus necesidades */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
  }

  .styled-table th:hover {
    cursor: pointer;
  }

  .styled-table td .label-container,
  .styled-table th .label-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px;
    white-space: normal;
    color: #05b4df;

    opacity: 0;
    transition: opacity 0.5s; /* Ajusta la duración de la transición según sea necesario */
  }

  .styled-table tr {
    display: flex;
  }

  .styled-table td,
  .styled-table th {
    flex: 1;
  }

  .styled-table th:hover .label-container,
  .styled-table td:hover .label-container {
    display: block;
    opacity: 1;
    animation: hideLabel 10s forwards; /* Duración de 5 segundos */
  }

  @keyframes hideLabel {
    to {
      opacity: 0;
    }
  }
}

@media screen and (min-width: 769px) {
  .styled-table td .label-container,
  .styled-table th .label-container {
    display: none;
  }
}
