/* Built for a 16:9 TV viewed from a couch: big text, high contrast,
   everything fits on one screen with no scrolling, nothing flashy. */

:root {
  --bg: #0a1420;
  --panel: #10202f;
  --panel-border: #1f3b52;
  --text: #f2f6f9;
  --text-dim: #9db3c4;
  --accent: #4fc3f7;
  --warning-bg: #c62828;
  --warning-text: #ffffff;
  --focus-ring: #ffd54f;

  /* Charts render as plain scientific-instrument plots: a white "screen"
     with a black axis frame, regardless of the surrounding dark theme. */
  --chart-bg: #ffffff;
  --chart-axis: #141414;
  --chart-grid: #d9d9d9;
  --chart-grid-day: #bdbdbd;
  --chart-text: #141414;
  --chart-text-dim: #5a5a5a;
  --chart-now: #c62828;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

button {
  font-family: inherit;
  color: inherit;
}

.screen {
  display: none;
  width: 100vw;
  height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===================== PICKER ===================== */

#picker-screen {
  padding: 4vh 6vw;
  align-items: center;
}

.picker-title {
  font-size: 5vh;
  margin: 0 0 1vh 0;
}

.picker-hint {
  font-size: 2.4vh;
  color: var(--text-dim);
  margin: 0 0 3vh 0;
}

.picker-list {
  width: 100%;
  max-width: 900px;
  overflow-y: auto;
  flex: 1;
}

.picker-region-heading {
  font-size: 2vh;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin: 2.5vh 0 1vh 0;
}

.picker-item {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 3.4vh;
  padding: 1.6vh 2vw;
  margin-bottom: 1vh;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 10px;
  cursor: pointer;
}

.picker-item.focused {
  border-color: var(--focus-ring);
  background: #1a3347;
  outline: none;
}

/* ===================== DASHBOARD ===================== */

#dashboard-screen {
  padding: 3vh 4vw;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5vh;
}

.location-block h1 {
  font-size: 5.5vh;
  margin: 0;
  line-height: 1.1;
}

.location-region {
  font-size: 2.4vh;
  color: var(--text-dim);
}

.change-location-btn {
  font-size: 2vh;
  padding: 1.2vh 2vw;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
}

.change-location-btn.focused {
  border-color: var(--focus-ring);
  background: #1a3347;
  outline: none;
}

.warning-banner {
  display: none;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 2.6vh;
  font-weight: 700;
  text-align: center;
  padding: 1.4vh;
  border-radius: 8px;
  margin-bottom: 1.5vh;
  letter-spacing: 0.02em;
}

.warning-banner.visible {
  display: block;
}

/* ===================== NOW STRIP (right now, at a glance) ===================== */

.now-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr;
  gap: 1.2vh 1.2vw;
  margin-bottom: 1.4vh;
}

.now-chip {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  padding: 1vh 1.2vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.now-chip.no-data {
  opacity: 0.4;
}

.now-label {
  font-size: 1.5vh;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  white-space: nowrap;
}

.now-wind-main {
  display: flex;
  align-items: center;
  gap: 0.6vw;
  min-width: 0;
}

.now-wind-arrow {
  width: 3.4vh;
  height: 3.4vh;
  color: var(--accent);
  flex-shrink: 0;
  transition: transform 0.4s ease;
}

.now-value {
  font-size: 4.4vh;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.now-value .now-unit {
  font-size: 2vh;
  font-weight: 400;
  margin-left: 0.3vw;
  color: var(--text-dim);
}

.now-sub {
  font-size: 1.5vh;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-sub.large {
  font-size: 2.1vh;
  color: var(--text);
  font-weight: 600;
}

/* ===================== CHART GRID (7 days ahead) ===================== */

.chart-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1vh;
  min-height: 0;
}

.chart-row {
  flex: 1.2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1vh 1vw;
  min-height: 0;
}

.chart-panel {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  padding: 0.8vh 1vw;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chart-panel-tide {
  flex: 1;
}

.chart-title {
  font-size: 1.5vh;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-legend {
  font-size: 1.3vh;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.3vh;
}

.legend-dot {
  display: inline-block;
  width: 1vh;
  height: 1vh;
  border-radius: 50%;
  margin-left: 0.6vw;
}
.legend-dot:first-child {
  margin-left: 0;
}
/* Kept in sync with CHART_COLORS in app.js - the actual chart dots. */
.legend-wind { background: #0b63ce; }
.legend-gust { background: #8a8f98; }
.legend-wave { background: #00897b; }
.legend-swell { background: #00463f; }
.legend-period { background: #c6690a; }

.chart-box {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--chart-bg);
  border-radius: 4px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chart-text-dim);
  font-size: 1.8vh;
}

.chart-gridline {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.chart-gridline-day {
  stroke: var(--chart-grid-day);
  stroke-dasharray: 2 2;
}

.chart-axis-line {
  stroke: var(--chart-axis);
  stroke-width: 1.5;
}

.chart-day-label {
  fill: var(--chart-text-dim);
  font-size: 10px;
}

.chart-axis-label {
  fill: var(--chart-text);
  font-size: 10px;
}

.chart-dot {
  stroke: none;
}

.chart-marker-label {
  fill: var(--chart-text);
  font-size: 11px;
  font-weight: 700;
}

.chart-marker-dot {
  fill: var(--chart-axis);
}

.chart-now-line {
  stroke: var(--chart-now);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}

.dash-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5vh;
  font-size: 2vh;
}

.zone-info {
  display: flex;
  align-items: center;
  gap: 1.2vw;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
  margin-right: 2vw;
}

.zone-badge {
  background: #1a3347;
  color: var(--text);
  padding: 0.4vh 1vw;
  border-radius: 6px;
  font-weight: 600;
  white-space: nowrap;
}

.zone-link {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.status-line {
  color: var(--text-dim);
  white-space: nowrap;
}
