:root {
  --color-primary: #089bc4;
  --color-secondary: #fff9eb;
  --color-tertiary: hsl(46, 94%, 52%);
  --color-button: #fe652b;
  --color-button-hover: #d14914;
  --color-text: #121111;
  --color-white: #ffffff;
  --radius-large: 1.5625rem;
  --shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3);
  --transition: all 0.3s ease;
}

/* Estilos generales */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px; /* Tamaño de fuente base */
}

body {
  height: 100vh;
  background-color: var(--color-primary);
  display: flex;
  line-height: 1.5;
}

.main-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Ocupa el espacio disponible */
  height: 100%;
  width: 100%;
  padding-bottom: calc(
    5rem + 3.75rem
  ); /* Añadiendo altura aproximada del contenedor fijo */
}

/* Banner */
.header-banner {
  flex: 40%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Títulos */
.main-title {
  font-size: 3.5rem; /* 68px -> 4.25rem */
  font-family: "Merriweather", serif;
  font-weight: 900;
  font-style: italic;
  color: var(--color-white);
  padding-left: 2.5rem; /* 40px -> 2.5rem */
}

.img-title {
  width: 18rem; /* 380px -> 23.75rem */
  margin: 0.25rem; /* 4px -> 0.25rem */
}

.section-title {
  font-family: "Inter", serif;
  font-size: 1.5rem; /* 32px -> 2rem */
  font-weight: 700;
  color: var(--color-primary);
  margin: 0.35rem; /* 10px -> 0.625rem */
  text-align: center;
}

/* Sección de entrada */
.input-section {
  flex: 100%;
  background-color: var(--color-secondary);
  border: 0.168rem solid #0c667f; /* 3px -> 0.1875rem */
  border-radius: 4rem 4rem 0 0; /* 64px -> 4rem */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.875rem 1.25rem 0; /* 30px 20px 0 -> 1.875rem 1.25rem 0 */
  width: 100%;
  height: 200px;
}

/* Contenedores de entrada y botón */
.input-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 35rem; /* 600px -> 37.5rem */
  margin: 0.5rem 0.75rem 0; /* 20px -> 1.25rem */
}

.input-name {
  width: 70%;
  height: 85%;
  padding: 0.675rem 1rem; /* 15px 25px -> 0.9375rem 1.5625rem */
  border: 0.12rem solid #000; /* 2px -> 0.125rem */
  border-radius: 1.25rem; /* 25px -> 1.5625rem */
  font-size: 1.05rem; /* 18px -> 1.125rem */
  margin-right: 1rem; /* 18px -> 1.125rem */
}

#error {
  color: red;
  font-size: 1.375rem; /* 22px -> 1.375rem */
  margin-top: 0.85rem; /* 15px -> 0.9375rem */
  display: flex;
  justify-content: center;
  text-align: center;
}

/* Estilos para el contenedor de botones fijos */
.button-container {
  width: 100%; /* 400px -> 25rem */
  position: fixed;
  bottom: 2.225rem; /*Ajusta este valor según la altura del footer */
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem; /* Espacio entre los botones */
  background-color: var(--color-secondary);
  padding: 0 0.5rem 0.5rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Sombra suave */
  z-index: 1000; /* Asegura que los botones estén por encima de otros elementos */
}
.botones {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

/* Estilos de botón */
button {
  font-family: "Inter", sans-serif;
  font-size: 0.85rem; /* 16px -> 1rem */
  border: 0.125rem solid #000; /* 2px -> 0.125rem */
  border-radius: var(--radius-large); /* 25px -> 1.5625rem */
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

button:hover {
  transform: scale(1.05);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-add {
  background-color: var(--color-tertiary);
  color: var(--color-white);
  font-weight: bold;
  padding: 0.75rem 1.65rem; /* 15px 30px -> 0.9375rem 1.875rem */
  height: auto;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3); /* 4px 8px -> 0.25rem 0.5rem */
}

.button-add:hover {
  background-color: var(--color-button);
}

/* Listas */
.name-list {
  display: grid;
  margin: 1rem 0 0.5rem 0; /* 10px -> 0.625rem */
  padding: 0.5rem 0 0 0; /* 10px -> 0.625rem */
  list-style-type: none;
  font-family: "Inter", sans-serif;
  grid-template-columns: repeat(4, minmax(12rem, 1fr));
  gap: initial; /* Espacio entre elementos */
  justify-content: center;
  max-height: 420px;
  overflow-y: auto; /* Agrega scroll si el contenido excede la altura */
}

.name-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 11.25rem; /* 180px → 11.25rem */
  padding: 0.35rem 0.75rem; /* 8px 12px → 0.5rem 0.75rem */
  border: none; /* 1px → 0.0625rem */
  border-radius: 0.3125rem; /* 5px → 0.3125rem */
  background-color: var(--color-secondary);
  white-space: nowrap; /* Evita que los nombres salten de línea */
  overflow: hidden;
  text-overflow: ellipsis; /* Muestra "..." si el texto es demasiado largo */
  color: var(--color-text);
  font-size: 1rem;
}

.result-list {
  margin-top: 0.5rem; /* 15px -> 0.9375rem */
  color: #05df05;
  font-size: 1.35rem; /* 22px -> 1.375rem */
  font-weight: bold;
  text-align: center;
}

/* Botón de sortear amigo */
.button-draw {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem; /* 10px 15px -> 0.625rem 0.9375rem */
  margin: 0.5rem; /* 10px -> 0.625rem */
  color: var(--color-white);
  box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.3); /* 4px 8px -> 0.25rem 0.5rem */
  background-color: var(--color-button);
  font-size: 0.95rem; /* 16px -> 1rem */
  gap: 0.75rem; /* 8px -> 0.5rem Espacio entre el ícono y el texto*/
}

.button-draw:hover {
  background-color: var(--color-button-hover);
}

.deleteBtn {
  background-color: transparent;
  border: none;
  color: #ff4d4d;
  cursor: pointer;
  font-size: 0.675rem; /* 12px -> 0.75rem */
  margin-left: 0.25rem; /* 10px -> 0.625rem */
  transition: color 0.3s ease;
  padding: 0.25rem 0.75rem;
}

.deleteBtn:hover {
  color: #f7d5d5;
}

.deleteBtn:active {
  background-color: #cc0000;
  border-color: #cc0000;
}

.fade-out {
  opacity: 0;
  transform: translateX(-100%);
}

.button-reset {
  display: flex; /* Para alinear el ícono y el texto */
  align-items: center; /* Para alinear el ícono y el texto */
  padding: 0.5rem 0.75rem; /* 10px 15px -> 0.625rem 0.9375rem */
  margin: 0.5rem; /* 10px -> 0.625rem */
  background-color: #4caf50; /* Verde */
  color: var(--color-white); /* Texto blanco */
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3); /* 4px 8px -> 0.25rem 0.5rem */
  gap: 0.75rem; /* 8px -> 0.5rem Espacio entre el ícono y el texto*/
}

.button-reset:hover {
  background-color: #36933b; /* Verde más oscuro al pasar el mouse */
}

.button-reset:active {
  background-color: #1c5a1e; /* Verde aún más oscuro al hacer clic */
}

.button-reset i {
  font-size: 1.35rem; /* 18px -> 1.125rem */
}

/* Estilos para el footer */
footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  text-align: center;
  padding: 0.5rem 0; /* 15px -> 0.9375rem */
  font-family: "Inter", sans-serif;
  font-size: 0.75rem; /* 14px -> 0.875rem */
  position: fixed;
  bottom: 0;
  width: 100%;
  border-top: 0.125rem solid #0c667f; /* 2px -> 0.125rem */
  height: auto; /* 50px -> 3.125rem Altura fija para el footer */
  z-index: 999; /* Asegura que el footer esté por debajo de los botones */
}

footer strong {
  color: var(--color-tertiary);
}

@media (max-width: 1024px) {
  /* Ajustes para tablets */

  /* Títulos */
  .main-title {
    font-size: 4.25rem;
    margin-left: 3.5rem;
  }

  .img-title {
    width: 23rem;
    margin-right: 0.25rem; /* 4px -> 0.25rem */
  }

  .section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0.5rem;
    padding: 0.45rem;
  }

  .input-section {
    padding: 1.5rem 1rem; /* Ajusta el padding para pantallas pequeñas */
    height: auto; /* Permite que la altura se ajuste automáticamente */
  }

  .input-name {
    width: 50%;
    height: 100%;
    padding: 0.675rem 1rem;
    font-size: 1.05rem;
  }

  .input-wrapper {
    flex-direction: row; /* Cambia a columna en pantallas pequeñas */
    justify-content: space-evenly; /* Espacio uniforme entre los elementos */
    align-items: center; /* Alinea los elementos para que ocupen todo el ancho */
    width: 100%; /* Ajusta el ancho del contenedor de entrada */
    max-width: 100%; /* Permite que el contenedor ocupe todo el ancho disponible */
    margin: 0.5rem;
  }

  .name-list {
    grid-template-columns: repeat(
      2,
      minmax(12rem, 1fr)
    ); /* Dos columnas en pantallas pequeñas */
  }
}

@media (max-width: 768px) {
  /* Ajustes para móviles */

  /* Títulos */
  .main-title {
    font-size: 2.25rem; /* 68px -> 4.25rem */
    margin-left: 0.15rem; /* 40px -> 2.5rem */
  }

  .img-title {
    width: 10rem;
    margin-right: 0.25rem; /* 4px -> 0.25rem */
  }

  .section-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0.5rem 0.35rem;
    padding: 0.15rem;
  }

  .input-section {
    padding: 0.5rem; /* Ajusta el padding para pantallas pequeñas */
    height: auto; /* Permite que la altura se ajuste automáticamente */
  }

  .input-name {
    width: 55%;
    height: 95%;
    padding: 0.5rem 0.75rem 0.5rem 0.75rem; /* 15px 25px -> 0.9375rem 1.5625rem */
    font-size: 0.85rem;
  }

  .input-wrapper {
    margin: 0.65rem;
  }

  .name-list {
    grid-template-columns: repeat(1, minmax(12rem, 1fr)); /* Una columna en pantallas pequeñas */
    margin: 0.5rem; /* 10px -> 0.625rem */
    padding: 0.5rem; /* 10px -> 0.625rem */
    max-height: 720px;
    overflow-y: auto; /* Agrega scroll si el contenido excede la altura */
  }

  /* Estilos de botón */
  button {
    font-family: "Inter", sans-serif;
    font-size: 0.65rem;
  }

  .button-add {
    padding: 0.55rem 1.5rem;
    height: auto;
  }

  .name-list li {
    font-size: 0.75rem;
  }

  .button-draw {
    width: 50%;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.3); 
    font-size: 0.65rem;
    gap: 0.5rem;
  }

  .img-draw {
    width: 1.25rem; /* 20px -> 1.25rem */
    height: 1.25rem; /* 20px -> 1.25rem */
  }

  .deleteBtn {
    font-size: 0.55rem;
  }

  .button-reset {
    font-size: 0.65rem;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 0.15rem 0.25rem rgba(0, 0, 0, 0.3);
    gap: 0.45rem;
  }

  .button-reset i {
    font-size: 1rem;
  }

  .result-list {
    font-size: 1.15rem;
  }

  #error {
    font-size: 1rem; /* 22px -> 1.375rem */
    margin-top: 0.5rem; /* 15px -> 0.9375rem */

  }
}
