:root {
  --border-radius: 10px;
  --muted-text: rgba(39, 33, 66, 63%);
  --primary-text: rgb(0, 0, 0, 0.8);
  --border: 1px solid #dcccfa;
  --transition: all ease-in-out 300ms;
}

*:focus-visible {
  outline-color: #885df1;
}

body {
  background: #b19bd9;
  font-family: "Roboto", sans-serif;
}

.weather-app {
  background: #f0ecfc;
  max-width: 600px;
  width: 80%;
  margin: 160px auto;
  padding: 30px;
  border-radius: var(--border-radius);
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.145);
  color: var(--muted-text);
}

header {
  border-bottom: var(--border);
}

.highlighted-text {
  color: #774ddd;
  font-weight: 500;
  opacity: 0.7;
}

h1 {
  font-size: 40px;
  text-align: center;
  margin-top: 0;
}

form {
  padding-bottom: 30px;
}

form.hidden {
  display: none;
}

.search-button,
.search-input,
#error-button {
  border: none;
  font-size: 16px;
  padding: 20px;
  border-radius: calc(var(--border-radius) - 5px);
}

.search-input {
  background: #f9f7fe;
  color: #885df1;
  width: 82%;
}

.search-input:-webkit-autofill,
.search-input:-webkit-autofill:hover,
.search-input:-webkit-autofill:focus,
.search-input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #f9f7fe inset !important;
  -webkit-text-fill-color: #885df1;
}

.search-input::placeholder {
  color: #bea4ff;
  opacity: 0.6;
  font-size: 15px;
}

.search-input:focus {
  outline-color: #885df1;
}

.search-button,
#error-button {
  background-color: #885df1;
  color: white;
  transition: var(--transition);
}

.search-button:hover,
.search-button:focus-visible,
#error-button:hover,
#error-button:focus-visible {
  opacity: 0.8;
  cursor: pointer;
}

.search-button:focus-visible,
#error-button:focus-visible {
  outline-color: rgb(67, 67, 253);
}

#error-button {
  padding: 10px 20px;
  display: block;
  margin: 0 auto 20px;
}

main {
  padding: 30px 10px;
}

h2,
p.error-message,
.current-temperature-value,
.current-temperature-unit {
  color: var(--primary-text);
}

#current-date,
p.error-message {
  text-align: center;
}

#current-date {
  margin-bottom: 25px;
}

p.error-message {
  font-size: 16px;
  font-weight: 700;
  opacity: 0.9;
}

.current-weather {
  display: flex;
  justify-content: space-between;
}

h2 {
  font-size: 38px;
  margin: 0;
}

.current-details {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.current-country {
  font-weight: 500;
  font-size: 18px;
  display: block;
  max-width: 300px;
}

#weather-description {
  font-style: italic;
}

.float-right {
  display: flex;
  align-items: center;
  padding-bottom: 15px;
}

.current-temperature-icon img {
  width: 75px;
}

.current-temperature-value {
  font-size: 70px;
  font-weight: 500;
}

.current-temperature-unit {
  position: relative;
  font-size: 22px;
  top: -20px;
}

footer {
  border-top: var(--border);
  text-align: center;
  padding: 15px 5px 0;
}

footer a.highlighted-text {
  text-decoration: none;
  transition: var(--transition);
  opacity: 1;
}

footer a:hover {
  opacity: 0.8;
}

@media (max-width: 700px) {
  .weather-app {
    text-align: center;
  }
  .search-input,
  .search-button {
    display: block;
    margin: 0 auto;
    padding: 15px;
  }

  .search-input {
    width: 80%;
    text-align: center;
  }

  .search-button {
    width: 20%;
    min-width: 100px;
    margin-top: 10px;
  }

  .current-weather {
    flex-direction: column;
  }

  .current-country {
    margin: 0 auto;
  }

  .float-right {
    justify-content: center;
    margin-top: 20px;
  }

  .current-temperature-value {
    font-size: 65px;
  }

  .current-temperature-unit {
    font-size: 18px;
  }
}
