/* ===== Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background 0.5s ease, color 0.5s ease;
}

/* ===== Animated Gradient Background ===== */
body.light {
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
  color: #111;
}

body.dark {
  background: linear-gradient(-45deg, #1e3c72, #2a5298, #1b1b2f, #252542);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: #fff;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== Container ===== */
.weather-app {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 30px 25px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  transition: background 0.5s ease;
}

/* ===== Header ===== */
.weather-app header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.weather-app h1 {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.toggle-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 12px;
  background: #ff9800;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

.toggle-btn:hover {
  background: #e68900;
}

/* ===== Search Box ===== */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 12px 15px;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 1rem;
}

.search-box button {
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #00d4ff;
  color: #111;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
}

.search-box button:hover {
  background: #00aacc;
}

/* ===== Weather Card ===== */
.weather-info {
  display: none;
  margin-top: 20px;
  animation: fadeIn 0.5s ease-in-out;
}

.weather-info.active {
  display: block;
}

.weather-info img {
  width: 120px;
  margin-bottom: 10px;
}

.weather-info h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.weather-info p {
  font-size: 1rem;
  margin: 5px 0;
  opacity: 0.9;
}

.extra-info {
  margin-top: 10px;
}

.extra-info p {
  margin: 4px 0;
  font-size: 0.95rem;
}

/* ===== Error Message ===== */
.error {
  margin-top: 15px;
  font-size: 0.95rem;
  color: #ff4d4d;
}

/* ===== Footer ===== */
footer {
  margin-top: 25px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile Responsiveness ===== */
@media (max-width: 500px) {
  .weather-app {
    padding: 20px 15px;
  }

  .weather-app h1 {
    font-size: 1.4rem;
  }

  .search-box {
    flex-direction: column;
  }

  .search-box button {
    width: 100%;
  }

  .weather-info img {
    width: 90px;
  }

  .weather-info h2 {
    font-size: 1.5rem;
  }
}