/* css/weather.css */
.tile-weather {
  align-self: stretch;
  padding: 1.25rem; /* 20px */
  position: relative; /* for ambient layer */
}

/* Ambient layer */
.weather-ambient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity 300ms ease;
}

.weather-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.weather-loc-btn {
  background: transparent;
  border: none;
  color: var(--color-secondary);
  font-family: inherit;
  font-size: 0.9375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  margin-left: -0.5rem;
  transition: color 150ms ease, background 150ms ease;
}
.weather-loc-btn:hover {
  color: var(--color-primary);
  background: rgba(255,255,255,0.05);
}
.weather-loc-btn:focus-visible {
  outline: 2px solid var(--color-accent);
}
.weather-loc-icon { width: 1.125rem; height: 1.125rem; }
.weather-loc-chevron { width: 1rem; height: 1rem; opacity: 0.7; }
.weather-loc-tag {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-left: 0.25rem;
  font-variant: small-caps;
}

.weather-updated {
  font-size: 0.8125rem;
  color: var(--color-secondary);
  opacity: 0.6;
}

/* Day strip */
.weather-strip {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.weather-chip {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.875rem;
  padding: 0.375rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.weather-chip:hover {
  background: rgba(255,255,255,0.04);
}
.weather-chip[aria-selected="true"] {
  background: rgba(110, 168, 255, 0.16);
  border-color: var(--color-accent);
}
.weather-chip-label { font-size: 0.8125rem; color: var(--color-secondary); font-weight: 500; }
.weather-chip[aria-selected="true"] .weather-chip-label { color: var(--color-primary); font-weight: 600; }
.weather-chip-icon { width: 1.625rem; height: 1.625rem; display: flex; justify-content: center; align-items: center; }
.weather-chip-icon > div { width: 100%; height: 100%; }
.weather-chip-temp { display: flex; gap: 0.25rem; align-items: baseline; }
.weather-chip-max { font-size: 1rem; font-weight: 600; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.weather-chip-min { font-size: 0.8125rem; color: var(--color-secondary); font-variant-numeric: tabular-nums; }

/* Hero */
.weather-hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  transition: opacity 200ms ease, transform 200ms ease;
}
.weather-hero-icon {
  width: 6rem;
  height: 5.5rem;
  flex-shrink: 0;
}
.weather-hero-icon > div { width: 100%; height: 100%; }
.weather-hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.weather-hero-temp {
  font-size: 3.75rem;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
}
.weather-hero-temp-min {
  font-size: 2rem;
  color: var(--color-secondary);
  margin-left: 0.5rem;
}
.weather-hero-cond { font-size: 1.25rem; color: var(--color-primary); margin-top: 0.25rem; }
.weather-hero-desc { font-size: 0.875rem; color: var(--color-secondary); margin-top: 0.25rem; }

/* Stats */
.weather-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  transition: opacity 200ms ease;
}
.weather-stat { display: flex; align-items: center; gap: 0.5rem; }
.weather-stat-icon { width: 1.25rem; height: 1.25rem; color: var(--color-secondary); opacity: 0.7; }
.weather-stat-info { display: flex; flex-direction: column; }
.weather-stat-val { font-size: 0.8125rem; color: var(--color-primary); font-weight: 500; font-variant-numeric: tabular-nums; }
.weather-stat-lbl { font-size: 0.75rem; color: var(--color-secondary); }

/* Chart */
.weather-chart-container {
  flex: 1;
  min-height: 8.125rem;
  transition: opacity 200ms ease;
  position: relative;
}

/* Tooltip */
.ws-chart-tooltip {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  background: rgba(18, 22, 30, 0.85);
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  border: 1px solid var(--tile-border);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 100;
  white-space: nowrap;
}
.ws-chart-tooltip > div { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }

/* Error/Skeleton */
.weather-center { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; text-align: center; gap: 1rem; }
.weather-error-btn { background: rgba(255,255,255,0.08); border: 1px solid var(--tile-border); border-radius: 0.75rem; color: var(--color-accent); font-family: inherit; font-size: 0.9rem; padding: 0.5em 1.2em; cursor: pointer; }
.weather-error-btn:hover { background: rgba(255,255,255,0.12); }

/* Popover location search */
.loc-search-results {
  max-height: 16.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.loc-result {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
}
.loc-result:hover, .loc-result:focus { background: rgba(255,255,255,0.08); outline: none; }
.loc-result-name { font-size: 0.9375rem; color: var(--color-primary); }
.loc-result-desc { font-size: 0.75rem; color: var(--color-secondary); }
.loc-empty { font-size: 0.875rem; color: var(--color-secondary); text-align: center; padding: 1rem; }
.loc-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 0.5rem 0; }
.loc-gps-btn { background: rgba(255,255,255,0.08); border: none; color: var(--color-primary); font-family: inherit; font-size: 0.875rem; padding: 0.6rem; border-radius: 0.5rem; cursor: pointer; width: 100%; text-align: center; }
.loc-gps-btn:hover { background: rgba(255,255,255,0.12); }
