*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  width: 100vw;
  transition: background 0.5s ease;
  font-family: "Red Hat Display", sans-serif;
  background: linear-gradient(135deg, #89cff0, #a18cd1, #fbc2eb);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.container {
  width: min(90vw, 450px);
  height: auto;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  padding: 1rem;
}
.city-search{
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}
input {
  margin: 1rem 0;
  width: 300px;
  height: 50px;
  border-radius: 0.6rem;
  border: none;
  padding: 1rem;
  font-size: 1.2rem;
}
.search-btn{
  width: 80px;
  height: 50px;
  border-radius: 0.6rem;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: black;
  font-weight: 700;
  padding: 0.8rem;
  font-size: 0.9rem;
  align-items: center;
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.6s ease;
}
.search-btn:hover {
  background-color: #a18cd1;
  color: white;
}
[class*="BG"] {
  background-size: 400% 400%;
  animation: gradientShift 18s linear infinite;
  transition: background 0.6s ease;
}

/* Güneşli – mavi gökyüzü + sıcak güneş ışığı */
.sunnyBG {
  background: linear-gradient(135deg, #4facfe, #87e0ff, #ffe29f);
}

/* Büyük oranda açık */
.mainlyClearBG {
  background: linear-gradient(135deg, #6fb1fc, #c2e9fb, #fff1b8);
}

/* Parçalı bulutlu */
.partlyCloudBG {
  background: linear-gradient(135deg, #8ec5fc, #d9e4f5, #fef3c7);
}

/* Çok bulutlu */
.cloudyBG {
  background: linear-gradient(135deg, #b0bec5, #dfe6eb);
}

/* Sisli */
.fogBG {
  background: linear-gradient(135deg, #dde5eb, #f7f9fb);
}

/* Donan sis (Rime Fog) – gündüz */
.depositingRimeFogBG {
  background: linear-gradient(135deg, #e6eef3, #cfd9df);
}

/* Hafif çiseleme (Drizzle) – gündüz */
.lightDrizzleBG {
  background: linear-gradient(135deg, #89f7fe, #66a6ff);
}

/* Hafif yağmur */
.lightRainBG {
  background: linear-gradient(135deg, #5f9cff, #89f7fe);
}

/* Kar yağışı */
.snowfallBG {
  background: linear-gradient(135deg, #cfd9df, #e2ebf0, #f5f7fa);
}

/* Gök gürültülü fırtına */
.thunderstormBG {
  background: linear-gradient(135deg, #3a4f7a, #141e30);
}

/* Varsayılan gündüz */
.defaultBG {
  background: linear-gradient(135deg, #6dd5ed, #2193b0);
}

/* Açık gece */
.sunnyNightBG {
  background: linear-gradient(135deg, #0b132b, #1c2541, #2a2a72);
}

/* Büyük oranda açık gece */
.mainlyClearNightBG {
  background: linear-gradient(135deg, #141e30, #243b55);
}

/* Parçalı bulutlu gece */
.partlyCloudNightBG {
  background: linear-gradient(135deg, #232526, #414345);
}

/* Çok bulutlu gece */
.cloudyNightBG {
  background: linear-gradient(135deg, #2c2f33, #3e4147);
}

/* Sisli gece */
.fogNightBG {
  background: linear-gradient(135deg, #1c1c1c, #3a3a3a);
}

/* Donan sis (Rime Fog) – gece */
.depositingRimeFogNightBG {
  background: linear-gradient(135deg, #2f3e46, #354f52);
}

/* Hafif çiseleme (Drizzle) – gece */
.lightDrizzleNightBG {
  background: linear-gradient(135deg, #1f4037, #0f2027);
}

/* Hafif yağmur gece */
.lightRainNightBG {
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

/* Kar yağışlı gece */
.snowfallNightBG {
  background: linear-gradient(135deg, #2b5876, #4e4376);
}

/* Gök gürültülü fırtına gece */
.thunderstormNightBG {
  background: linear-gradient(135deg, #0f0c29, #302b63, #1b1b3a);
}

/* Varsayılan gece */
.defaultNightBG {
  background: linear-gradient(135deg, #020024, #090979);
}

.inf-modul {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 350px;
  height: 350px;
  gap: 0.5rem;
  padding-top: 0.5rem;
}
.inf-modul1 {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-size: 1.9rem;
  font-weight: 500;
  position: relative;
  margin-bottom: 3.5rem;
}
.temp {
  position: relative;
  right: 1.3rem;
}
.feels-like {
  font-size: 1rem;
  position: absolute;
  right: 0.1rem;
}
.inf-modul2 {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  margin-bottom: 0.5rem;
}
.inf-modul3 {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-size: 1.8rem;
  gap: 2rem;
}
.weather-icon {
  margin-right: 2.6rem;
  position: relative;
  width: 60px;
  height: 100px;
}
.condition {
  margin-left: 0;
}
.weather-icon img {
  width: 80px;
  height: auto;
  display: block;
}

.weather-icon i {
  font-size: 80px;
  color: white;
  animation: float 2.5s ease-in-out infinite;
  transition: color 0.5s ease, filter 0.5s ease;
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
  100% {
    transform: translateY(0);
  }
}

/* ZAMAN */
.icon-day {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.icon-night {
  color: #e0efff !important;
  filter: drop-shadow(0 0 8px rgba(120, 160, 255, 0.4));
}

/* HAVA DURUMU RENKLERİ */

/* Güneş */
.icon-sunny.icon-day {
  color: #fbff00;
  filter: drop-shadow(0 0 6px rgba(255, 240, 180, 0.5));
}
.icon-night {
  color: #e0efff;
  filter: drop-shadow(0 0 6px rgba(150, 180, 255, 0.4));
}

/* Kar */
.icon-snowy {
  color: #ffffff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.5));
}

/* Fırtına */
.icon-storm {
  color: #ffdd55;
  filter: drop-shadow(0 0 6px rgba(255, 220, 80, 0.5));
}

/* Yağmur animasyonu */
.rain {
  animation: rain 1s linear infinite;
}

/* BULUT — gündüz & gece */
.icon-cloudy.icon-day {
  color: #b0bec5;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}
.icon-cloudy.icon-night {
  color: #8a8f97;
  filter: drop-shadow(0 0 4px rgba(150, 150, 200, 0.2));
}

/* SIS */
.icon-foggy.icon-day {
  color: #c9cdd1;
  filter: drop-shadow(0 0 3px rgba(200, 200, 200, 0.3));
}
.icon-foggy.icon-night {
  color: #7e7f84;
  filter: drop-shadow(0 0 3px rgba(180, 180, 200, 0.2));
}

/* YAĞMUR */
.icon-rainy.icon-day {
  color: #4fc3f7;
  filter: drop-shadow(0 0 4px rgba(100, 180, 255, 0.3));
}
.icon-rainy.icon-night {
  color: #2e88e0;
  filter: drop-shadow(0 0 4px rgba(100, 150, 255, 0.2));
}

@keyframes rain {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(10px);
  }
}

/* Fırtına animasyonu */
.thunder {
  animation: flash 1.5s infinite;
}

@keyframes flash {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.partly-sun {
  position: absolute;
  display: inline-block;
  font-size: 60px;
  top: 0;
  left: 1.2rem;
  color: #ffd93d !important;
  filter: drop-shadow(0 0 6px rgba(255, 220, 120, 0.6));
  animation: slowRotate 20s linear infinite !important;
  transform-origin: 50% 50%;
}
.partly-moon {
  position: absolute;
  display: inline-block;
  font-size: 58px;
  top: 0;
  left: 1.2rem;
  color: #e0efff;
  filter: drop-shadow(0 0 6px rgba(150, 180, 255, 0.4));
}

.partly-cloud {
  position: absolute;
  font-size: 70px;
  bottom: 0;
  right: 0;
  color: #ffffff;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.4));
}

@keyframes slowRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.seven-days {
  width: 140px;
  height: 20px;
  border-radius: 0.2rem;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: black;
  font-weight: 700;
  padding: 0.8rem;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  align-items: center;
  display: flex;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.6s ease;
}
.seven-days:hover {
  background-color: #a18cd1;
  color: white;
}
.weekly-forecast {
   width: min(90vw, 450px);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: black;
  margin-top: 1rem;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  padding: 1rem;
  max-height: 0;
  opacity: 0;
  transform: translateY(20px);
  overflow: hidden;
  transition: max-height 0.8s ease, opacity 0.8s ease, transform 0.8s ease;
}
.weekly-forecast.active {
  max-height: 600px;
  opacity: 1;
  transform: translateY(0);
}
.hidden {
  display: none;
}
.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.9rem;
  gap: 0.7rem;
}
.day-card p {
  margin: 0;
}
.day-card:hover {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  transition: 0.3s;
}
.day-icon {
  color: white;
  font-size: 1.6rem;
  margin: 0.3rem 0;
  min-height: 28px;
}
.day-temp {
  min-height: 18px;
  padding: 0 0.5rem;
}
.day-desc {
  height: 32px;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.snow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  color: white;
  font-size: 1em;
  opacity: 0.8;
  user-select: none;
  pointer-events: none;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  0% {
    transform: translateY(0) translateX(0);
  }
  100% {
    transform: translateY(100vh) translateX(50px);
  }
}
.rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
}
.raindrop {
  position: absolute;
  top: -20px;
  width: 2px;
  height: 20px;
  background: rgba(255, 255, 255, 0.6);
  animation: rain-fall linear infinite;
  will-change: transform;
}
@keyframes rain-fall {
  from {
    transform: translateY(0) translateX(0);
  }
  to {
    transform: translateY(110vh) translateX(-20px);
  }
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.star {
  position: absolute;
  color: white;
  opacity: 0;
  animation: twinkle infinite ease-in-out;
}
@keyframes twinkle {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.error-message {
  background-color: #ff4c4c;
  color: white;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  text-align: center;
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
  }
}
