*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Merriweather Sans", sans-serif;
}

:root {
  --colorDark1: #112d4e;
  --colorDark2: #3f72af;
  --colorLight1: #dbe2ef;
  --colorLight2: #f9f7f7;
}

body {
  max-width: 100vw;
  min-height: 100vh;
  color: var(--colorLight2);
  background-color: #112d4e;
  background-image: linear-gradient(160deg, #112d4e 0%, #3f72af 100%);
}

/* header and Tab styles */

h1 {
  text-align: center;
  margin-block: 2rem;
  text-transform: uppercase;
  word-spacing: 2px;
  letter-spacing: 1.75px;
}

.tab-container {
  width: 90%;
  margin: 0 auto;
  margin-top: 4rem;
  max-width: 550px;
  display: flex;
  justify-content: space-between;
}

.tab {
  cursor: pointer;
  font-size: 0.875rem;
  letter-spacing: 1.75px;
  padding: 5px 8px;
}

.tab.current-tab {
  background-color: rgba(219, 226, 239, 0.5);
  border-radius: 4px;
}

.weather-container {
  margin-block: 4rem;
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.75rem;
  }

  .tab-container {
    margin-top: 2rem;
    width: 80%;
  }

  .tab {
    font-size: 0.75rem;
  }
}

/* button */
.btn {
  all: unset;
  font-size: 0.85rem;
  text-transform: uppercase;
  padding: 10px 30px;
  border-radius: 5px;
  cursor: pointer;
  background-color: var(--colorDark2);
}

.sub-container {
  width: 90%;
  margin: 0 auto;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* user weather styles */
.grant-location-container {
  display: none;
}

.grant-location-container.active {
  display: flex;
}

.grant-location-container img {
  margin-bottom: 2rem;
}

.grant-location-container p:first-of-type {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
}

.grant-location-container p:last-of-type {
  font-size: 0.85rem;
  font-weight: 300;
  margin-top: 0.75rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.75px;
  text-align: center;
}

.loading-container {
  display: none;
}

.loading-container.active {
  display: flex;
}

.loading-container p {
  text-transform: uppercase;
}

.api-error-container {
  display: none;
}

.api-error-container.active {
  display: flex;
  gap: 1rem 0;
}

.api-error-container p {
  text-align: center;
}

.api-error-container img {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.user-info-container {
  display: none;
}

.user-info-container p {
  font-size: 1.5rem;
  font-weight: 200;
}

.user-info-container img {
  width: 90px;
  height: 90px;
}

.name {
  display: flex;
  align-items: center;
  gap: 0 0.5rem;
  margin-bottom: 1rem;
}

.name p {
  font-size: 2rem;
}

.name img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.user-info-container p[data-temp] {
  font-size: 2.75rem;
  font-weight: 700;
}

.user-info-container.active {
  display: flex;
}

.parameter-container {
  width: 90%;
  margin: 0 auto;
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.parameter {
  width: 30%;
  max-width: 200px;
  background-color: rgba(219, 226, 239, 0.5);
  border-radius: 5px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 5px 0;
}

.parameter img {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

.parameter-title {
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
}

.parameter-value {
  font-size: 1rem;
  font-weight: 200;
}

@media (max-width: 768px) {
  .parameter-container {
    flex-direction: column;
    align-items: center;
  }

  .parameter {
    width: 100%;
  }
}

/* search weather styles */
.form-container {
  width: 90%;
  max-width: 550px;
  margin: 0 auto;
  margin-bottom: 3rem;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0 10px;
}

.form-container.active {
  display: flex;
}

.form-container input {
  all: unset;
  width: calc(100% - 80px);
  height: 40px;
  padding: 0 20px;
  background-color: rgba(219, 226, 239, 0.5);
  border-radius: 10px;
}

.form-container input:focus {
  outline: 3px solid rgba(255, 255, 255, 0.7);
}

.form-container input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.form-container .btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: unset;
  border-radius: 100%;
}

.form-container .btn img {
  object-fit: contain;
}
