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

.video-background {
  position: relative;
  width: 100%;
  height: 100vh; /* Toda la pantalla */
  overflow: hidden;
}

.video-background video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: -1;
  transform: translate(-50%, -50%);
  object-fit: cover; /* Asegura que el video cubra toda el área */
  object-position: center bottom; /* Centra el video */
}

body {
  width: 100%;
  height: 100vh;
  max-height: 1000px;
}

h1 {
  font-family: "Raleway", sans-serif;
  font-size: 5rem;
  background: linear-gradient(45deg, #fff089, #ffe066, #ffffff, #fff089);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

i {
  font-size: 1.5em;
  color: #2980b9;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
  width: 100%;
  height: 100vh;
  gap: 2rem;

  min-width: 365px;

  z-index: -1;
  background: linear-gradient(45deg, #00c6ff, #0072ff, #00c6ff);
  background-size: 600% 600%;
  animation: gradientFlow 5s ease infinite;
}

/* Error Container */

.error-container {
  display: none; /* Oculto por defecto */
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 0, 0, 0.26); /* Fondo rojo claro */
  color: #3f0101; /* Texto rojo */
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 10; /* Asegura que esté por encima de otros elementos */
  box-sizing: border-box;
}

.error-container h3 {
  margin: 0 0.5rem 0;
  font-size: 1.2em;
  color: #3f0101; /* Texto rojo */
}

/* Error Container */

/* Search Container */

.right-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  width: 50%;
  height: 100%;
  z-index: 2;
}

.search-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #f0f0f0 40%,
    #e0e0e0 70%,
    #dcdcdc 100%
  );

  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); /* Sombra suave */
  color: white; /* Texto blanco para contraste */
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0px 5px 15px #00000088;
}
.search-container h2 {
  font-size: 1.5em;
  color: white;
  font-family: "Rubik", sans-serif;
}

.input-container {
  width: 100%;
  height: 100%;
}

.search-container input {
  padding: 10px;
  border: 2px solid #2980b9;
  border-radius: 5px;
  font-size: 1em;
  width: 100%;
  background-color: #4da6ff;
  color: #2c3e50;
}

.search-container input::placeholder {
  color: #2c3e50;
  font-style: italic;
}

.input-container {
  position: relative; /* Necesario para posicionar las sugerencias */
  width: 300px; /* Asegura que el contenedor tenga el mismo ancho que el input */
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: flex-start; /* Alinea el input al inicio */
  justify-content: center; /* Centra verticalmente el input */
}

#city-suggestions {
  position: absolute;
  background: linear-gradient(45deg, #00c6ff, #0072ff, #0072ff, #00c6ff);
  border-radius: 0 0 5px 5px; /* Bordes redondeados en la parte inferior */
  left: 0; /* Alinea las sugerencias con el input */
  top: 100%; /* Coloca las sugerencias debajo del input */
  border: 0px solid #ccc;
  z-index: 1000;
  width: 300px; /* Asegura que el ancho coincida con el input */
  max-height: 150px; /* Altura máxima para el contenedor de sugerencias */
  overflow-y: auto; /* Permite desplazamiento si hay muchas sugerencias */
  padding: 0 0.5rem; /* Espacio interno para las sugerencias */
}

.suggestion-item {
  padding: 8px;
  cursor: pointer;
  color: #fff; /* Color del texto de las sugerencias */
  list-style: none; /* Elimina los puntos de la lista */
  background-color: transparent;
  font-family: "Rubik", sans-serif;
  border-radius: 5px;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.suggestion-item:hover {
  background-color: #4da6ff; /* Cambia el fondo al pasar el mouse */
  color: #1a5276; /* Cambia el color del texto al pasar el mouse */
}

.search-container button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: linear-gradient(45deg, #00c6ff, #0072ff, #0072ff, #00c6ff);

  color: white;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
  box-shadow: 1px 2px 5px 3px #0000008c;
}

.search-container button:hover {
  background-color: #4da6ff;
  color: #1a5276;
  transform: scale(1.05);
}

.search-container input:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

.search-container button:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* Search Container */

/* Weather Container */
.weather-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  width: 50%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(45deg, #00c6ff, #0072ff, #0072ff, #00c6ff);

  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(76, 70, 146, 0.52);
  color: rgb(0, 0, 0); /* Texto blanco para contraste */
  padding: 1rem;
  border-radius: 5px;
  box-shadow: 0px 5px 15px #00000077;
  min-width: 300px;
}

.weather-container h2 {
  font-size: 2em;
  color: #2c3e50;
  font-family: "Rubik", sans-serif;
  padding: 0.5rem;
  border-radius: 5px;
  background: linear-gradient(45deg, #fff089, #ffe066, #ffefb9, #fff089);
  background-size: 600% 600%;
  animation: gradientFlow 5s ease infinite;
  box-shadow: 0px 5px 15px #00000036;
}

.weather-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  height: 50%;
  width: 100%;
  box-sizing: border-box;
  gap: 1rem;
}

.temperature-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: 50%;
  height: 100%;
}

.icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2); /* blanco semitransparente */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

#weatherIcon {
  height: 100%;
  width: 100%;
  background-size: cover;
  transform: scale(1.5);

  background-position: center;
  background-repeat: no-repeat;
}

.temperature {
  font-size: 6rem;
  color: #ffffff;
  font-family: "Rubik", sans-serif;
}
.weather-container p {
  font-size: 0.8em;
  color: #ffffff;
  font-family: "Rubik", sans-serif;
}

.weather-container i {
  font-size: 3em;
  color: #ffd700;
}

.weather-container div {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive Design */
@media (max-width: 520px) {
  /* Estilos para pantallas pequeñas */
  .container {
    flex-direction: column-reverse;
    justify-content: start;
  }

  #weatherIcon {
    height: 100px; /* Reduce el tamaño del icono del clima */
    width: 100px; /* Reduce el tamaño del icono del clima */
    transform: translateY(0) scale(1.3); /* Elimina la transformación vertical */
  }

  h1 {
    font-size: 3rem; /* Reduce el tamaño del título en pantallas pequeñas */
  }
  .temperature-container p {
    font-size: 0.75rem; /* Reduce el tamaño del texto de temperatura */
    margin: 0;
  }

  .right-container,
  .weather-container {
    width: 100%;
    height: auto; /* Permite que la altura se ajuste al contenido */
  }

  .weather-container h3 {
    font-size: 3rem; /* Añade un margen superior para separar los contenedores */
    margin: 0;
  }

  .search-container {
    width: 100%; /* Asegura que el input ocupe todo el ancho disponible */
  }

  .search-container input {
    width: 100%; /* Asegura que el input ocupe todo el ancho disponible */
  }
}

@media (max-width: 920px) {
  /* Estilos para pantallas medianas */
  .container {
    flex-direction: column-reverse;
    justify-content: start;
  }

  #weatherIcon {
    height: 100px; /* Reduce el tamaño del icono del clima */
    width: 100px; /* Reduce el tamaño del icono del clima */
    transform: translateY(0) scale(1.3); /* Elimina la transformación vertical */
  }

  h1 {
    font-size: 3rem; /* Reduce el tamaño del título en pantallas pequeñas */
  }
  .temperature-container p {
    font-size: 0.75rem; /* Reduce el tamaño del texto de temperatura */
    margin: 0;
  }

  .right-container,
  .weather-container {
    width: 100%;
    height: auto; /* Permite que la altura se ajuste al contenido */
  }

  .weather-info {
    max-width: 395px;
  }

  .weather-container h3 {
    font-size: 3rem; /* Añade un margen superior para separar los contenedores */
    margin: 0;
  }

  .search-container {
    width: 100%; /* Asegura que el input ocupe todo el ancho disponible */
  }

  .input-container {
    width: 100%; /* Asegura que el contenedor del input ocupe todo el ancho disponible */
  }

  .search-container input {
    width: 100%; /* Asegura que el input ocupe todo el ancho disponible */
  }
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
