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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background 0.5s ease;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dynamic background classes for different weather conditions */
body.clear {
  background: linear-gradient(135deg, #ffa500 0%, #ff6347 100%);
}

body.clouds {
  background: linear-gradient(135deg, #bdc3c7 0%, #2c3e50 100%);
}

body.rain,
body.drizzle {
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}

body.thunderstorm {
  background: linear-gradient(135deg, #373b44 0%, #4286f4 100%);
}

body.snow {
  background: linear-gradient(135deg, #e6dada 0%, #274046 100%);
}

body.mist,
body.fog,
body.haze {
  background: linear-gradient(135deg, #606c88 0%, #3f4c6b 100%);
}

.container {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 100%;
  backdrop-filter: blur(10px);
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 2rem;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

#city-input {
  flex: 1;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.3s;
}

#city-input:focus {
  outline: none;
  border-color: #667eea;
}

#search-btn {
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#search-btn:active {
  transform: translateY(0);
}

.error-message {
  display: none;
  background: #ff4757;
  color: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.error-message.show {
  display: block;
  animation: shake 0.5s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.weather-display {
  display: none;
  text-align: center;
  animation: fadeIn 0.5s;
}

.weather-display.show {
  display: block;
}

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

.city-name {
  font-size: 2rem;
  color: #333;
  margin-bottom: 10px;
}

.weather-icon {
  width: 120px;
  height: 120px;
  margin: 20px auto;
}

.temperature {
  font-size: 3.5rem;
  font-weight: bold;
  color: #667eea;
  margin: 10px 0;
}

.description {
  font-size: 1.3rem;
  color: #666;
  text-transform: capitalize;
  margin-bottom: 30px;
}

.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 30px;
}

.detail-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
}

.detail-label {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 5px;
}

.detail-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.loading {
  display: none;
  text-align: center;
  color: #667eea;
  font-size: 1.2rem;
  margin: 20px 0;
}

.loading.show {
  display: block;
}

/* Responsive Design */
@media (max-width: 480px) {
  .container {
    padding: 25px;
  }

  h1 {
    font-size: 1.5rem;
  }

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

  #search-btn {
    width: 100%;
  }

  .temperature {
    font-size: 2.5rem;
  }

  .city-name {
    font-size: 1.5rem;
  }

  .details {
    grid-template-columns: 1fr;
  }
}
