body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to right, #a1c4fd, #c2e9fb);
  margin: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 40px 20px; /* extra padding for mobile spacing */
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-y: auto;
}

.container {
  background: #ffffffcc;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
  max-width: 400px; /* adjust as needed */
}

.search-box {
  margin-bottom: 1rem;
}

input {
  padding: 8px;
  width: 65%;
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  padding: 8px 12px;
  margin-left: 5px;
  border: none;
  background-color: #0077ff;
  color: white;
  border-radius: 8px;
  cursor: pointer;
}

.weather-info {
  margin-top: 1rem;
  font-size: 16px;
}

.weather-info img {
  background-color: #687fda;
  border-radius: 50%;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.history {
  margin-top: 20px;
  text-align: left;
}

#historyList {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#historyList li {
  padding: 6px 10px;
  margin-bottom: 4px;
  background-color: #f0f8ff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

#historyList li:hover {
  background-color: #cce6ff;
}

#clearHistoryBtn {
  margin-top: 10px;
  padding: 6px 12px;
  background-color: #ff4d4d;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

#clearHistoryBtn:hover {
  background-color: #cc0000;
}

/* 5-Day Forecast Styling */
.forecast {
  margin-top: 20px;
}

.forecast-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.forecast-card {
  background-color: #f0f0f0;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  width: 120px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.forecast-card img {
  width: 60px;
  height: 60px;
}

/* Mobile Friendly Responsive Design */
@media (max-width: 480px) {
  .container {
    width: 100%;
    max-width: 360px;
    padding: 1.5rem;
    box-sizing: border-box;
  }

  input {
    width: 100%;
    margin-bottom: 10px;
  }

  button {
    width: 100%;
    margin: 0;
    margin-top: 5px;
  }

  .forecast-container {
    flex-direction: column;
    align-items: center;
  }

  .forecast-card {
    width: 100%;
    max-width: 300px;
  }

  .history {
    text-align: center;
  }

  #historyList li {
    text-align: center;
  }

  #clearHistoryBtn {
    width: 100%;
  }
}
