/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 50px;
  color: #333;

  /* Animated gradient background */
  background: linear-gradient(270deg, #e3f2fd, #fce4ec, #f3e5f5);
  background-size: 600% 600%;
  animation: gradientMove 15s ease infinite;

  /* When background images are added from JS */
  background-size: cover;
  background-position: center;
  position: relative;
}

/* Gradient overlay (for blending background images with gradient) */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(227, 242, 253, 0.6),
    rgba(252, 228, 236, 0.6)
  );
  z-index: 0;
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  padding: 30px 35px;
  border-radius: 20px;
  text-align: center;
  width: 90%;
  max-width: 600px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* Heading */
.container h1 {
  font-size: 30px;
  margin-bottom: 20px;
  color: #5e548e;
}

/* Search Box */
.search-box {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search-box input {
  flex: 1;
  padding: 12px;
  border: 1px solid #d1c4e9;
  border-radius: 14px;
  background: #fafafa;
  font-size: 16px;
  outline: none;
}

.search-box button,
#toggleDark {
  padding: 12px 16px;
  border: none;
  background: #9fa8da;
  color: white;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.search-box button:hover,
#toggleDark:hover {
  background: #7986cb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Dark Mode */
.dark {
  background: #1c1c2b !important;
  color: #f3f3f3;
}

.dark .container {
  background: rgba(34, 34, 44, 0.95);
}

/* Weather Info */
.weather-info {
  margin-top: 20px;
}

.weather-info h2 {
  font-size: 28px;
  margin-bottom: 5px;
  color: #424242;
}

.weather-info p {
  text-transform: capitalize;
  font-size: 18px;
  margin-bottom: 10px;
  color: #616161;
}

.weather-info h3 {
  font-size: 52px;
  font-weight: bold;
  margin: 12px 0;
  color: #303f9f;
}

.weather-info img {
  width: 100px;
  margin: 10px 0;
}

/* Forecast Grid */
.forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 18px;
  margin-top: 25px;
}

.forecast-day {
  background: #f3f2f7;
  border-radius: 16px;
  padding: 15px;
  text-align: center;
  font-size: 15px;
  color: #444;
  transition: all 0.3s ease;
}

.forecast-day:hover {
  transform: translateY(-6px);
  background: #e1e4f3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.forecast-day img {
  width: 50px;
  margin: 8px 0;
}

.forecast-day p {
  margin: 6px 0;
  font-weight: 500;
}

/* Error Message */
.error {
  margin-top: 12px;
  color: #e53935;
  font-weight: bold;
}

/* Fade Animation */
.weather-info,
.forecast-day {
  animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animated gradient background */
@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
#rainCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* So clicks go through */
  z-index: 0;
}
/* ===== MOBILE STYLING ===== */
@media (max-width: 768px) {
  .container {
    max-width: 90%;
    padding: 20px;
  }

  .container h1 {
    font-size: 24px;
  }

  .search-box {
    flex-direction: column;
    gap: 8px;
  }

  .search-box input,
  .search-box button,
  #toggleDark {
    width: 100%;
  }

  .weather-info h3 {
    font-size: 40px;
  }

  .forecast {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 10px;
  }

  .forecast-day {
    padding: 10px;
    font-size: 13px;
  }

  .forecast-day img {
    width: 40px;
  }
}

@media (max-width: 480px) {
  .container h1 {
    font-size: 20px;
  }

  .weather-info h2 {
    font-size: 20px;
  }

  .weather-info h3 {
    font-size: 32px;
  }
}
