/**
 * Shared forecast overlay styles for /forecast prototype and kiosk camera stills.
 */

:root {
  --forecast-overlay-fg: #e6eefc;
  --forecast-overlay-muted: #c8d6ef;
  --forecast-overlay-accent: #4ea1ff;
  --forecast-overlay-temp-low: #7eb8ff;
  --forecast-overlay-text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85), 0 0 28px rgba(0, 0, 0, 0.55);
  --forecast-overlay-card-glass: rgba(7, 14, 26, 0.5);
  --forecast-overlay-today-glass: rgba(7, 14, 26, 0.1);
  --forecast-overlay-inset-top: 12px;
  --forecast-overlay-inset-x: 14px;
  /** Extra top inset for the today card — clears camera still/video labels on overlay. */
  --forecast-overlay-today-top-offset: 5vh;
}

.forecastOverlayContent {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--forecast-overlay-inset-x) 10px;
  box-sizing: border-box;
  pointer-events: none;
  color: var(--forecast-overlay-fg);
}

/** Camera still overlay: clear header labels, centre today card above the day strip. */
.forecastOverlayContent--camera {
  padding-top: calc(var(--forecast-overlay-inset-top) + var(--forecast-overlay-today-top-offset));
}

.forecastOverlayContent--camera .forecastOverlayStack {
  flex: 1 1 auto;
  min-height: 0;
}

.forecastOverlayContent--camera .forecastTodayZone {
  flex: 1 1 0;
  max-height: none;
  min-height: 0;
  padding-top: 0;
  align-items: center;
  justify-content: center;
}

.forecastOverlayContent--camera .forecastTodayCard {
  max-height: 100%;
}

.forecastOverlayContent--camera .forecastDayRest {
  margin-top: 0;
  flex: 0 0 auto;
}

/** Mode label centred at top of overlay today card (forecast and live weather). */
.weatherOverlayModeLabel {
  margin: 0 0 6px;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forecast-overlay-accent);
  text-align: center;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastDayRest,
.forecastDayCard {
  pointer-events: auto;
}

.forecastOverlayRoot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.forecastOverlayRoot--multi {
  gap: 8px;
}

.forecastOverlay {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.forecastOverlayStack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.forecastTodayZone {
  flex: 0 1 60%;
  max-height: 60%;
  min-height: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: calc(var(--forecast-overlay-inset-top) + var(--forecast-overlay-today-top-offset));
  box-sizing: border-box;
}

.forecastTodayCard {
  width: 50%;
  max-width: 50%;
  max-height: calc(
    60vh - var(--forecast-overlay-inset-top) - var(--forecast-overlay-today-top-offset)
  );
  box-sizing: border-box;
  background: var(--forecast-overlay-today-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(4px);
  padding: clamp(12px, 2vh, 22px) clamp(14px, 2.5vw, 28px);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.forecastTodayCardLocation {
  margin: 0 0 clamp(6px, 1.2vh, 12px);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forecast-overlay-muted);
  text-align: center;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastTodayHero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: clamp(4px, 1vh, 10px);
}

.forecastTodayHeroDate {
  margin: 0;
  font-size: clamp(18px, 3.2vw, 36px);
  font-weight: 650;
  color: var(--forecast-overlay-fg);
  line-height: 1.15;
  text-wrap: balance;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastTodayHeroIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(72px, 12vw, 140px);
  height: clamp(72px, 12vw, 140px);
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.65));
}

.forecastTodayHeroIcon .forecast-icon {
  width: 100%;
  height: 100%;
}

.forecastTodayHeroIcon .forecast-svg {
  width: min(100%, 140px);
  height: min(100%, 140px);
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.forecastTodayHeroCondition {
  margin: 0;
  font-size: clamp(14px, 2vw, 24px);
  font-weight: 500;
  color: var(--forecast-overlay-muted);
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastTodayHeroTemps {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(8px, 1.5vw, 16px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastTodayHeroMax {
  font-size: clamp(32px, 6vh, 72px);
  font-weight: 700;
  color: var(--forecast-overlay-fg);
}

.forecastTodayHeroMin {
  font-size: clamp(18px, 3.5vh, 40px);
  font-weight: 500;
  color: var(--forecast-overlay-temp-low);
}

.forecastDayRest {
  flex: 0 0 auto;
  margin-top: auto;
  width: 100%;
  max-height: 19%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  padding: 0 2px 12px;
}

.forecastDayCard {
  container-type: inline-size;
  aspect-ratio: 4 / 3;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  align-self: end;
  background: var(--forecast-overlay-card-glass);
  border: none;
  border-radius: 10px;
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 5px 3px 7px;
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
}

.forecastDayCardDay {
  font-size: clamp(10px, 14cqi, 16px);
  font-weight: 650;
  color: var(--forecast-overlay-muted);
  line-height: 1.1;
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastDayCardIcon {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  max-height: 38%;
  padding: 1px 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.forecastDayCardTemps {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  width: 100%;
  text-shadow: var(--forecast-overlay-text-shadow);
}

.forecastDayCardMax {
  font-size: clamp(13px, 20cqi, 24px);
  font-weight: 700;
  color: var(--forecast-overlay-fg);
}

.forecastDayCardMin {
  font-size: clamp(10px, 15cqi, 18px);
  font-weight: 500;
  color: var(--forecast-overlay-temp-low);
}

.forecast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: var(--forecast-overlay-accent);
  width: 100%;
  height: 100%;
}

.forecast-icon .forecast-svg {
  width: min(100%, 36cqi);
  height: min(100%, 36cqi);
  max-width: 36cqi;
  max-height: 36cqi;
  display: block;
}

.forecastPageEmpty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--forecast-overlay-muted);
  padding: 24px;
  text-shadow: var(--forecast-overlay-text-shadow);
}

@media (max-width: 720px) {
  .forecastDayRest {
    gap: 4px;
  }

  .forecastDayCard {
    padding: 4px 2px 5px;
    border-radius: 8px;
  }

  .forecastTodayCard {
    width: min(88%, 420px);
    max-width: 88%;
  }
}

/** Full-stage forecast scheduled display mode (/display). */
.displayModeForecast {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: var(--forecast-overlay-fg);
  background:
    linear-gradient(180deg, rgba(7, 14, 26, 0.15) 0%, rgba(7, 14, 26, 0.55) 100%),
    radial-gradient(circle at 30% 20%, #2a4a72 0%, #0b1220 55%, #050a12 100%);
}

.displayModeForecastInner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--forecast-overlay-inset-top) var(--forecast-overlay-inset-x) 12px;
  box-sizing: border-box;
}

.displayModeForecast--empty {
  align-items: center;
  justify-content: center;
}

/** Full-stage timelapse scheduled display mode (/display). */
.displayModeTimelapse {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  background: #000;
}

.displayModeTimelapseStage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.displayModeTimelapseTitle {
  position: absolute;
  top: clamp(10px, 2vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  padding: 0 clamp(12px, 3vw, 24px);
  max-width: calc(100% - 24px);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--forecast-overlay-muted, #9fb4d9);
  text-align: center;
  text-shadow: var(--forecast-overlay-text-shadow, 0 1px 3px rgba(0, 0, 0, 0.85));
  pointer-events: none;
  line-height: 1.15;
}

.displayModeTimelapseMeta {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  font-size: 12px;
  color: #cfe3ff;
  font-variant-numeric: tabular-nums;
  background: rgba(7, 14, 26, 0.82);
  border: 1px solid rgba(93, 168, 255, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  pointer-events: none;
}

/** Site name when timelapse location is ALL — bottom-left, clear of period label and meta. */
.displayModeTimelapseLocationBadge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  font-size: clamp(14px, 2.1vw, 20px);
  font-weight: 650;
  letter-spacing: 0.03em;
  color: #eef4ff;
  background: rgba(7, 14, 26, 0.82);
  border: 1px solid rgba(93, 168, 255, 0.45);
  border-radius: 8px;
  padding: 6px 12px;
  pointer-events: none;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.displayModeTimelapsePeriodLabel {
  position: absolute;
  left: 50%;
  bottom: clamp(36px, 6vh, 56px);
  transform: translateX(-50%);
  z-index: 3;
  margin: 0;
  padding: 8px 22px;
  max-width: calc(100% - 48px);
  font-size: clamp(22px, 3.2vw, 36px);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #eef4ff;
  text-align: center;
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  background: rgba(7, 14, 26, 0.78);
  border: 1px solid rgba(93, 168, 255, 0.4);
  border-radius: 10px;
  pointer-events: none;
}

.displayModeTimelapseImage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.displayModeTimelapseFrame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
}

.displayModeTimelapseSolarOverlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.displayModeTimelapseVisual {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
}

.displayModeTimelapsePlaceholder {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: linear-gradient(180deg, #2a3340 0%, #4a4a4a 52%, #3a3530 100%);
}

.displayModeTimelapseSolar {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.displayModeTimelapseSolar--overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
}

.displayModeTimelapseSolarArc {
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.displayModeTimelapseSolar--overlay .displayModeTimelapseSolarArc {
  stroke: rgba(255, 255, 255, 0.68);
  stroke-width: 1.75;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85));
  vector-effect: non-scaling-stroke;
}

.displayModeTimelapseSolarIcon {
  stroke: rgba(255, 236, 170, 0.95);
  stroke-width: 0.55;
  fill: rgba(255, 236, 170, 0.95);
}

.displayModeTimelapseSolar--overlay .displayModeTimelapseSolarIcon {
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.9));
}

.displayModeTimelapseSolarIcon--sun line {
  stroke: rgba(255, 236, 170, 0.95);
  stroke-width: 0.65;
  stroke-linecap: round;
}

.displayModeTimelapseSolarIcon--sun circle {
  fill: rgba(255, 220, 90, 0.98);
  stroke: rgba(255, 245, 200, 0.95);
  stroke-width: 0.55;
}

.displayModeTimelapseSolarIcon--twilight .displayModeTimelapseSolarIconTwilightDisc {
  fill: rgba(255, 138, 42, 0.98);
  stroke: rgba(255, 176, 88, 0.95);
  stroke-width: 0.55;
}

.displayModeTimelapseSolarIcon--twilight .displayModeTimelapseSolarIconTwilightShade {
  fill: rgba(24, 44, 88, 0.78);
  stroke: none;
}

.displayModeTimelapseSolarIcon--moon circle {
  fill: rgba(220, 228, 245, 0.95);
  stroke: rgba(240, 244, 255, 0.9);
  stroke-width: 0.45;
}

.displayModeTimelapsePlaceholderNumber {
  font-size: clamp(120px, 28vw, 240px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.5);
  font-family: Georgia, "Times New Roman", Times, serif;
  user-select: none;
}

.displayModeTimelapse--empty {
  padding: 24px;
  text-align: center;
}
