/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(to right, #2b5876, #4e4376);
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 900px;
  width: 100%;
  padding: 30px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  animation: fadeIn 1s ease-in-out;
}

h1 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 2.5rem;
  text-shadow: 0 0 10px #00f0ff;
}

/* Live Clock */
.live-clock {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #00ffcc;
  text-shadow: 0 0 8px #00ffcc;
  animation: pulse 1s infinite alternate;
}

/* Search Bar */
.search-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.search-bar input {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 1rem;
  width: 60%;
  transition: 0.3s ease;
}

.search-bar button {
  background: #00c9ff;
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s;
}

.search-bar button:hover {
  background: #0077ff;
  transform: scale(1.05);
}

/* Saved Cities */
.saved-cities {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.saved-cities button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #00ffff;
  padding: 8px 14px;
  border-radius: 10px;
  color: #00ffff;
  font-weight: 500;
  transition: 0.3s ease;
}

.saved-cities button:hover {
  background: #00ffff;
  color: #1a1a1a;
  transform: translateY(-2px);
}

/* Weather Info */
.weather-info {
  text-align: center;
  margin-top: 10px;
}

.weather-icon img {
  width: 100px;
  height: 100px;
  animation: bounce 1s infinite alternate;
}

.temperature-value p {
  font-size: 3rem;
  font-weight: bold;
}

.temperature-description p,
.location p,
.wind-speed p {
  margin-top: 10px;
  font-size: 1.2rem;
}

/* Extra Detail Boxes */
.extra-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 25px;
}

.extra-detail-box {
  background: rgba(255, 255, 255, 0.08);
  padding: 15px;
  border-radius: 15px;
  font-size: 0.95rem;
  text-align: center;
  transition: transform 0.3s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.extra-detail-box:hover {
  transform: translateY(-5px);
}

/* Wind Arrow */
#wind-arrow {
  margin-top: 6px;
  transition: transform 0.4s ease-in-out;
  filter: drop-shadow(0 0 5px #0ff);
}

/* Progress Bar */
.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  background: #00ffcc;
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
}

/* Forecast */
.forecast-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  margin-top: 20px;
  gap: 10px;
}

.forecast-container .day {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  transition: 0.3s ease;
}

.forecast-container .day:hover {
  background: #00c9ff;
  color: white;
  transform: translateY(-3px);
}

/* Hourly Forecast */
.hourly-forecast {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 0;
  margin-top: 15px;
}

.hourly-forecast .hour {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  min-width: 80px;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
  transition: 0.3s;
}

.hourly-forecast .hour:hover {
  background: rgba(0, 255, 255, 0.15);
  transform: scale(1.05);
}

/* AQI */
#aqi-box {
  background: rgba(255, 0, 0, 0.15);
  color: #ff4d4d;
  border: 1px solid red;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
  box-shadow: 0 0 8px red;
}

/* Loader */
.loader {
  margin-top: 20px;
  border: 6px solid #ccc;
  border-top: 6px solid #00c9ff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin-left: auto;
  margin-right: auto;
}

/* City Photo */
.city-photo {
  width: 100%;
  border-radius: 15px;
  margin-top: 15px;
  box-shadow: 0 0 10px #00000055;
}

.dark-mode {
  background-color: #121212;
  color: #f1f1f1;
}

.dark-mode .search-bar input,
.dark-mode .search-bar button {
  background-color: #1f1f1f;
  color: #f1f1f1;
}

.progress-bar {
  width: 100%;
  background-color: #ddd;
  border-radius: 10px;
  height: 10px;
  margin-top: 5px;
}

.progress-bar-fill {
  height: 10px;
  background-color: #00c6ff;
  border-radius: 10px;
  transition: width 0.5s ease-in-out;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #ccc;
  border-top-color: #00c6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

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


/* Animations */
@keyframes pulse {
  0% {
    text-shadow: 0 0 10px #00ffcc;
  }
  100% {
    text-shadow: 0 0 20px #00ffcc;
  }
}

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

@keyframes bounce {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-8px);
  }
}

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

/* Responsive */
@media (max-width: 600px) {
  .search-bar {
    flex-direction: column;
    align-items: center;
  }

  .search-bar input {
    width: 100%;
  }

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

  .extra-details {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .forecast-container {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }
}
