/* Скидання базових відступів і паддінгів */
h1,
h2,
p,
input,
button,
option {
  margin: 0;
  padding: 0;
}

/* Резервація місця для скрол-бару */
html {
  overflow-y: scroll;
}

/* Кнопки */
button {
  color: currentColor;
  cursor: pointer;
}

/* Основні стилі body */
body {
  margin: 0;
  padding: 0;
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #c7c7c7;
  text-align: center;
  background-color: #add8e6;
  background-image: url("./images/backgraund-webP2.webp");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  min-height: 100px;
}

/* Послідовні елементи */
a,
button,
input,
input::placeholder {
  transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    border 250ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
}

/* Контейнер */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  text-align: center;
  max-width: 375px;
  padding: 0 16px;
}

/* Секції */
section {
  padding: 64px 0;
}

/* Заголовки */
.title-h {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  color: #1e3a8a;
  padding: 20px 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2);
}

/* Контейнери погоди */
.weather-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 300px;
}

/* Пошук */
.search {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  position: relative;
}

/* Поля та кнопки */
.input-search,
.button-search,
.select-lang {
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
  box-shadow: none;
}

.button-search {
  background-color: #2563eb;
  color: #fff;
}

.button-search:hover {
  background-color: #1d4ed8;
}

/* Дні */
.days {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 25px;
  max-width: 100%;
  height: auto;
}

.day {
  position: relative;
  background: #f0f4f8;
  border-radius: 12px;
  overflow: hidden;
  padding: 15px;
  cursor: pointer;
  border: 2px solid #2563eb;
  transition: transform 0.3s, box-shadow 0.3s;
}

.day:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.day-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-date {
  font-weight: 600;
  font-size: 18px;
  color: #111827;
  padding-bottom: 6px;
}

.day-desc {
  font-size: 14px;
  color: #4b5563;
}

.day-temp {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  font-size: 16px;
  color: #1f2937;
}

.now {
  font-size: 1.4rem;
  color: #2563eb;
  padding-bottom: 6px;
}

.minmax {
  color: #6b7280;
}

.day-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #374151;
}

.day-meta div {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Автодоповнення */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  border-top: none;
  background: #3b648b;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 0 0 6px 6px;
  width: 226px;
}

.autocomplete-item {
  cursor: pointer;
  padding: 8px 1px;
  transition: background 0.2s;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: #f0f0f0;
  color: #111827;
}

.autocomplete-input:focus {
  outline: none;
  border-color: #999;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
}

.footer-p {
  padding: 20px 0px;
  font-size: small;
  color: #ffffff;
}

/* Медіа 768px */
@media screen and (min-width: 768px) {
  .container {
    max-width: 768px;
    padding: 0 20px;
  }

  section {
    padding: 40px 0;
  }

  .search {
    justify-content: space-between;
    width: 100%;
  }

  .input-search {
    width: 70%;
  }

  .button-search {
    width: 28%;
  }

  .select-lang {
    margin-left: auto;
  }

  .days {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .day {
    flex: 1 1 calc(33.333% - 20px);
    max-width: 200px;
    box-sizing: border-box;
  }

  #hourlyChart {
    max-width: 700px;
    max-height: 300px;
  }

  .autocomplete-list {
    width: 542px;
  }
}

/* Медіа 1280px */
@media screen and (min-width: 1280px) {
  .container {
    min-width: 1280px;
    padding: 0 25px;
  }

  section {
    padding: 50px 0;
  }

  .days {
    justify-content: space-between;
    height: auto;
  }

  .day {
    width: 250px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
  }

  .day-top {
    margin-bottom: 40px;
    gap: 60px;
  }

  .day-temp {
    justify-content: center;
    gap: 80px;
  }

  #hourlyChart {
    max-width: 1200px;
    max-height: 300px;
  }

  .autocomplete-list {
    width: 908px;
  }
}
