@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

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

body {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 30px;
  min-height: 100vh;
  background-color: #ffffffad;
}

.wrapper {
  width: 400px;
  border-radius: 20px;
  background-color: #b8baf1ae;
}

.wrapper header {
  color: #370c68;
  font-size: 21px;
  font-weight: 500;
  padding: 16px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3d3570;
}
.toggleTheme {
  margin: 2px 20px 0 0;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
}
header i {
  cursor: pointer;
  font-size: 0px;
  margin-right: 8px;
}

.wrapper.active header i {
  font-size: 30px;
  margin-left: 5px;
}

.wrapper .input-part {
  margin: 20px 25px 30px;
}

.wrapper.active .input-part {
  display: none;
}

.input-part .info-txt {
  display: none;
  font-size: 17px;
  text-align: center;
  padding: 12px 10px;
  border-radius: 7px;
  margin-bottom: 15px;
}

.info-txt.error {
  display: block;
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

.info-txt.pending {
  display: block;
  color: #0c5460;
  background: #d1ecf1;
  border: 1px solid #bee5eb;
}

.input-part :where(input, button) {
  width: 100%;
  height: 55px;
  border: none;
  outline: none;
  font-size: 18px;
  border-radius: 7px;
}

.input-part input {
  text-align: center;
  border: 1px solid #bfbfbf;
}

.input {
  color: dimgray;
  border: 2px solid dimgrey;
}
.input:valid {
  color: green;
  border: 2px solid green;
}
.input:invalid {
  animation: justShake 0.3s forwards;
  color: red;
  border: 2px solid red;
}
@keyframes justShake {
  25% {
    transform: translateX(5px);
  }
  50% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
  100% {
    transform: translateX(-5px);
  }
}

.input-part .separator {
  height: 1px;
  width: 100%;
  margin: 25px 0;
  background: #3d3570;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.dark-mode .input-part .separator {
  background: #ffffff;
}

.separator::before {
  content: "or";
  color: #fff;
  font-size: 19px;
  padding: 0 15px;
  background: #3d3570;
  border-radius: 20%;
}

.input-part button {
  color: #fff;
  cursor: pointer;
  background: #5a5aa8;
}

.input-part button:hover {
  color: #fff;
  cursor: pointer;
  background: #2f2f74;
  transition: 0.5s;
}

.wrapper .weather-part {
  margin: 30px 0 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.wrapper.active .weather-part {
  display: flex;
}

.weather-part img {
  max-width: 125px;
}

.weather-part .temp {
  display: flex;
  font-size: 72px;
  font-family: 500;
}

.weather-part .temp .numb {
  font-weight: 600;
}

.weather-part .temp .deg {
  font-size: 40px;
  margin: 10px 5px 0 0;
  display: block;
}

.weather-part .weather {
  font-size: 21px;
  text-align: center;
  margin: -5px 20px 15px;
}

.weather-part .location {
  display: flex;
  align-items: center;
  font-size: 21px;
  margin-bottom: 30px;
}

.location i {
  font-size: 22px;
  margin-right: 5px;
}

.weather-part .bottom-details {
  width: 100%;
  display: flex;
  align-items: center;
  border-top: 1px solid #3d3570;
  justify-content: space-between;
}

.bottom-details .column {
  width: 100%;
  display: flex;
  padding: 15px 0;
  align-items: center;
  justify-content: center;
}

.column i {
  color: #3d3570;
  font-size: 40px;
}

.column.humidity {
  border-left: 1px solid #3d3570;
  border-right: 1px solid #3d3570;
}

.details .temp,
.humidity span,
.wind span {
  font-size: 18px;
  font-weight: 500;
  margin-top: -3px;
  margin-left: 5px;
}

.details .temp .deg {
  margin: 0;
  font-size: 17px;
  pad: 0 2px 0 1px;
}

.details p {
  font-size: 14px;
  margin-top: -2px;
  margin-left: 5px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
}

.toggle-switch input {
  display: none;
}

.slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  border-radius: 24px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #3d3570;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

footer {
  background-color: #f1f1f1;
  padding: 10px;
  text-align: center;
}

footer p {
  margin: 0;
  font-size: 15px;
  color: #888;
}

body.dark-mode footer{
  background-color: transparent;
}

body.dark-mode footer p{
  color: #fff;
}

body.dark-mode .slider:before {
  background-color: #fff;
}
input:checked + .slider {
  background-color: #43affc;
}
body.dark-mode input:checked + .slider {
  background-color: #3d3570;
}

input:checked + .slider:before {
  transform: translateX(16px);
}

body.dark-mode {
  background-color: #040735;
  color: #fff;
}

body.dark-mode .wrapper {
  background: rgba(157, 157, 216, 0.6);
}

body.dark-mode .wrapper header {
  color: white;
  border-bottom: 1px solid #bfbfbf;
}
body.dark-mode .input-part button {
  background-color: rgba(49, 49, 187, 0.6);
}
body.dark-mode .input-part button:hover {
  background-color: rgba(11, 11, 46, 0.6);
}
body.dark-mode .column i {
  color: #fff;
}

body.dark-mode .column.humidity {
  border-left: 1px solid #ffffff;
}
body.dark-mode .weather-part .bottom-details {
  border-top: 1px solid #ffffff;
}
/* Media queries for different devices */

/* Small devices (mobile phones) */
@media only screen and (max-width: 767px) {
  .wrapper {
    width: 90%;
  }
  .column i {
    font-size: 28px;
  }
  .details .temp,
  .humidity span,
  .wind span {
    font-size: 12px;
    font-weight: 500;
  }
  .details .temp .deg {
    font-size: 10px;
    pad: 0 2px 0 1px;
  }

  .details p {
    font-size: 9px;
  }
  .location i {
    font-size: 20px;
  }
  .weather-part .location {
    font-size: 17px;
    margin-bottom: 20px;
  }
  .weather-part img {
    max-width: 110px;
  }
  .weather-part .weather {
    font-size: 17px;
    margin: -5px 20px 10px;
  }
  .wrapper header {
    font-size: 17px;
    padding: 16px 15px;
  }
  .wrapper.active header i {
    font-size: 25px;
    margin-left: 5px;
  }
}

/* Medium devices (tablets) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
  .wrapper {
    width: 80%;
  }
  .column i {
    font-size: 39px;
  }
  .details .temp,
  .humidity span,
  .wind span {
    font-size: 21px;
    font-weight: 500;
  }
  .details .temp .deg {
    font-size: 19px;
    pad: 0 2px 0 1px;
  }

  .details p {
    font-size: 14px;
  }
  .location i {
    font-size: 27px;
  }
  .weather-part .location {
    font-size: 23px;
    margin-bottom: 20px;
  }
  .weather-part img {
    max-width: 120px;
  }
  .weather-part .weather {
    font-size: 23px;
    margin: -5px 20px 10px;
  }
  .wrapper header {
    font-size: 24px;
    padding: 16px 15px;
  }
  .wrapper.active header i {
    font-size: 36px;
    margin-left: 5px;
  }

  .toggle-switch {
    width: 60px;
    height: 34px;
  }

  .slider {
    border-radius: 34px;
  }

  .slider:before {
    height: 28px;
    width: 28px;
    left: 7px;
    bottom: 3px;
  }
}

/* Large devices (laptops/desktops) */
@media only screen and (min-width: 992px) {
  .wrapper {
    width: 40%;
  }
  .column i {
    font-size: 40px;
  }
  .details .temp,
  .humidity span,
  .wind span {
    font-size: 25px;
    font-weight: 500;
  }
  .details .temp .deg {
    font-size: 24px;
    pad: 0 2px 0 1px;
  }

  .details p {
    font-size: 17px;
  }
  .location i {
    font-size: 27px;
  }
  .weather-part .location {
    font-size: 26px;
    margin-bottom: 25px;
  }
  .weather-part img {
    max-width: 129px;
  }
  .weather-part .weather {
    font-size: 27px;
    margin: -5px 20px 10px;
  }
  .wrapper header {
    font-size: 27px;
    padding: 16px 15px;
  }
  .wrapper.active header i {
    font-size: 39px;
    margin-left: 5px;
  }

  .toggle-switch {
    width: 60px;
    height: 34px;
  }

  .slider {
    border-radius: 34px;
  }

  .slider:before {
    height: 28px;
    width: 28px;
    left: 7px;
    bottom: 3px;
  }
}
