/* live_updates.css — Live Updates hub (summary cards + detail views). */

.live-page { max-width: 680px; margin: 0 auto; padding: 4px 16px 32px; }

/* Page bar: back arrow, centered title, decorative gear */
.live-header { display: flex; align-items: center; gap: 8px; padding: 6px 0 10px; }
.live-back { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: var(--wg-text); flex: none; }
.live-back:hover { background: #f1f3f5; text-decoration: none; }
.live-title { flex: 1; margin: 0; font-size: 1.25rem; text-align: center; }
@media (max-width: 480px) { .live-title { font-size: 1.05rem; } }
.live-gear { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; color: #98a1ab; flex: none; }
.live-gear .wg-ico { width: 20px; height: 20px; }
.live-share-btn { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border: none; background: none; color: var(--wg-text); cursor: pointer; border-radius: 50%; flex: none; }
.live-share-btn:hover { background: #f1f3f5; }
.live-share-btn .wg-ico { width: 20px; height: 20px; }

/* Location bar */
.live-location-bar { padding: 4px 2px 12px; border-bottom: 1px solid var(--wg-border); margin-bottom: 14px; }
.live-loc-main { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
/* The region name itself is the picker trigger (with a pencil), so there's
   no separate "Change" button. */
.live-loc-name-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; padding: 2px 2px; font: inherit; font-weight: 700; color: var(--wg-text); cursor: pointer; min-width: 0; }
.live-loc-name-btn:hover { color: var(--wg-color-dark, #0a7d37); }
.live-loc-name-btn > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-loc-edit { display: inline-flex; color: var(--wg-color-dark, #0a7d37); flex: none; }
.live-loc-edit .wg-ico { width: 15px; height: 15px; }
.live-loc-actions { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.live-loc-change { border: none; background: none; padding: 2px 4px; color: var(--wg-color-dark, #0a7d37); font: inherit; font-weight: 700; cursor: pointer; }
.live-loc-change:hover { text-decoration: underline; }
.live-loc-gps { display: inline-flex; align-items: center; gap: 4px; border: 1px solid #bfe7cd; background: #f2fbf5; padding: 4px 10px; border-radius: 999px; color: var(--wg-color-dark, #0a7d37); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.live-loc-gps::before { content: '📍'; }
.live-loc-gps:hover { background: #e2f5e9; }
.live-loc-gps:disabled { opacity: 0.6; cursor: default; }
.live-loc-pick { display: block; margin-top: 8px; }
.live-loc-pick select { width: 100%; padding: 9px 10px; font: inherit; border: 1px solid var(--wg-border); border-radius: var(--wg-radius); background: #fff; }
.live-loc-updated { margin-top: 6px; color: var(--wg-muted); font-size: 0.83rem; }

/* Stale-data banner */
.live-stale-warning { margin: 0 0 12px; padding: 9px 12px; border: 1px solid #f3d9a4; border-radius: var(--wg-radius); background: #fdf6e7; color: #8a6116; font-size: 0.86rem; }

/* Summary cards */
.live-card {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--wg-border-soft);
  border-radius: var(--wg-radius-card);
  background: #fff;
  color: var(--wg-text);
  text-align: left;
  box-shadow: var(--wg-shadow-card);
  transition: box-shadow .15s ease, transform .05s ease;
}
a.live-card:hover { text-decoration: none; border-color: #cfd6dc; box-shadow: var(--wg-shadow-hover); }
a.live-card:active { transform: scale(0.99); }
a.live-card:focus-visible { outline: 2px solid var(--wg-color); outline-offset: 2px; }
.live-card-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; font-size: 1.15rem; flex: none; background: #eef2f6; }
.live-card-icon.is-air      { background: #e3efff; }
.live-card-icon.is-weather  { background: #e3f2ff; }
.live-card-icon.is-fx       { background: #e4f7ec; }
.live-card-icon.is-alerts   { background: #ffe9e7; }
.live-card-icon.is-holidays { background: #f1e9fb; }
.live-card-icon.is-hospitals{ background: #e4f7ec; }
.live-card-main { flex: 1; min-width: 0; }
.live-card-title { display: block; margin: 0 0 1px; font-size: 0.78rem; font-weight: 700; color: #52606d; }
.live-card-value { display: block; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.live-card-subtext { display: block; margin-top: 2px; color: var(--wg-muted); font-size: 0.8rem; line-height: 1.35; }
.live-card-side { display: flex; align-items: center; gap: 8px; flex: none; }
.live-card-meta { text-align: right; font-size: 0.78rem; color: var(--wg-muted); }
.live-card-chevron { color: #9aa4ae; font-size: 1.1rem; flex: none; }

/* Status colours (always paired with text, never colour-only) */
.live-status-good     { color: #0b8f3e; }
.live-status-moderate { color: #b07908; }
.live-status-bad      { color: #d92d20; }
.live-status-danger   { color: #a11043; }
.live-badge { display: inline-block; min-width: 44px; padding: 6px 10px; border-radius: 10px; color: #fff; font-weight: 800; text-align: center; }
.live-badge.live-badge-good     { background: #0eaf4c; }
.live-badge.live-badge-moderate { background: #e8a512; }
.live-badge.live-badge-bad      { background: #e5484d; }
.live-badge.live-badge-danger   { background: #a11043; }
.live-pill-ok { display: inline-block; padding: 4px 11px; border-radius: 999px; background: #e4f7ec; color: #0b8f3e; font-size: 0.8rem; font-weight: 700; }

/* Skeleton shimmer while loading */
.live-skeleton { min-height: 84px; border: 1px solid var(--wg-border); position: relative; overflow: hidden; background: #f4f6f8; }
.live-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: live-shimmer 1.3s infinite;
}
@keyframes live-shimmer { 100% { transform: translateX(100%); } }

/* Themed per-category loading card: the real coloured icon stays (with a gentle
   pulse) so you can tell which card is loading; shimmer bars stand in for text. */
.live-skel-card { display: flex; align-items: center; gap: 12px; }
.live-skel-card .live-card-icon { animation: live-pulse 1.4s ease-in-out infinite; }
.live-skel-card .live-card-main { flex: 1; min-width: 0; }
.live-skel-bar { display: block; height: 12px; border-radius: 6px; background: #e9edf1; position: relative; overflow: hidden; }
.live-skel-bar + .live-skel-bar { margin-top: 8px; }
.live-skel-bar::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  animation: live-shimmer 1.3s infinite;
}
.live-skel-title { width: 42%; }
.live-skel-value { width: 68%; height: 16px; }
.live-skel-sub   { width: 88%; }
.live-skel-badge { display: block; width: 34px; height: 34px; border-radius: 9px; background: #e9edf1; animation: live-pulse 1.4s ease-in-out infinite; }
.live-skel-block { min-height: 130px; margin-top: 12px; border-radius: 12px; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Error card */
.live-error-card { padding: 18px 14px; border: 1px solid #f1c7c4; border-radius: 14px; background: #fdf0ef; margin-bottom: 12px; }
.live-error-card h3 { margin: 0 0 4px; font-size: 0.98rem; }
.live-error-card p { margin: 0 0 10px; color: var(--wg-muted); font-size: 0.88rem; }
.live-error-card .wg-btn { width: auto; padding: 8px 18px; }

/* Coming-soon footer banner */
.live-coming-soon { margin-top: 6px; padding: 13px; border-radius: 14px; background: #e8f7ee; color: var(--wg-color-dark, #0a7d37); font-weight: 700; text-align: center; font-size: 0.9rem; }

/* Screen-reader-only helper */
.wg-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Detail views ─────────────────────────────────────────────────── */

.live-detail-card { margin: 0 0 12px; padding: 16px 14px; border: 1px solid var(--wg-border-soft); border-radius: var(--wg-radius-card); background: #fff; box-shadow: var(--wg-shadow-card); }
.live-sec-title { margin: 0 0 10px; font-size: 0.95rem; }
.live-dim { color: var(--wg-muted); font-size: 0.85rem; }

/* Shared rows (pollutants, 7-day, rates, holidays) */
.live-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f1f3f5; }
.live-row:last-child { border-bottom: none; }
.live-row-name { flex: 1; font-weight: 700; min-width: 0; }
.live-row-icon { flex: none; }
.live-row-val { font-weight: 700; white-space: nowrap; }
.live-row-val small { color: var(--wg-muted); font-weight: 400; }
.live-row-rain { color: #2f80c3; font-size: 0.83rem; white-space: nowrap; }
.live-row .live-badge { font-size: 0.78rem; padding: 4px 10px; min-width: 0; }

/* Air quality */
.live-air-hero { text-align: center; }
.live-air-lead { color: var(--wg-muted); font-size: 0.9rem; }
.live-air-grade { font-size: 1.6rem; font-weight: 800; margin: 2px 0 4px; }
.live-gauge { display: block; width: 200px; max-width: 70%; margin: 0 auto; }
.live-air-value { font-size: 2.4rem; font-weight: 800; margin-top: -46px; }
.live-air-scale { display: flex; justify-content: space-between; max-width: 240px; margin: 8px auto 0; color: var(--wg-muted); font-size: 0.78rem; }
.live-advice-box { margin: 0 0 12px; padding: 13px 14px; border-radius: 14px; background: #f4f6f8; font-size: 0.9rem; line-height: 1.5; }
.live-fc-grid { display: flex; gap: 8px; }
.live-fc-box { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border: 1px solid var(--wg-border); border-radius: 10px; }
.live-fc-day { color: var(--wg-muted); font-size: 0.8rem; }
.live-fc-grade { font-weight: 800; font-size: 0.9rem; }

/* Weather */
.live-wx-hero { text-align: center; background: linear-gradient(160deg, #3d9be9, #2f7fd1); border: none; color: #fff; }
.live-wx-emoji { font-size: 2.2rem; }
.live-wx-temp { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.live-wx-cond { font-weight: 700; }
.live-wx-hl { margin-top: 4px; font-size: 0.9rem; opacity: 0.92; }
.live-wx-advice { margin-top: 2px; font-size: 0.85rem; opacity: 0.92; }
.live-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.live-metric { display: flex; flex-direction: column; gap: 3px; padding: 10px 8px; border: 1px solid var(--wg-border); border-radius: 10px; background: #fff; text-align: center; }
.live-metric-name { color: var(--wg-muted); font-size: 0.75rem; }
.live-metric-val { font-weight: 800; font-size: 0.95rem; }
.live-hourly { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.live-hour { flex: 1; min-width: 52px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; }
.live-hour-t { color: var(--wg-muted); font-size: 0.75rem; white-space: nowrap; }
.live-hour-i { font-size: 1.2rem; }
.live-hour-temp { font-weight: 800; }
.live-hour-rain { color: #2f80c3; font-size: 0.78rem; }

/* Exchange */
.live-fx-primary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live-fx-primary-row label { font-weight: 700; }
.live-fx-primary-row select { padding: 8px 10px; font: inherit; border: 1px solid var(--wg-border); border-radius: var(--wg-radius); background: #fff; }
.live-row-primary { background: #f2fbf5; margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-radius: 8px; }
.live-row-primary .live-row-name { color: var(--wg-color-dark, #0a7d37); }
.live-fx-two { display: flex; align-items: center; gap: 6px; }
.live-fx-two input { flex: 1 1 30%; min-width: 0; padding: 10px; font: inherit; border: 1px solid var(--wg-border); border-radius: var(--wg-radius); background: #fff; }
.live-fx-two select { flex: 1 1 28%; min-width: 0; padding: 10px 6px; font: inherit; border: 1px solid var(--wg-border); border-radius: var(--wg-radius); background: #fff; }
.live-fx-swap { flex: none; width: 38px; height: 38px; border: 1px solid var(--wg-border); border-radius: 50%; background: #f4f6f8; font-size: 1.1rem; cursor: pointer; }
.live-fx-swap:hover { background: #e9edf1; }
.live-fx-result { margin-top: 12px; font-weight: 800; font-size: 1.1rem; color: var(--wg-color-dark, #0a7d37); min-height: 1.3em; }
.live-fx-share { width: auto; margin-top: 12px; padding: 8px 16px; }

/* Emergency alerts */
.live-ok-box { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 14px; border-radius: 14px; background: #e4f7ec; }
.live-ok-dot { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #0eaf4c; color: #fff; font-weight: 800; flex: none; }
.live-alert-active { margin: 0 0 12px; padding: 13px 14px; border-radius: 14px; background: #fdf0ef; color: #d92d20; }
.live-alert-item { padding: 11px 0; border-bottom: 1px solid #f1f3f5; }
.live-alert-item:last-child { border-bottom: none; }
.live-alert-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.live-alert-title { font-weight: 800; }
.live-alert-body { margin: 3px 0 5px; font-size: 0.88rem; line-height: 1.5; }
.live-level { padding: 3px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.live-level-good { background: #e3f2ff; color: #1662a8; }
.live-level-moderate { background: #fdf3dd; color: #8a6116; }
.live-level-bad { background: #fdeaea; color: #c22; }
.live-how-line { padding: 6px 0; font-size: 0.88rem; }

/* Holidays */
.live-hd-hero { text-align: center; }
.live-hd-name { margin: 4px 0 2px; font-size: 1.15rem; font-weight: 800; color: #7c3aed; }
.live-hd-count { color: var(--wg-muted); font-size: 0.9rem; }

/* Holiday calendar */
.live-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.live-cal-title { font-weight: 800; }
.live-cal-nav { width: 34px; height: 34px; border: 1px solid var(--wg-border); border-radius: 50%; background: #fff; font-size: 1.1rem; cursor: pointer; line-height: 1; }
.live-cal-nav:hover { background: #f1f3f5; }
.live-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.live-cal-dow { text-align: center; font-size: 0.72rem; color: var(--wg-muted); font-weight: 700; padding: 2px 0; }
.live-cal-cell { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; border-radius: 8px; }
.live-cal-cell.is-empty { visibility: hidden; }
.live-cal-cell.is-today { box-shadow: inset 0 0 0 1px var(--wg-border); }
.live-cal-cell.is-holiday { background: #f1e9fb; color: #7c3aed; font-weight: 700; }
.live-cal-cell.is-next { background: #7c3aed; color: #fff; font-weight: 800; }

/* Hospitals */
.live-map { height: 220px; margin: 0 0 12px; border-radius: 14px; border: 1px solid var(--wg-border); overflow: hidden; }
.live-hp-card { margin: 0 0 12px; padding: 14px; border: 1px solid var(--wg-border); border-radius: 14px; background: #fff; display: flex; flex-direction: column; gap: 5px; }
.live-hp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.live-hp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.live-tag { padding: 3px 10px; border-radius: 999px; background: #f1f3f5; font-size: 0.76rem; font-weight: 600; }
.live-hp-actions { display: flex; gap: 8px; margin-top: 6px; }
.live-hp-actions .wg-btn { width: auto; flex: 1; padding: 8px 6px; font-size: 0.85rem; }

/* Safety + source footers */
.live-safety-box { margin: 0 0 12px; padding: 13px 14px; border-radius: 14px; background: #e8f7ee; color: #14532d; font-size: 0.88rem; line-height: 1.5; }
.live-source-box { margin: 0 0 12px; padding: 11px 14px; border-radius: 10px; background: #f4f6f8; color: var(--wg-muted); font-size: 0.8rem; line-height: 1.5; }

/* Emergency-alert translation affordance. */
.live-alert-orig-toggle {
  display: inline-block;
  margin: 2px 0 0;
  padding: 0;
  font: inherit;
  font-size: 0.8rem;
  color: var(--wg-muted);
  background: none;
  border: none;
  cursor: pointer;
}
.live-alert-orig-toggle .live-alert-orig-label { color: var(--wg-color); text-decoration: underline; }
.live-alert-orig {
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  white-space: pre-line;
  color: var(--wg-text);
  background: var(--wg-tint, #f4fbf7);
  border: 1px solid var(--wg-border-soft, #e6efe9);
  border-radius: 8px;
}
.live-alert-konote { margin-top: 4px; font-size: 0.8rem; font-style: italic; }

/* Exchange rate list: search filter + pagination (long currency list). */
.live-fx-rates .live-fx-search { width: 100%; margin-bottom: 10px; padding: 10px 12px; font: inherit; font-size: 16px; border: 1px solid var(--wg-border); border-radius: var(--wg-radius); }
.live-fx-nomatch { text-align: center; color: var(--wg-muted); padding: 10px 0; margin: 0; }
.live-fx-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 10px; }
.live-fx-pgbtn { width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--wg-border); background: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--wg-text); }
.live-fx-pgbtn:disabled { opacity: .4; cursor: default; }
.live-fx-pgbtn:not(:disabled):hover { border-color: var(--wg-color); color: var(--wg-color); }
.live-fx-pginfo { font-size: 0.9rem; color: var(--wg-muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.live-fx-country { color: var(--wg-muted); font-weight: 400; font-size: 0.9em; }

/* ── Expandable day → hour-by-hour ────────────────────────────────────────────
   A day's headline rain % is its PEAK for the whole day, so it cannot answer
   "will it rain while I'm out at noon?". Tapping a day opens the hours behind
   that number. */
.live-sec-hint { margin: -4px 0 10px; font-size: .8rem; color: var(--wg-muted); }
.live-day { border-bottom: 1px solid #f1f3f5; }
.live-day:last-child { border-bottom: none; }
.live-day .live-row { border-bottom: none; }
.live-row-btn {
  width: 100%; font: inherit; text-align: left; background: none; border: 0;
  cursor: pointer; border-radius: 8px; transition: background .16s var(--wg-ease-out, ease);
  min-height: 44px;   /* comfortable touch target */
}
.live-row-btn:hover { background: #f7f9fb; }
.live-row-caret {
  flex: none; color: var(--wg-muted); font-size: 1.35rem; line-height: 1;
  transition: transform .2s var(--wg-ease-spring, ease);
}
.live-row-btn.is-open .live-row-caret { transform: rotate(90deg); }

.live-day-panel { padding: 2px 0 12px; }
.live-day-sum {
  margin: 0 0 8px; font-size: .86rem; font-weight: 700; color: #2f80c3;
  background: rgba(47, 128, 195, .08); border-radius: 8px; padding: 7px 10px;
}
.live-day-sum.is-dry { color: var(--wg-muted); background: rgba(120, 130, 140, .07); font-weight: 600; }

.live-day-hours {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.live-hcell {
  flex: 0 0 auto; width: 56px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 2px; border-radius: 10px; background: #f7f9fb; font-size: .76rem;
}
.live-hcell.is-wet { background: rgba(47, 128, 195, .12); }
.live-hcell-t { color: var(--wg-muted); font-variant-numeric: tabular-nums; }
.live-hcell-i { font-size: 1.05rem; line-height: 1.1; }
.live-hcell-temp { font-weight: 800; }
.live-hcell-rain { color: #2f80c3; font-variant-numeric: tabular-nums; }
.live-hcell-mm { color: #2f80c3; font-size: .68rem; min-height: .9em; }

@media (prefers-reduced-motion: reduce) {
  .live-row-btn, .live-row-caret { transition: none; }
}
