/* === Global Styles === */
body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(135deg, #83a4d4, #b6fbff);
  min-height: 100vh;
  color: #333;
  display: flex;
  flex-direction: column;
  transition: background 0.5s ease-in-out;
}

.weather-container {
  max-width: 100%;
  padding: 20px;
  display: grid;
  gap: 20px;
  flex: 1;
  animation: fadeIn 1s ease-in-out;
}

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

h1 {
  font-size: 2.5rem;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin: 0 0 20px;
}

/* === Search Bar === */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 800px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-bar input,
.search-bar select {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1rem;
}

.search-bar input::placeholder {
  color: #ccc;
}

.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.3);
}

.search-bar button {
  padding: 12px 20px;
  background: #00bcd4;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.2s, background 0.2s;
}

.search-bar button:hover,
.search-bar button:focus {
  background: #0196ab;
  transform: scale(1.05);
}

/* === Recent Searches === */
.recent-searches {
  max-width: 800px;
  margin: 20px auto;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.recent-searches h2 {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 10px;
}

.recent-searches ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.recent-searches li button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.2s;
}

.recent-searches li button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* === Weather Box === */
.weather-content {
  max-width: 800px;
  margin: 0 auto;
}

.weather-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.weather-box h2 {
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 10px;
}

.weather-box img {
  width: 100px;
  height: auto;
  margin: 10px 0;
  transition: transform 0.3s ease;
}

.weather-box img:hover {
  transform: scale(1.1);
}

.weather-box p {
  color: #fff;
  font-size: 1.1rem;
  margin: 6px 0;
}

/* === Details Box === */
.details-box {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  margin-top: 15px;
  padding: 15px;
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
}

.details-box h3 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: #fff;
}

/* === Forecasts === */
.hourly-forecast,
.forecast {
  max-width: 1200px;
  margin: 20px auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.hourly-day,
.forecast-day {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  flex: 1;
  min-width: 100px;
  transition: transform 0.3s;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hourly-day:hover,
.forecast-day:hover {
  transform: translateY(-5px);
}

.hourly-day img,
.forecast-day img {
  width: 50px;
  margin: 5px 0;
}

.hourly-day h4,
.forecast-day h4 {
  font-size: 1rem;
  margin-bottom: 5px;
}

.hourly-day p,
.forecast-day p {
  font-size: 0.9rem;
}

/* === Messages and Footer === */
.error-message {
  color: #ff6b6b;
  font-size: 0.95rem;
  text-align: center;
  margin: 10px 0;
  display: none;
}

.loading {
  display: none;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-size: 1rem;
  margin: 20px auto;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 4px solid #fff;
  border-top: 4px solid #00bcd4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Accessibility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === Footer === */
footer {
  background: rgba(2, 136, 209, 0.8);
  color: #fff;
  text-align: center;
  padding: 15px;
  margin-top: auto;
}

footer a {
  color: #b3e5fc;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 750px) {
  .search-bar {
    flex-direction: column;
  }

  .search-bar input,
  .search-bar select,
  .search-bar button {
    width: 90%;
  }

  .hourly-day,
  .forecast-day {
    min-width: 80px;
  }
}
