:root {
  --font-family: "Inter", sans-serif;
  
  /* Light theme colors */
  --background: oklch(98% 0.01 0);
  --surface: oklch(95% 0.01 0);
  --primary: oklch(55% 0.2 250);
  --text: oklch(25% 0.01 0);
  --text-secondary: oklch(45% 0.01 0);
  --border: oklch(85% 0.01 0);
  --shadow: oklch(0% 0 0 / 0.1);
  --accent: oklch(65% 0.2 250);
  
  font-size: 16px;
}

/* Dark theme colors */
.dark {
  --background: oklch(20% 0.01 0);
  --surface: oklch(25% 0.01 0);
  --primary: oklch(70% 0.2 250);
  --text: oklch(95% 0.01 0);
  --text-secondary: oklch(85% 0.01 0);
  --border: oklch(35% 0.01 0);
  --shadow: oklch(0% 0 0 / 0.3);
  --accent: oklch(75% 0.2 250);
}

body {
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--surface);
  border-radius: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
}

header h1 {
  font-size: 1.5rem;
  color: var(--text);
  margin: 0;
}

.theme-toggle button {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
}

.theme-toggle button:hover {
  background-color: var(--border);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem 0;
}

.bento-item {
  background-color: var(--surface);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 2px 4px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bento-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px var(--shadow);
}

.bento-current {
  grid-column: 1 / 3
}

.weather-location h2 {
  color: var(--text);
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
}

.weather-display {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.weather-icon {
  width: 96px;
  height: 96px;
}

.weather-icon svg {
  width: 100%;
  height: 100%;
  color: var(--primary);
}

.weather-temp {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weather-temp h3 {
  font-size: 3rem;
  margin: 0;
  color: var(--text);
}

.toggle-unit {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: var(--text-secondary);
}

.toggle-unit button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.toggle-unit button.active {
  color: var(--primary);
  font-weight: 600;
}

.toggle-unit button:hover:not(.active) {
  background-color: var(--border);
}

.weather-description {
  color: var(--text-secondary);
}

.bento-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.bento-details h3 {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0;
}

.detail-value {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 600;
}

.detail-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
}

.bento-search {
  grid-column: 1 / -1;
  order: -1;
}

#search-form {
  display: flex;
  gap: 0.5rem;
}

#search-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
  background-color: var(--background);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

#search-form input:focus {
  outline: none;
  border-color: var(--primary);
}

#search-form button {
  padding: 0.75rem;
  background-color: var(--primary);
  border: none;
  border-radius: 0.5rem;
  color: var(--background);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

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

.bento-sun-times,
.sun-time,
.sun-icon {
  display: none;
}

.detail-icon img,
.sun-icon img {
  width: 100%;
  height: 100%;
}

.sun-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin: 0.5rem 0;
}

#aqi .detail-value {
  position: relative;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
}

#aqi .detail-value[data-level="good"] {
  color: oklch(85% 0.2 140);
}

#aqi .detail-value[data-level="moderate"] {
  color: oklch(85% 0.2 90);
}

#aqi .detail-value[data-level="unhealthy-sensitive"] {
  color: oklch(85% 0.2 60);
}

#aqi .detail-value[data-level="unhealthy"] {
  color: oklch(85% 0.2 30);
}

#aqi .detail-value[data-level="very-unhealthy"] {
  color: oklch(85% 0.2 330);
}

#aqi .detail-value[data-level="hazardous"] {
  color: oklch(85% 0.2 0);
}

@media (max-width: 1200px) {

  .bento-current {
    grid-column: 1 / 3;
  }
  .bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .bento-current {
    grid-column: 1 / -1;
  }
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .bento-current {
    grid-column: 1 / -1;
  }
  .container {
    padding: 0.5rem;
  }
  
  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .weather-display {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
}
