* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: white;
  margin-bottom: 30px;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.search-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#cityInput {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#cityInput:focus {
  outline: none;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

#searchBtn {
  padding: 15px 30px;
  background: #ff6b6b;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#searchBtn:hover {
  background: #ee5a52;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.error-message {
  background: #ff6b6b;
  color: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  text-align: center;
  animation: slideDown 0.3s ease;
}

.loading-message {
  background: #4ecdc4;
  color: white;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
  text-align: center;
  animation: pulse 1.5s infinite;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.weather-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  display: none;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.current-weather {
  text-align: center;
  padding-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
}

.weather-icon {
  font-size: 5rem;
  margin-bottom: 10px;
}

.temperature {
  font-size: 4rem;
  font-weight: bold;
  color: #2d3748;
  margin-bottom: 10px;
}

.city-name {
  font-size: 2rem;
  color: #4a5568;
  margin-bottom: 5px;
}

.weather-description {
  font-size: 1.2rem;
  color: #718096;
  text-transform: capitalize;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 30px 0;
  border-bottom: 2px solid #f0f0f0;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f7fafc;
  padding: 20px;
  border-radius: 10px;
}

.detail-icon {
  font-size: 2.5rem;
}

.detail-info {
  flex: 1;
}

.detail-label {
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.detail-value {
  color: #2d3748;
  font-size: 1.3rem;
  font-weight: 600;
}

.forecast-section {
  padding-top: 30px;
}

.forecast-section h2 {
  text-align: center;
  color: #2d3748;
  margin-bottom: 20px;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

.forecast-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s;
}

.forecast-item:hover {
  transform: translateY(-5px);
}

.forecast-day {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.forecast-icon {
  font-size: 2.5rem;
  margin: 10px 0;
}

.forecast-temp {
  font-size: 1.3rem;
  font-weight: bold;
}

.recent-searches {
  margin-top: 30px;
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.recent-searches h3 {
  color: #2d3748;
  margin-bottom: 15px;
  text-align: center;
}

.recent-cities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 40px;
}

.recent-city {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.recent-city:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.empty-recent {
  color: #a0aec0;
  text-align: center;
  padding: 10px;
  font-style: italic;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .temperature {
    font-size: 3rem;
  }

  .city-name {
    font-size: 1.5rem;
  }

  .search-section {
    flex-direction: column;
  }

  .weather-details {
    grid-template-columns: 1fr;
  }

  .forecast-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}