/* Base Styles */
body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  transition: all 0.5s ease;
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Weather App Container */
.weather-app {
  background: rgba(255, 255, 255, 0.85);
  max-width: 800px;
  margin: 45px auto;
  box-shadow: 0 30px 50px rgba(65, 50, 100, 0.2);
  border-radius: 16px;
  padding: 40px;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

/* Background Animations */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.6;
}

/* Day/Night Backgrounds */
body.day {
  background: linear-gradient(135deg, #72b5f7 0%, #e0f2fe 100%);
}

body.night {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
}

/* Weather Specific Backgrounds */
body.clear.day::before {
  background: url("https://assets.codepen.io/13471/sky-day-clear.jpg") no-repeat
    center center;
  background-size: cover;
}

body.clear.night::before {
  background: url("https://assets.codepen.io/13471/sky-night-clear.jpg")
    no-repeat center center;
  background-size: cover;
}

body.few-clouds.day::before {
  background: url("https://assets.codepen.io/13471/sky-day-few-clouds.jpg")
    no-repeat center center;
  background-size: cover;
}

body.few-clouds.night::before {
  background: url("https://assets.codepen.io/13471/sky-night-few-clouds.jpg")
    no-repeat center center;
  background-size: cover;
}

body.scattered-clouds.day::before,
body.broken-clouds.day::before {
  background: url("https://assets.codepen.io/13471/sky-day-cloudy.jpg")
    no-repeat center center;
  background-size: cover;
}

body.scattered-clouds.night::before,
body.broken-clouds.night::before {
  background: url("https://assets.codepen.io/13471/sky-night-cloudy.jpg")
    no-repeat center center;
  background-size: cover;
}

body.rain.day::before,
body.rain.night::before {
  background: url("https://assets.codepen.io/13471/sky-rain.jpg") no-repeat
    center center;
  background-size: cover;
}

body.thunderstorm.day::before,
body.thunderstorm.night::before {
  background: url("https://assets.codepen.io/13471/sky-thunderstorm.jpg")
    no-repeat center center;
  background-size: cover;
}

body.snow.day::before,
body.snow.night::before {
  background: url("https://assets.codepen.io/13471/sky-snow.jpg") no-repeat
    center center;
  background-size: cover;
}

body.mist.day::before,
body.mist.night::before {
  background: url("https://assets.codepen.io/13471/sky-mist.jpg") no-repeat
    center center;
  background-size: cover;
}

/* Animated Elements */
.cloud {
  position: fixed;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  z-index: -1;
  animation: moveCloud linear infinite;
}

@keyframes moveCloud {
  from {
    transform: translateX(-100px);
  }
  to {
    transform: translateX(calc(100vw + 100px));
  }
}

.rain {
  position: fixed;
  width: 2px;
  background: rgba(255, 255, 255, 0.5);
  animation: rain linear infinite;
  z-index: -1;
}

@keyframes rain {
  from {
    transform: translateY(-100px);
  }
  to {
    transform: translateY(100vh);
  }
}

.snow {
  position: fixed;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  z-index: -1;
  animation: snow linear infinite;
}

@keyframes snow {
  from {
    transform: translateY(-100px) rotate(0deg);
  }
  to {
    transform: translateY(100vh) rotate(360deg);
  }
}

.star {
  position: fixed;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  z-index: -1;
  animation: twinkle 3s infinite alternate;
}

@keyframes twinkle {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

/* Header Styles */
header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0 0 30px 0;
}

.search-form-input {
  background-color: rgba(249, 247, 254, 0.8);
  border: none;
  border-radius: 6px;
  width: 75%;
  font-size: 16px;
  padding: 15px 20px;
  transition: all 0.3s ease;
}

.search-form-input:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(136, 93, 241, 0.3);
}

.search-form-button {
  background: #885df1;
  padding: 15px 30px;
  border: none;
  font-size: 16px;
  margin-left: 5px;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-form-button:hover {
  background: #7b4cf0;
  transform: translateY(-2px);
}

/* Main Content Styles */
main {
  padding: 30px 0;
}

.weather-app-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.weather-app-city {
  margin: 0;
  font-size: 42px;
  line-height: 48px;
  font-weight: 700;
  color: #1e293b;
}

body.night .weather-app-city {
  color: #f8fafc;
}

.weather-app-details {
  font-size: 16px;
  color: rgba(39, 33, 66, 0.7);
  line-height: 24px;
  font-weight: 500;
}

body.night .weather-app-details {
  color: rgba(248, 250, 252, 0.7);
}

.weather-app-details strong {
  color: #f65282;
}

.weather-app-temperature-container {
  display: flex;
  align-items: center;
}

.weather-app-icon {
  width: 100px;
  height: 100px;
}

.weather-app-temperature {
  font-size: 88px;
  line-height: 88px;
  font-weight: bold;
  color: #1e293b;
}

body.night .weather-app-temperature {
  color: #f8fafc;
}

.weather-app-unit {
  margin-top: 6px;
  font-size: 28px;
  color: #1e293b;
}

body.night .weather-app-unit {
  color: #f8fafc;
}

/* Forecast Styles */
.weather-forecast {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  flex-wrap: wrap;
}

.weather-forecast-day {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin: 5px;
  text-align: center;
  flex: 1;
  min-width: 120px;
  transition: all 0.3s ease;
}

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

.weather-forecast-date {
  color: rgba(39, 33, 66, 0.8);
  font-size: 16px;
  line-height: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}

body.night .weather-forecast-date {
  color: rgba(248, 250, 252, 0.8);
}

.weather-forecast-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto;
}

.weather-forecast-temperatures {
  color: #f65282;
  margin-top: 10px;
  display: flex;
  justify-content: center;
  font-size: 14px;
}

.weather-forecast-temperature {
  padding: 0 5px;
}

/* Footer Styles */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding: 30px 0 0 0;
  text-align: center;
  font-size: 14px;
  color: rgba(39, 33, 66, 0.7);
}

body.night footer {
  color: rgba(248, 250, 252, 0.7);
}

footer a {
  color: #885df1;
  text-decoration: none;
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .weather-app {
    margin: 20px;
    padding: 20px;
  }

  .weather-app-data {
    flex-direction: column;
    text-align: center;
  }

  .weather-app-temperature-container {
    margin-top: 20px;
  }

  .weather-forecast {
    flex-direction: column;
  }

  .weather-forecast-day {
    margin-bottom: 10px;
  }
}
