/* ==================== BASE (from create-webapp template) ==================== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #00d4ff;
  --accent-secondary: #00ff88;
  --accent-warm: #ff9f43;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --success: #00ff88;
  --warning: #ffaa00;
  --info: #00b4d8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* NOTE: dark gray, never #000 — additive waveguide makes black transparent on-device */
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; flex: 1; }
.header-meta { font-size: 13px; color: var(--text-secondary); }
.back-btn {
  background: transparent;
  color: var(--text-primary);
  font-size: 22px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
}

/* --- Content --- */
.content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Focus States --- */
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Nav Bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: var(--bg-primary); }
.nav-item.primary:focus { background: #33ddff; }

/* --- Loading / Error --- */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px;
  flex: 1;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 16px; color: var(--text-secondary); }

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.error-icon { font-size: 48px; }
.error-message { font-size: 16px; color: var(--text-secondary); }

/* --- List Items (cities) --- */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 420px;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  text-align: left;
  gap: 12px;
  min-height: 56px;
}
.list-item:focus { background: var(--bg-card); }
.list-item-icon {
  font-size: 24px;
  width: 36px;
  text-align: center;
  flex-shrink: 0;
}
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; }
.list-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.list-item-check {
  color: var(--accent-primary);
  font-size: 20px;
  flex-shrink: 0;
}

/* --- Utility --- */
.hidden { display: none !important; }

/* ==================== WEATHER-SPECIFIC STYLES ==================== */

/* Current weather block */
.current-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.current-city {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.current-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.current-icon {
  font-size: 64px;
  line-height: 1;
}
.current-temp {
  font-size: 72px;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
}
.current-condition {
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 4px;
}
.current-meta {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.current-meta .sep { color: var(--text-muted); }

/* Forecast */
.forecast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.forecast-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.forecast-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 110px;
  text-align: center;
}
/* Currently shown day (main panel mirrors this) */
.forecast-card.selected {
  background: var(--bg-card);
  box-shadow: inset 0 -3px 0 0 var(--accent-primary);
}
/* Focused via D-pad — the shared .focusable:focus ring handles the outline,
   these rules just tune the inner look for a card */
.forecast-card.focusable:focus {
  background: var(--bg-card);
}
.forecast-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.forecast-icon {
  font-size: 26px;
  line-height: 1;
}
.forecast-high {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.forecast-low {
  font-size: 13px;
  color: var(--text-secondary);
}
