/* Estilo Global */
body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: "Arial", sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

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

/* Estilo de la calculadora y la tabla */
.main-container {
  display: flex;
  padding: 30px 0;
  align-items: flex-start;
}

.input-container {
  flex: 1;
  margin-right: 20px;
  display: flex;
  flex-direction: column;
}

.results-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Ocultamos la tabla por defecto con la clase 'hidden' */
.hidden {
  display: none;
}

h1,
h2 {
  color: #0092cc;
}

input,
button {
  padding: 10px;
  margin: 10px 0;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  width: 100%;
  box-sizing: border-box;
}

input {
  background-color: #1f1f1f;
  color: #e0e0e0;
}

button {
  background-color: #0092cc;
  color: #121212;
  cursor: pointer;
  width: 217px;
}

button:hover {
  background-color: #3700b3;
}

/* Asegúrate de que este CSS se carga en tu HTML */
table {
  border-collapse: collapse;
  width: 100%;
  max-width: 1200px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

th,
td {
  border: 1px solid #0092cc;
  padding: 10px;
  text-align: left;
}

th {
  background-color: #1f1f1f;
  color: #0092cc;
}

/* Ajustar el ancho de la primera columna */
th:nth-child(1),
td:nth-child(1) {
  width: 300px;
}

td {
  background-color: #1e1e1e;
}

/* Clase para mostrar la tabla con animación */
.table-show {
  opacity: 1;
  transform: scale(1);
}

.converter-container {
  display: flex;
  justify-content: center; /* Centers horizontally */
  align-items: center; /* Centers vertically */
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  height: 100vh; /* Full viewport height */
}

.converter {
  width: 45%;
  padding: 20px;
  background-color: #1f1f1f;
  border-radius: 5px;
  border: solid 1px #0092cc;
}

.converter input {
  border: solid 1px #0092cc;
}

label {
  display: block;
  margin-bottom: 5px;
  color: #0092cc;
}

.result {
  margin-top: 10px;
  font-size: 18px;
  color: #03dac6;
}

@media screen and (max-width: 768px) {
  .main-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0 15px;
  }

  .converter-container {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 0 auto;
    padding: 0 15px;
  }

  .converter {
    width: 100%;
    max-width: 400px;
  }
  #toggleButton {
    display: block;
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .converter-container {
    flex-direction: column;
    align-items: center;
  }

  .converter {
    width: 90%; /* Adjust width to fit smaller screens */
  }
}

@media (min-width: 769px) {
  .main-container {
    padding: 15px 0; /* reduce vertical padding */
  }

  .input-container {
    margin-right: 10px; /* reduce space between input and results */
  }

  input,
  button {
    margin: 5px 0; /* reduce vertical spacing between inputs and buttons */
  }
}

@media (min-width: 769px) {
  .main-container {
    margin-bottom: -200px; /* Reduced bottom margin */
  }

  .converter-container {
    margin-top: -200px; /* Reduced top margin */
  }
}

@media screen and (max-width: 768px) {
  #resultsTable {
    width: 100%;
    border-collapse: collapse;
  }

  #resultsTable thead {
    display: none;
  }

  #resultsTable tr {
    display: block;
    margin-bottom: 15px;
    border: 1px solid #0092cc;
    border-radius: 5px;
    padding: 10px;
    background-color: #1e1e1e;
  }

  #resultsTable td {
    display: block;
    text-align: left;
    padding: 5px 0;
    position: relative;
  }

  #resultsTable td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #0092cc;
    display: block;
    margin-bottom: 5px;
  }
}
