body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(to right, #4facfe, #00f2fe);
  color: white;
  transition: background 0.5s ease, color 0.5s ease;
}

.weather-app {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.8s ease-out;
  max-width: 90vw;
}

@keyframes fadeIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

input {
  padding: 10px;
  border: none;
  border-radius: 8px;
  margin-right: 10px;
  width: 200px;
  outline: none;
  transition: box-shadow 0.3s;
}
input:focus {
  box-shadow: 0 0 8px #fff;
}

button {
  padding: 10px 20px;
  border: none;
  background: #ff7e5f;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
}
button:hover {
  background: #feb47b;
}
button::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.3);
  width: 100%;
  height: 100%;
  top: 0;
  left: -100%;
  transition: left 0.4s;
}
button:hover::after {
  left: 0;
}

#weatherResult {
  margin-top: 20px;
  font-size: 20px;
  animation: fadeIn 0.8s ease;
}
#weatherResult div:first-child {
  animation: float 3s ease-in-out infinite;
}

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

/* Dark mode toggle */
.switch {
  position: absolute;
  top: 20px;
  right: 20px;
}
.switch input {
  display: none;
}
.slider {
  width: 50px;
  height: 24px;
  background: #ccc;
  border-radius: 24px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s;
}
.slider:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}
input:checked + .slider {
  background: #666;
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* Dark mode body styles */
body.dark {
  background: #1e1e2f;
  color: #f0f0f0;
}
body.dark input {
  background: #333;
  color: #fff;
}
body.dark .weather-app {
  background: rgba(255, 255, 255, 0.05);
}
