/* ===== Base Styles & Variables ===== */
:root {
  /* Color Scheme */
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4895ef;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --danger-color: #f72585;
  
  /* Weather-specific colors */
  --sunny-gradient: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  --rainy-gradient: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
  --cloudy-gradient: linear-gradient(135deg, #e2ebf0 0%, #cfd9df 100%);
  --night-gradient: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  --snow-gradient: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 100%);
  --storm-gradient: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  
  /* Typography */
  --font-main: 'Poppins', sans-serif;
  --font-size-base: 16px;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

body {
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  color: var(--dark-color);
  background: var(--light-color);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-slow);
}

/* ===== App Container ===== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* ===== Header Styles ===== */
.app-header {
  background: var(--primary-color);
  color: white;
  padding: var(--space-md) var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  z-index: 1;
}

.header-content {
  position: relative;
  z-index: 2;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.app-title i {
  font-size: 1.8rem;
}

.app-subtitle {
  font-weight: 300;
  opacity: 0.9;
}

/* ===== Main Content Styles ===== */
.app-main {
  flex: 1;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ===== Search Section ===== */
.search-section {
  margin-bottom: var(--space-md);
}

.search-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.search-box {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
}

.search-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid #e9ecef;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(72, 149, 239, 0.2);
}

.search-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-sm) var(--space-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.search-btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

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

.location-options {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.location-btn, .recent-btn {
  background-color: white;
  color: var(--dark-color);
  border: 1px solid #e9ecef;
  border-radius: var(--radius-lg);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  box-shadow: var(--shadow-sm);
}

.location-btn:hover, .recent-btn:hover {
  background-color: #f8f9fa;
  border-color: #dee2e6;
}

.recent-searches-dropdown {
  position: relative;
}

.recent-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 200px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: var(--space-sm) 0;
  margin-top: var(--space-xs);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition-normal);
  z-index: 10;
  max-height: 300px;
  overflow-y: auto;
}

.recent-searches-dropdown:hover .recent-list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.recent-list li {
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.recent-list li:hover {
  background-color: #f8f9fa;
}

/* ===== Current Weather Section ===== */
.current-weather-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.weather-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.weather-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary-color);
}

.current-weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.weather-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(67, 97, 238, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-md);
}

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

.weather-content {
  width: 100%;
}

.weather-location {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.weather-icon {
  width: 100px;
  height: 100px;
  margin: var(--space-sm) auto;
}

.weather-temp {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  position: relative;
  display: inline-block;
}

.weather-temp::after {
  content: '°';
  position: absolute;
  top: 0;
  right: -15px;
  font-size: 2rem;
}

.weather-desc {
  font-size: 1.2rem;
  text-transform: capitalize;
  margin-bottom: var(--space-md);
  color: #6c757d;
}

.weather-date {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: var(--space-md);
}

/* Weather Details Grid */
.weather-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
  width: 100%;
}

.detail-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.detail-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.detail-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
}

.detail-icon.humidity { background-color: #4cc9f0; }
.detail-icon.wind { background-color: #4895ef; }
.detail-icon.pressure { background-color: #4361ee; }
.detail-icon.visibility { background-color: #3f37c9; }

.detail-info {
  display: flex;
  flex-direction: column;
}

.detail-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.detail-label {
  font-size: 0.8rem;
  color: #6c757d;
}

/* ===== Forecast Section ===== */
.forecast-section {
  margin-top: var(--space-md);
}

.section-title {
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--dark-color);
}

.forecast-container {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) #f1f1f1;
}

.forecast-container::-webkit-scrollbar {
  height: 6px;
}

.forecast-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.forecast-container::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 10px;
}

.forecast-day {
  min-width: 120px;
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-fast);
}

.forecast-day:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.forecast-date {
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.forecast-icon {
  width: 50px;
  height: 50px;
  margin: var(--space-xs) 0;
}

.forecast-temp {
  display: flex;
  gap: var(--space-xs);
}

.forecast-temp-max {
  font-weight: 600;
  color: var(--danger-color);
}

.forecast-temp-min {
  font-weight: 600;
  color: var(--primary-color);
}

/* ===== Additional Data Section ===== */
.additional-data-section {
  margin-top: var(--space-md);
}

.tabs-container {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #e9ecef;
}

.tab-btn {
  flex: 1;
  padding: var(--space-sm);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  color: #6c757d;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  position: relative;
}

.tab-btn.active {
  color: var(--primary-color);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.tab-btn:hover:not(.active) {
  background-color: #f8f9fa;
  color: var(--dark-color);
}

.tabs-content {
  padding: var(--space-md);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.hourly-forecast {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
}

.hourly-item {
  min-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm);
  background: #f8f9fa;
  border-radius: var(--radius-md);
}

.hourly-time {
  font-weight: 600;
  font-size: 0.9rem;
}

.hourly-icon {
  width: 40px;
  height: 40px;
  margin: var(--space-xs) 0;
}

.hourly-temp {
  font-weight: 600;
}

.map-placeholder {
  height: 300px;
  background: #f8f9fa;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

.air-quality-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.aqi-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--success-color);
  line-height: 1;
}

.aqi-label {
  font-size: 1rem;
  color: #6c757d;
  margin-top: var(--space-xs);
}

.pollutants-list {
  width: 100%;
  margin-top: var(--space-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-sm);
}

.pollutant-item {
  background: #f8f9fa;
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Footer Styles ===== */
.app-footer {
  background-color: var(--dark-color);
  color: white;
  padding: var(--space-lg);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-section h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
  color: var(--light-color);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.unit-toggle {
  display: flex;
  gap: var(--space-xs);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2px;
}

.unit-btn {
  padding: var(--space-xs) var(--space-sm);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.unit-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* ===== Toast Notification ===== */
.toast-notification {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: var(--dark-color);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition-normal);
  z-index: 1000;
  max-width: 350px;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.toast-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

/* ===== Weather Condition Themes ===== */
.weather-sunny {
  background: var(--sunny-gradient);
  color: #333;
}

.weather-rainy {
  background: var(--rainy-gradient);
  color: #333;
}

.weather-cloudy {
  background: var(--cloudy-gradient);
  color: #333;
}

.weather-night {
  background: var(--night-gradient);
  color: white;
}

.weather-snow {
  background: var(--snow-gradient);
  color: #333;
}

.weather-storm {
  background: var(--storm-gradient);
  color: white;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .app-main {
    padding: var(--space-md);
  }
  
  .weather-details-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-title {
    font-size: 1.5rem;
  }
  
  .search-box {
    flex-direction: column;
  }
  
  .search-btn {
    width: 100%;
  }
  
  .weather-details-grid {
    grid-template-columns: 1fr;
  }
  
  .forecast-day {
    min-width: 100px;
  }
}