:root {
  --color-primary: #4d0de5;
  --color-secondary: #7da1f7;
  --color-warning: #fae362;
  --color-error: #f75e4b;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  max-width: 1200px;
  margin: auto;
  height: 100vh;
}

#search {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 10px 120px;
  border-radius: 0 0 40px 40px;
  background: linear-gradient(
    13deg,
    var(--color-primary) 47%,
    var(--color-secondary) 100%
  );
  box-shadow: var(--color-secondary) 0px 20px 100px 0px;
}

#location {
  width: 45px;
  margin-right: 10px;
  cursor: pointer;
  transition: all 0.1s ease-in;
}

#location:hover {
  transform: scale(1.3);
}

#search input {
  width: 300px;
  height: 35px;
  border: none;
  padding: 10px;
  color: var(--color-primary);
  font-size: 0.9rem;
  border-radius: 10px 0 0 10px;
}

#search input:focus {
  outline: none;
}

#search button {
  border: none;
  background-color: var(--color-warning);
  height: 35px;
  padding: 10px;
  border-radius: 0 10px 10px 0;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.1s ease-in;
}

#search button:hover {
  color: var(--color-primary);
}

#weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #fff;
  width: 500px;
  min-height: 200px;
  margin: auto;
  margin-bottom: 10px;
  position: relative;
  bottom: 80px;
  padding: 30px;
  border-radius: 30px;
  box-shadow: var(--color-secondary) 0px 25px 80px -25px;
}

#weaher h1 {
  color: var(--color-primary);
  font-size: 2rem;
  margin-bottom: 20px;
}

#weather #main {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

#weather #main span {
  margin: 0 30px 0 10px;
  color: grey;
}

#weather #info {
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

#weather #info span {
  color: var(--color-secondary);
  margin-left: 5px;
}

#forcast {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

#forcast div {
  width: 180px;
  padding: 25px 10px 25px;
  text-align: center;
  border-radius: 20px;
  box-shadow: var(--color-secondary) 0px 25px 80px -25px;
  margin-bottom: 30px;
}

#forcast h3 {
  color: var(--color-primary);
  margin-bottom: 30px;
}

#forcast p {
  margin-bottom: 10px;
}

#forcast span {
  color: var(--color-secondary);
}

#modal {
  background-color: rgba(128, 128, 128, 0.7);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
}

#modal > div {
  background: #fff;
  width: 500px;
  border-radius: 20px;
  padding: 30px;
}

#modal span {
  background-color: var(--color-error);
  color: #fff;
  font-weight: 900;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.1s ease-in;
  padding: 5px 10px;
  border-radius: 10px;
}

#modal p {
  margin-top: 40px;
  color: var(--color-error);
}

#loader {
  width: 100px;
  height: 100px;
  border: 7px solid var(--color-primary);
  border-bottom-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: rotation 0.8s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 500px) {
  #weather {
    width: 95%;
  }
  #forcast {
    width: 95%;
    margin: auto;
  }

  #weather #info {
    flex-direction: column;
  }
}

/*---------------------------*/
@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    height: auto;
    min-height: 100vh;
  }

  #search {
    padding: 50px 14px 95px;
    border-radius: 0 0 28px 28px;
  }

  #location {
    width: 38px;
    margin-right: 8px;
  }

  #search input {
    width: 100%;
    min-width: 0;
  }

  #weather {
    width: calc(100% - 24px);
    bottom: 60px;
    padding: 22px 14px;
  }

  #weather h1 {
    font-size: 1.5rem;
    text-align: center;
  }

  #weather #main {
    flex-wrap: wrap;
  }

  #weather #main span {
    margin: 0 12px;
  }

  #weather #info {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  #forcast {
    width: calc(100% - 24px);
    margin: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  #forcast div {
    width: 100%;
    margin-bottom: 0;
  }

  #modal {
    position: fixed;
    height: 100dvh;
    padding: 16px;
  }

  #modal > div {
    width: 100%;
    max-width: 500px;
  }
}
