/* Professional Weather Dashboard Styling */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and base styles */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Variables */
  --color-primary: #2c3e50;
  --color-secondary: #3498db;
  --color-accent: #2980b9;
  --color-background: #f5f7fa;
  --color-sidebar: #2c3e50;
  --color-card: #ffffff;
  --color-text: #333333;
  --color-text-light: #757575;
  --color-text-white: #f5f7fa;
  --color-border: rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.08);
  --radius-small: 6px;
  --radius-medium: 12px;
  --radius-large: 20px;
  --transition: all 0.3s ease;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  min-height: 100vh;
  transition: var(--transition);
}

/* Dashboard layout */
.weather-dashboard {
  display: flex;
  min-height: 100vh;
}

/* Sidebar styling */
.sidebar {
  width: 320px;
  background-color: var(--color-sidebar);
  color: var(--color-text-white);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-medium);
  z-index: 10;
}

.app-header {
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 25px;
}

.app-header h1 {
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header h1 i {
  color: var(--color-secondary);
}

/* Search form styling */
.search-container {
  margin-bottom: 20px;
}

.input-group {
  position: relative;
  margin-bottom: 15px;
}

.input-group i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
}

form#weatherForm input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: none;
  border-radius: var(--radius-small);
  background-color: rgba(255, 255, 255, 0.9);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: var(--transition);
}

form#weatherForm input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-secondary);
}

form#weatherForm button {
  width: 100%;
  padding: 12px;
  background-color: var(--color-secondary);
  color: white;
  border: none;
  border-radius: var(--radius-small);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

form#weatherForm button:hover {
  background-color: var(--color-accent);
}

/* Recent searches */
.recent-searches {
  margin-top: 30px;
}

.recent-searches h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recent-searches ul {
  list-style: none;
}

.recent-searches li {
  padding: 12px 15px;
  margin-bottom: 5px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-small);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.recent-searches li:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.recent-searches li i {
  opacity: 0.6;
}

/* Main content area */
.main-content {
  flex: 1;
  padding: 15px;
  position: relative;
  overflow-y: auto;
  max-height: 100vh;
  transition: var(--transition);
}

/* Loading indicator */
#loadingIndicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(44, 62, 80, 0.1);
  border-radius: 50%;
  border-top-color: var(--color-secondary);
  animation: spin 1s linear infinite;
}

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

/* Welcome message */
.welcome-message {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 80vh;
  gap: 20px;
  color: var(--color-text-light);
}

.welcome-message i {
  color: var(--color-secondary);
  margin-bottom: 10px;
}

.welcome-message h2 {
  font-weight: 600;
}

/* Weather results */
#weatherResult {
  opacity: 1;
  transition: var(--transition);
}

.weather-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
}

/* Current weather section */
.current-weather {
  background-color: var(--color-card);
  border-radius: var(--radius-medium);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}

.city-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.city-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.city-name h2 {
  font-size: 28px;
  font-weight: 600;
}

.country-code {
  background-color: var(--color-secondary);
  color: white;
  padding: 5px 10px;
  border-radius: var(--radius-small);
  font-size: 12px;
  font-weight: 600;
}

.city-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  background-color: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: var(--radius-small);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.action-btn i {
  color: var(--color-text);
  font-size: 16px;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
}

.temp-main {
  display: flex;
  align-items: center;
  gap: 20px;
}

.temp-value {
  font-size: 64px;
  font-weight: 300;
  line-height: 1;
  position: relative;
}

.temp-unit {
  position: absolute;
  top: 12px;
  font-size: 24px;
  font-weight: 500;
}

.temp-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feels-like {
  font-size: 16px;
  color: var(--color-text-light);
}

.min-max {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.min-max span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.min-max i {
  color: var(--color-text-light);
}

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

.weather-icon img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.weather-description {
  text-transform: capitalize;
  font-size: 16px;
  margin-top: 5px;
}

/* Weather details grid */
.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}

.detail-card {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-small);
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: var(--transition);
}

.detail-card:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.detail-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(52, 152, 219, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-icon i {
  color: var(--color-secondary);
  font-size: 16px;
}

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

.detail-label {
  font-size: 12px;
  color: var(--color-text-light);
}

.detail-value {
  font-size: 16px;
  font-weight: 500;
}

/* Air quality grid */
.air-quality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.air-quality-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: var(--radius-small);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.air-quality-item span:first-child {
  font-size: 0.9em;
  color: var(--color-text-light);
}

.aqi-level-1 { color: #4caf50; }
.aqi-level-2 { color: #ffd700; }
.aqi-level-3 { color: #ff9800; }
.aqi-level-4 { color: #f44336; }
.aqi-level-5 { color: #9c27b0; }

/* Forecast section */
.forecast-section {
  background-color: var(--color-card);
  border-radius: var(--radius-medium);
  padding: 30px;
  box-shadow: var(--shadow-soft);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title i {
  color: var(--color-secondary);
}

.forecast-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.forecast-item {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-small);
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.forecast-item:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

.forecast-day {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.forecast-temp {
  font-size: 20px;
  font-weight: 500;
  margin: 5px 0;
}

.forecast-icon {
  width: 50px;
  height: 50px;
  margin: 5px 0;
}

.forecast-desc {
  font-size: 12px;
  color: var(--color-text-light);
  text-transform: capitalize;
}

/* City details panel */
.city-details-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background-color: var(--color-card);
  box-shadow: var(--shadow-medium);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.city-details-panel.active {
  right: 0;
}

.panel-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h3 {
  font-size: 18px;
  font-weight: 600;
}

#closeDetailsBtn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#closeDetailsBtn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#cityDetailsContent {
  padding: 20px;
}

.city-detail-section {
  margin-bottom: 25px;
}

.detail-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.city-info-list {
  list-style: none;
}

.city-info-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
}

.info-label {
  color: var(--color-text-light);
}

.city-map {
  border-radius: var(--radius-small);
  overflow: hidden;
  margin-top: 15px;
  height: 200px;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Error message styling */
.error-message {
  background-color: #fff5f5;
  border-left: 4px solid #e53e3e;
  padding: 20px;
  border-radius: var(--radius-small);
  margin: 20px 0;
  color: #e53e3e;
}

/* Weather-based background themes */
.weather-theme-clear {
  --color-primary: #e67e22;
  --color-secondary: #f39c12;
  --color-accent: #d35400;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.weather-theme-clouds {
  --color-primary: #7f8c8d;
  --color-secondary: #95a5a6;
  --color-accent: #34495e;
  background: linear-gradient(135deg, #b8d3fe 0%, #cfd9df 100%);
}

.weather-theme-rain {
  --color-primary: #3498db;
  --color-secondary: #2980b9;
  --color-accent: #1abc9c;
  background: linear-gradient(135deg, #89f7fe 0%, #66a6ff 100%);
}

.weather-theme-snow {
  --color-primary: #8e9eab;
  --color-secondary: #a7bdc8;
  --color-accent: #5d7a8a;
  background: linear-gradient(135deg, #e6e9f0 0%, #eef1f5 100%);
}

.weather-theme-thunderstorm {
  --color-primary: #4a69bd;
  --color-secondary: #6a89cc;
  --color-accent: #1e3799;
  background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
  color: var(--color-text-white);
}

.weather-theme-drizzle {
  --color-primary: #4facfe;
  --color-secondary: #00f2fe;
  --color-accent: #4facfe;
  background: linear-gradient(135deg, #cfd9df 0%, #e2ebf0 100%);
}

.weather-theme-mist {
  --color-primary: #606c88;
  --color-secondary: #3f4c6b;
  --color-accent: #606c88;
  background: linear-gradient(135deg, #e6dada 0%, #274046 100%);
  color: var(--color-text-white);
}

.weather-theme-hot {
  --color-primary: #ff7e5f;
  --color-secondary: #feb47b;
  --color-accent: #ff7e5f;
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.weather-theme-cold {
  --color-primary: #a1c4fd;
  --color-secondary: #c2e9fb;
  --color-accent: #a1c4fd;
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
}

/* Time-based themes */
.time-theme-day {
  --color-sidebar: #2c3e50;
}

.time-theme-night {
  --color-sidebar: #1a2530;
  --color-card: #f8f9fa;
}

/* Animation for temperature changes */
@keyframes tempChange {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.animate-temp {
  animation: tempChange 0.6s ease;
}

/* Responsive styles */
@media (max-width: 900px) {
  .weather-dashboard {
    flex-direction: column;
    height: 100vh;
  }
  
  .sidebar {
    width: 100%;
    max-height: none;
    padding: 15px;
  }
  
  .search-container {
    width: 100%;
    margin: 0 auto;
  }
  
  .hamburger-btn {
    display: flex;
    justify-content: center;
  }
  
  .recent-searches {
    display: none;
    margin-top: 10px;
  }
  
  .recent-searches.active {
    display: block;
  }
  
  .recent-searches ul {
    max-height: 200px;
    overflow-y: auto;
  }
  
  .main-content {
    height: calc(100vh - var(--sidebar-height));
    padding: 5px;
  }
  
  .current-weather {
    padding: 20px;
  }
  
  .forecast-section {
    padding: 20px;
  }
  
  .weather-card {
    width: 90%;
    margin: 0 auto 20px;
  }
  
  .city-details-panel {
    width: 100%;
    right: -100%;
  }
}

@media (max-width: 768px) {
  .weather-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .primary-info {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .weather-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0;
  }
  
  .stat-card {
    padding: 15px;
    margin: 0;
  }
  
  .forecast-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .temp-value {
    font-size: 56px;
  }
  
  .weather-card {
    width: 100%;
    margin: 0 0 15px 0;
    padding: 5px;
    border-radius: var(--radius-medium);
  }
  
  .main-content {
    padding: 0;
  }
  
  .sun-info {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .sidebar {
    padding: 10px;
  }
  
  .search-container,
  .weather-card {
    width: 90%;
  }
  
  .weather-main {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }
  
  .weather-details {
    grid-template-columns: 1fr;
  }
  
  .city-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .city-actions {
    align-self: flex-end;
  }
  
  .forecast-items {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .sidebar,
  .main-content,
  .weather-card,
  .forecast-section {
    padding: 10px;
  }

  .weather-container {
    width: 100%;
  }

  .weather-card {
    width: 100%;
    margin: 0;
    border-radius: var(--radius-small);
  }

  .search-container {
    width: 100%;
    padding: 0 10px;
  }
}

/* Reset button styling */
.reset-button {
  background: none;
  border: none;
  color: var(--color-text-white);
  font-size: 24px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
  width: 100%;
}

.reset-button:hover {
  color: var(--color-secondary);
}

.reset-button i {
  color: var(--color-secondary);
}

/* Add these new styles for improved weather display */
.weather-container {
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.weather-card {
  background: var(--color-card);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-medium);
  padding: 30px;
  margin-bottom: 30px;
}

.main-weather {
  background: rgba(255, 255, 255, 0.95);
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.location-info h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--color-primary);
}

.weather-time {
  font-size: 14px;
  color: var(--color-text-light);
}

.weather-body {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.primary-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.temperature-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.temp-value {
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
}

.feels-like {
  font-size: 16px;
  color: var(--color-text-light);
}

.weather-icon-large {
  text-align: center;
}

.weather-icon-large img {
  width: 120px;
  height: 120px;
  margin-bottom: 10px;
}

.weather-description {
  font-size: 18px;
  text-transform: capitalize;
  color: var(--color-text);
}

.weather-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px 0;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-small);
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.stat-card i {
  font-size: 24px;
  color: var(--color-secondary);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-light);
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.sun-info {
  display: flex;
  justify-content: space-around;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
}

.sun-card {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sun-card i {
  font-size: 24px;
  color: var(--color-secondary);
}

.sun-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sun-label {
  font-size: 14px;
  color: var(--color-text-light);
}

.sun-time {
  font-size: 16px;
  font-weight: 600;
}

/* Add hamburger menu styles */
.hamburger-btn {
  display: none;
  width: 100%;
  padding: 12px;
  background: var(--color-secondary);
  color: white;
  border: none;
  border-radius: var(--radius-small);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.hamburger-btn i {
  font-size: 16px;
}

.hamburger-btn:hover {
  background: var(--color-accent);
}