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

:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f093fb;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f0f4f8;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  --card-bg: rgba(255, 255, 255, 0.9);
}

body {
  font-family: "Arial", sans-serif;
  background: var(--gradient);
  min-height: 100vh;
  color: var(--text-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  color: white;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.search-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 1rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.search-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.main-content {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

.current-weather {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
  text-align: center;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weather-loading {
  color: var(--text-light);
}

.weather-loading i {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.weather-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.weather-main {
  flex: 1;
  min-width: 250px;
}

.city-name {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.weather-desc {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-transform: capitalize;
}

.temperature {
  font-size: 4rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.weather-icon {
  font-size: 5rem;
  color: var(--accent-color);
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.detail-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.detail-header i {
  font-size: 1.2rem;
}

.detail-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item span:first-child {
  color: var(--text-light);
}

.detail-item span:last-child {
  font-weight: 600;
  color: var(--text-color);
}

.chart-section {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.chart-section h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.recent-searches {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.recent-searches h3 {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  text-align: center;
}

.search-history {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.history-item {
  background: var(--gradient);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.history-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.error-message {
  color: #ff4757;
  text-align: center;
  padding: 2rem;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 10px;
  margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header h1 {
    font-size: 2rem;
  }

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

  .weather-info {
    flex-direction: column;
    text-align: center;
  }

  .temperature {
    font-size: 3rem;
  }

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

/* Animation for loading */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fa-spin {
  animation: spin 1s linear infinite;
}
