@import url("https://fonts.googleapis.com/css2?family=Bitcount:wght@100..900&family=Roboto:ital,wght@0,100..900;1,100..900&display=swap");

:root {
  --main-border: 1px solid rgba(52, 180, 201, 0.56);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-size: 62.5%;
  font-family: "Roboto", sans-serif;
  color: #fff;

  text-shadow: 0px 0.5px 1px #000000;
  background-image: url(https://images.unsplash.com/photo-1509803874385-db7c23652552?q=80&w=1770&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D);
}

a {
  text-decoration: none;
  color: inherit;
}

/* //// */

header {
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main {
  width: 95vw;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;

  margin-top: 5rem;
  justify-content: flex-start;
  padding: 2rem 0;
  background: rgba(98, 213, 231, 0.15);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6.6px);
  -webkit-backdrop-filter: blur(6.6px);
  border: var(--main-border);
}

h1 {
  font-size: 3rem;
}

.main__container {
  display: flex;
  flex-direction: row;
  width: 100%;
}

.sidebar__container {
  flex: 1.5;
}

sup {
  font-size: 0.4em;
  vertical-align: super;
}

.search__form,
.search__input {
  width: 100%;
}

.search__input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.5rem 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  border: var(--main-border);
  border-radius: 1.5rem;
  outline: none;
  transition: border 0.3s ease;
  background: #fff
    url("data:image/svg+xml,%3Csvg fill='gray' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 105.293 14.293l5.207 5.207 1.414-1.414-5.207-5.207A8 8 0 0010 2zm0 2a6 6 0 110 12A6 6 0 0110 4z'/%3E%3C/svg%3E")
    no-repeat 0.75rem center;
  background-size: 1.2rem;
}

.search__form:focus {
  border-color: #007bff;
}
.main__info--icon-container {
  display: flex;
  flex-direction: row-reverse;
}

.places__container {
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 1.2rem;
  overflow: auto;
}

.places__item,
.places__geolocation {
  cursor: pointer;
  transition: background 0.3s ease;
  border-radius: 2rem;
  white-space: nowrap;
  padding: 0.5rem 1.5rem;
  margin: 0.1rem 0;
}

.places__item:hover,
.places__geolocation:hover {
  background: #91d5f585;
  border: var(--main-border);
}

.place--selected {
  background: #91d5f54a;
  border: var(--main-border);
}

.weather-container {
  flex: 4;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  transition: opacity 0.5s ease, transform 0.5s ease;

  border-right: var(--main-border);
  border-left: var(--main-border);
  padding: 1.2rem;
}

.main__info {
  font-size: 1.6rem;
  display: flex;
  gap: 0.5rem;
  flex-direction: column;
  align-items: center;
}

.main__info--city {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.main__info--icon-container {
  margin-top: 1.5rem;
}

.main__info--icon {
  width: 8rem;
}

.main__info--temp {
  font-size: 5rem;
  font-weight: 700;
}

.main__info--conditions,
.main__info--description {
  font-size: 1.3rem;
  text-align: center;
}

.main__info--highandlow,
.main__info--rain,
.main__info--alert {
  font-size: 1rem;
}

.main__info--alert {
  color: red;
}

.main__forecast {
  flex: 1;
  display: flex;
  gap: 1rem;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem;
}

.forecast__card--container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.forecast__card {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  border: 1px solid rgba(52, 180, 201, 0.56);
  border-radius: 10px;
  padding: 0 0.5rem;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.forecast__item--icon {
  width: 40px;

  object-fit: contain;
  aspect-ratio: 1 / 1;
}

.forecast__item--hour,
.forecast__item--temp {
  font-size: 0.8rem;
  font-weight: 700;
}

.hidden {
  display: none;
}

@media (max-width: 830px) {
  body {
    background-color: lightblue;
  }

  main {
    margin-top: 1rem;
    height: 100%;
    gap: 0;
  }

  h1 {
    margin-top: 1.5rem;
  }
  .mobile--hidden {
    display: none;
  }

  .main__container {
    flex-direction: column;
  }

  .places__container {
    max-height: 9rem;
    overflow: hidden;
  }
}

.unit-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: sans-serif;
  font-size: 1rem;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  font-size: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* Checked state */

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