/* Resetando margens e paddings */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* Estilos gerais */
body {
  font-family: 'Ubuntu', sans-serif;
  background: linear-gradient(180deg, rgba(89, 76, 238, 1) 0%, #8dd0f5 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-position: center;
  background-size: cover;
}

.container {
  background-color: #5c54ed;
  box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
  padding: 3rem;
  color: #fdfdfd;
  border-radius: 1rem;
  max-width: 600px;
  width: 100%;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Formulário */
.form h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-align: center;
}

.form-input-container {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
}

.form input {
  padding: 0.8rem;
  border: none;
  flex: 1;
  border-radius: 4px;
}

.form button {
  padding: 0.8rem;
  min-width: 50px;
  margin-left: 8px;
  background-color: #8dd0f5;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

/* Exibição do clima */
#weather-data,
#error-message,
#loader,
#forecast {
  border-top: 1px solid #fff;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  text-align: center;
  width: 100%;
}

#weather-data h2 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.6rem;
}

#weather-data span {
  margin: 0.6rem;
}

#temperature {
  font-size: 4rem;
}

#country {
  height: 15px;
}

#description-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.6rem 0;
}

#description {
  text-transform: capitalize;
  font-weight: bold;
}

#details-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

#details-container #umidity {
  border-right: 1px solid #fff;
  margin: 0.6rem;
  padding: 0.6rem;
}

/* Loader */
#loader i {
  animation: rotate 1.5s linear infinite;
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

/* Previsão de chuva por hora */
#forecast {
  margin-top: 2rem;
  text-align: center;
}

.forecast-day {
  margin: 10px 0;
  background-color: #ffffff30;
  padding: 10px;
  border-radius: 10px;
  font-size: 1.2rem;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.forecast-day img {
  width: 40px;
  height: 40px;
  margin-right: 10px;
}

.forecast-day strong {
  font-size: 1.3rem;
}

.forecast-day p {
  margin-top: 0.5rem;
  font-weight: bold;
}

.forecast-day-time {
  font-size: 1rem;
  color: #fff;
  background-color: #007bff;
  padding: 5px 10px;
  border-radius: 10px;
}

.forecast-day-precip {
  color: #ff5733;
}

/* Responsividade para telas pequenas */
@media (max-width: 768px) {
  /* Ajustar o container em telas menores */
  .container {
    padding: 2rem;
  }

  /* Ajustar o formulário para telas menores */
  .form h3 {
    font-size: 1.2rem;
  }

  .form-input-container {
    flex-direction: column;
  }

  .form button {
    margin-left: 0;
    margin-top: 10px;
  }

  /* Ajustar tamanho da fonte e layout para o clima */
  #temperature {
    font-size: 3rem;
  }

  #weather-data h2 {
    flex-direction: column;
    text-align: center;
  }

  #description-container {
    flex-direction: column;
    align-items: center;
  }

  /* Ajustar previsões de chuva */
  .forecast-day {
    font-size: 1rem;
  }
}

/* Responsividade para telas menores que 480px (celulares) */
@media (max-width: 480px) {
  /* Ajustar o formulário */
  .form input, .form button {
    width: 100%;
    margin-top: 10px;
  }

  /* Ajustar o clima */
  #temperature {
    font-size: 2.5rem;
  }
}
