/* ─── Imports & Tokens ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Layout geometry */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 16px;

  /* East Bay Dipping Society Brand Color System */
  --bg-deep: #F5DDD5;
  --bg-ocean: #F5DDD5;
  --bg-2: #1DBFBF;
  --bg: #F5DDD5;
  --header-bg: #1DBFBF;
  
  --primary: #1DBFBF;
  --primary-dim: rgba(29, 191, 191, 0.1);
  --primary-glow: rgba(29, 191, 191, 0.35);
  --secondary: #A8C8D8;
  --accent: #E8927C;
  --accent-dim: rgba(232, 146, 124, 0.12);
  --dark-navy: #1A2744;
  
  --high: #1DBFBF;
  --low: #A8C8D8;
  
  --text: #2E2E2E;
  --text-muted: #2E2E2E;
  --text-dim: #2E2E2E;
  
  --surface: #FFFFFF;
  --surface-h: #FFFFFF;
  --border: rgba(26, 39, 68, 0.15);
  --border-h: #1DBFBF;
}

body.theme-overcast {
  --bg-deep: #F5DDD5;
  --bg-ocean: #F5DDD5;
  --bg-2: #1DBFBF;
  --bg: #F5DDD5;
  --header-bg: #1DBFBF;
  
  --primary: #1DBFBF;
  --primary-dim: rgba(29, 191, 191, 0.1);
  --primary-glow: rgba(29, 191, 191, 0.35);
  --secondary: #A8C8D8;
  --accent: #E8927C;
  --accent-dim: rgba(232, 146, 124, 0.12);
  --dark-navy: #1A2744;
  
  --text: #2E2E2E;
  --text-muted: #2E2E2E;
  --text-dim: #2E2E2E;
  
  --surface: #FFFFFF;
  --surface-h: #FFFFFF;
  --border: rgba(26, 39, 68, 0.15);
  --border-h: #1DBFBF;
}

body.theme-sunny {
  --bg-deep: #F5DDD5;
  --bg-ocean: #F5DDD5;
  --bg-2: #1DBFBF;
  --bg: #F5DDD5;
  --header-bg: #1DBFBF;
  
  --primary: #1DBFBF;
  --primary-dim: rgba(29, 191, 191, 0.1);
  --primary-glow: rgba(29, 191, 191, 0.35);
  --secondary: #A8C8D8;
  --accent: #E8927C;
  --accent-dim: rgba(232, 146, 124, 0.12);
  --dark-navy: #1A2744;
  
  --text: #2E2E2E;
  --text-muted: #2E2E2E;
  --text-dim: #2E2E2E;
  
  --surface: #FFFFFF;
  --surface-h: #FFFFFF;
  --border: rgba(26, 39, 68, 0.15);
  --border-h: #1DBFBF;
}

body.theme-storm {
  --bg-deep: #F5DDD5;
  --bg-ocean: #F5DDD5;
  --bg-2: #1DBFBF;
  --bg: #F5DDD5;
  --header-bg: #1DBFBF;
  
  --primary: #1DBFBF;
  --primary-dim: rgba(29, 191, 191, 0.1);
  --primary-glow: rgba(29, 191, 191, 0.35);
  --secondary: #A8C8D8;
  --accent: #E8927C;
  --accent-dim: rgba(232, 146, 124, 0.12);
  --dark-navy: #1A2744;
  
  --text: #2E2E2E;
  --text-muted: #2E2E2E;
  --text-dim: #2E2E2E;
  
  --surface: #FFFFFF;
  --surface-h: #FFFFFF;
  --border: rgba(26, 39, 68, 0.15);
  --border-h: #1DBFBF;
}

/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* ─── Animated Ocean Background ────────────────────────────────────────────── */
.ocean-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, var(--bg-ocean) 0%, var(--bg-deep) 100%);
  z-index: -1;
  overflow: hidden;
  transition: background 0.5s ease;
}

.ocean-particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  animation: float-particle 12s ease-in-out infinite;
}

@keyframes float-particle {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }

  20% {
    opacity: 0.15;
  }

  80% {
    opacity: 0.08;
  }

  100% {
    opacity: 0;
    transform: translateY(-120px) scale(1);
  }
}

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.container {
  /* App-like phone-width column, centered — the site is checked mostly on
     phones, so we present the same compact single-column view on desktop
     rather than fanning content across the whole page. */
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 2px solid var(--dark-navy); /* Bold navy border */
  box-shadow: 0 4px 16px rgba(26, 39, 68, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-wave {
  font-size: 22px;
  animation: wave-bob 3s ease-in-out infinite;
}

@keyframes wave-bob {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(5deg);
  }
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.header-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.header-time {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ─── Hero Section ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 60px 0 0;
  overflow: hidden;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #2E2E2E;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  background: #A8C8D8; /* Wave Blue background */
  padding: 5px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border); /* Dark Navy */
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.hero-location:hover {
  background-color: var(--primary);
  color: var(--dark-navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 191, 191, 0.25);
  border-color: var(--primary);
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.05;
  color: var(--text);
  -webkit-text-fill-color: initial;
  background-image: none;
  background-clip: initial;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
}

/* ─── Hero Cards ────────────────────────────────────────────────────────────── */
.hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 0;
}

/* ─── Layout Toggle UI ──────────────────────────────────────────────────────── */
.hero-layout-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.3s;
}

.toggle-pill {
  display: inline-flex;
  background: rgba(26, 39, 68, 0.06);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 4px;
  box-shadow: inset 0 2px 6px rgba(26, 39, 68, 0.1);
}

.toggle-btn {
  background: transparent;
  color: var(--text);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  color: var(--primary);
}

.toggle-btn.active {
  background: linear-gradient(135deg, #1DBFBF, #A8C8D8);
  color: #2E2E2E;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(29, 191, 191, 0.2);
}

/* Toggle Layout Rules */
body.layout-toggle .hero-block {
  display: none;
}

body.layout-toggle .hero-block.active {
  display: block;
  animation: fade-in-tab 0.4s ease;
}

@keyframes fade-in-tab {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Split Layout Rules */
body.layout-split .hero-toggle-ui {
  display: none !important;
}

body.layout-split .hero-layout-wrapper {
  display: block;
}

body.layout-split .hero-block {
  display: block;
}

body.layout-split .hero-block .glass-card {
  height: auto;
}

@media (max-width: 768px) {
  .hero-cards {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.4rem;
  }
}

/* ─── Glass Card ────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 24px rgba(26, 39, 68, 0.04);
  transition: border-color 0.3s, background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  border-color: var(--border-h);
  background: var(--surface-h);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26, 39, 68, 0.08);
}

.hero-card {
  text-align: center;
}

.hero-card.highlight {
  border-color: rgba(0, 181, 194, 0.25);
  background: rgba(0, 181, 194, 0.06);
  box-shadow: 0 0 40px rgba(0, 181, 194, 0.08), inset 0 1px 0 rgba(0, 181, 194, 0.15);
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-value {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 8px;
}

.hero-card.highlight .card-value {
  color: var(--primary);
  text-shadow: 0 0 30px rgba(0, 181, 194, 0.4);
}

.card-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.countdown {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.weather-emoji-hero {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 8px;
}

/* ─── Loading Skeleton ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-h) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
  height: 1em;
  min-width: 60px;
  display: inline-block;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* ─── Wave Divider ──────────────────────────────────────────────────────────── */
.wave-divider {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  margin-top: 32px;
}

.wave-divider svg {
  display: block;
  width: 100%;
  height: 80px;
}

.wave-path-1 {
  fill: var(--bg-2);
  opacity: 0.8;
  animation: wave-shift 8s ease-in-out infinite;
}

.wave-path-2 {
  fill: var(--bg-2);
  opacity: 0.5;
  animation: wave-shift 12s ease-in-out infinite reverse;
}

@keyframes wave-shift {

  0%,
  100% {
    d: path("M0,40 C360,80 720,0 1440,40 L1440,80 L0,80 Z");
  }

  50% {
    d: path("M0,50 C360,10 720,70 1440,50 L1440,80 L0,80 Z");
  }
}

/* ─── Main Content ──────────────────────────────────────────────────────────── */
.main-content {
  background: var(--bg-2);
  padding: 64px 0 80px;
}

.section {
  margin-bottom: 72px;
}

.section-header {
  margin-bottom: 28px;
}

.main-content .section-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #FFFFFF;
  margin-bottom: 4px;
}

.main-content .section-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

/* ─── Tide Chart ────────────────────────────────────────────────────────────── */
.chart-card {
  padding: 28px 20px 20px;
  overflow: hidden;
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

#tide-chart {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── Consolidated Grid ──────────────────────────────────────────────────────── */
.consolidated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.consolidated-grid.limit-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
  justify-content: center;
}

.consolidated-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s, background-color 0.25s;
  cursor: default;
  display: flex;
  flex-direction: column;
}

.consolidated-card:hover {
  border-color: var(--accent);
  background-color: #FFEBE5;
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(26, 39, 68, 0.08);
}

.consolidated-card.today {
  border: 2px solid var(--primary) !important;
  background: #ffffff !important;
}

.cons-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cons-day-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.cons-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cons-wx {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: right;
}

.cons-wx-details {
  display: flex;
  flex-direction: column;
}

.cons-wx-desc {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.cons-wx-temps {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.cons-wx-emoji {
  font-size: 2rem;
  line-height: 1;
}

.tide-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.tide-entry:last-child {
  margin-bottom: 0;
}

.tide-type-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 2px 7px;
  border-radius: 100px;
  flex-shrink: 0;
}

.tide-type-badge.high {
  background: rgba(29, 191, 191, 0.22);
  color: var(--dark-navy);
  border: 1px solid rgba(29, 191, 191, 0.4);
}

.tide-type-badge.low {
  background: rgba(168, 200, 216, 0.3);
  color: var(--dark-navy);
  border: 1px solid rgba(168, 200, 216, 0.5);
}

.tide-time-text {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tide-height-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Option C: Redesigned Vertical Column ─────────────────────────────────── */
.vertical-column-gauge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 140px;
  min-height: 220px;
  transition: opacity 1s ease;
  padding-left: 50px;
}

.v-track {
  position: relative;
  width: 24px;
  height: 160px;
  background: var(--surface-h);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: visible;
}

.v-zone {
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0.15;
}

.v-zone.v-zone-king {
  background: #FFD700; /* Gold */
  border-radius: 12px 12px 0 0;
}

.v-zone.v-zone-epic {
  background: var(--primary);
}

.v-zone.v-zone-gritty {
  background: var(--accent);
  border-radius: 0 0 12px 12px;
}

.v-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: linear-gradient(to top, var(--secondary), var(--primary));
  border-radius: 0 0 12px 12px;
  box-shadow: 0 0 16px var(--primary-glow);
  transition: height 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}

.v-fill-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #fff;
  opacity: 0.8;
  box-shadow: 0 0 10px #fff;
}

/* Vertical labels overlay */
.v-label-overlay {
  position: absolute;
  right: 36px;
  transform: translateY(50%);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
  text-align: right;
}

.v-label-overlay.v-label-epic {
  transform: translateY(110%);
}

.v-label-overlay.v-label-king {
  transform: translateY(-10%);
}

.v-label-overlay::after {
  content: ' —';
  color: var(--border);
}

.v-indicator-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 90px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(26, 39, 68, 0.05);
}

.v-indicator-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.v-indicator-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}

/* ─── Unified Live Card ────────────────────────────────────────────────────── */
.live-status-card {
  padding: 28px !important;
  border: 1.5px solid var(--border) !important;
  border-top: 4px solid var(--primary) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(26, 39, 68, 0.05);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.live-status-card:hover {
  border-color: var(--primary) !important;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(29, 191, 191, 0.12);
}

.live-columns-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 32px;
}

.live-tide-column {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.live-weather-column {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
}

.live-tide-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-tide-label {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--dark-navy);
  text-transform: none;
}

.live-tide-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.live-tide-value {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text);
}

.live-tide-direction {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  animation: pulse-direction 2s infinite ease-in-out;
}

@keyframes pulse-direction {

  0%,
  100% {
    opacity: 0.7;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.live-tide-status {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.live-stats-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  margin-left: auto;
}

@media (max-width: 500px) {
  .live-stats-badges {
    margin-left: 0;
    align-items: flex-start;
    width: 100%;
  }
}

.live-weather-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  background: rgba(26, 39, 68, 0.04);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

@media (max-width: 500px) {
  .live-weather-badge {
    align-items: flex-start;
    text-align: left;
  }
}

.live-water-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(29, 191, 191, 0.08);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.live-water-emoji {
  font-size: 1.4rem;
}

.live-water-temp {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark-navy);
}

.live-wx-emoji {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 4px;
}

.live-wx-temp {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.live-wx-wind {
  font-size: 11px;
  color: var(--text-dim);
}


/* ─── Saturday Planner Pane ────────────────────────────────────────────────── */
.dip-planner-card {
  padding: 28px !important;
  border: 1.5px solid var(--border) !important;
  border-top: 4px solid var(--accent) !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(26, 39, 68, 0.05);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.dip-planner-card:hover {
  border-color: var(--accent) !important;
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(232, 146, 124, 0.12);
}

.dip-card-date {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--dark-navy);
  margin-bottom: 20px;
  text-align: left;
}

.dip-planner-content {
  display: flex;
  gap: 32px;
  align-items: stretch;
}

.dip-details-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 16px;
  text-align: left;
}

.dip-tide-hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.dip-tide-height {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.dip-condition-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid;
}

.dip-condition-badge.king {
  background: #FFD700; /* Gold background */
  color: #2E2E2E;
  border-color: #1A2744;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.dip-condition-badge.epic {
  background: #1DBFBF; /* Teal background */
  color: #2E2E2E; /* Charcoal text for contrast */
  border-color: #1A2744; /* Dark Navy border */
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(29, 191, 191, 0.2);
}

.dip-condition-badge.optimal,
.dip-condition-badge.average {
  background: #A8C8D8; /* Wave Blue background */
  color: #2E2E2E;
  border-color: #1A2744;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(168, 200, 216, 0.2);
}

.dip-condition-badge.gritty {
  background: #E8927C; /* Coral/Salmon background */
  color: #2E2E2E;
  border-color: #1A2744;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(232, 146, 124, 0.2);
}

.dip-weather-pane {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
}

.dip-wx-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dip-wx-big-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.dip-wx-temps {
  display: flex;
  flex-direction: column;
}

.dip-wx-high {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.dip-wx-low {
  font-size: 12px;
  color: var(--text-dim);
}

.dip-wx-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

@media (max-width: 480px) {
  .dip-weather-pane {
    flex-direction: column;
    align-items: flex-start;
  }

  .dip-wx-stats {
    margin-left: 0;
    border-left: none;
    padding-left: 0;
    flex-direction: row;
    gap: 16px;
  }
}

/* ─── Collapsible Weekly Drawer ────────────────────────────────────────────── */
.weekly-drawer {
  max-height: 4000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0, 1, 0, 1), opacity 0.4s ease, padding 0.6s ease;
}

.weekly-drawer.collapsed {
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  pointer-events: none;
}

.weekly-outlook-btn {
  background: #ffffff;
  color: var(--dark-navy); /* Dark Navy text */
  border: 2px solid var(--primary); /* Bold Teal border */
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(26, 39, 68, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
}

.weekly-outlook-btn:hover {
  background: var(--primary); /* Solid Teal on hover */
  border-color: var(--primary);
  color: var(--dark-navy); /* Dark Navy text for high contrast on teal */
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(29, 191, 191, 0.25);
}

.weekly-outlook-btn .arrow-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.weekly-outlook-btn.active .arrow-icon {
  transform: rotate(180deg);
}

/* ─── Today Tags ────────────────────────────────────────────────────────────── */
.today-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-dim);
  padding: 2px 8px;
  border-radius: 100px;
  margin-bottom: 8px;
}

/* ─── About / Footer ────────────────────────────────────────────────────────── */
.about-card {
  text-align: center;
  padding: 20px 28px;
}

.about-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

.about-card strong {
  color: var(--text);
}

.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}

.site-footer p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.8;
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
.fade-in {
  animation: fade-in 0.5s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-1 {
  animation-delay: 0.05s;
}

.stagger-2 {
  animation-delay: 0.10s;
}

.stagger-3 {
  animation-delay: 0.15s;
}

.stagger-4 {
  animation-delay: 0.20s;
}

.stagger-5 {
  animation-delay: 0.25s;
}

.stagger-6 {
  animation-delay: 0.30s;
}

.stagger-7 {
  animation-delay: 0.35s;
}

/* ─── Error Banner ──────────────────────────────────────────────────────────── */
.error-banner {
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.25);
  color: #ff7070;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  text-align: center;
}

/* ─── Mobile Optimizations ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-sub {
    display: none;
  }
  
  .dip-planner-content {
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }
  
  .dip-details-pane {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  
  .glass-card,
  .live-status-card,
  .dip-planner-card {
    padding: 18px !important;
  }

  .site-header .container {
    padding: 0 12px;
  }
  
  .logo-text {
    font-size: 18px;
  }
  
  .live-tide-value {
    font-size: 2.8rem;
  }
}

@media (max-width: 580px) {
  .live-columns-wrapper {
    flex-direction: column;
    gap: 24px;
  }
  
  .live-weather-column {
    align-items: flex-start;
  }
}

/* ─── Unified Dashboard ────────────────────────────────────────────────────── */
.unified-dashboard-card {
  padding: 32px !important;
  border-top: 4px solid var(--primary) !important;
  background: #ffffff !important;
  box-shadow: 0 10px 30px rgba(26, 39, 68, 0.06);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr; /* single-column stack at every width */
  gap: 20px;
  align-items: stretch;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
}

.dashboard-panel.panel-live {
  justify-content: space-between;
}

.dashboard-panel.panel-dip {
  justify-content: flex-start;
  /* Divider separating the forecast from the current-conditions section above */
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 24px;
}

.dashboard-panel.panel-gauge {
  align-items: center;
  justify-content: center;
  order: -1; /* gauge on top, matching the phone layout */
  margin: 8px 0;
}

.panel-subtitle {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark-navy);
  margin-bottom: 20px;
}

.dip-date {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

/* Surfboard Gauge Layout */
.surfboard-gauge-container {
  position: relative;
  width: 100%;
  max-width: 240px;
  height: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.surfboard-wrapper {
  position: relative;
  width: 90px;
  height: 290px;
  z-index: 2;
}

/* Floating Crown Easter Egg */
.surfboard-crown {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  z-index: 10;
  animation: crown-float 2.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.45));
}

@keyframes crown-float {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, -6px) rotate(3deg);
  }
}

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

/* Submersion Wave effect inside SVG */
.svg-wave-crest {
  animation: svg-wave-move 6s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes svg-wave-move {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50px); }
}

/* Marks and Labels overlays */
.surfboard-zones {
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: -20px;
  right: -20px;
  pointer-events: none;
  z-index: 1;
}

.zone-label {
  position: absolute;
  width: 100%;
  left: 0;
  border-top: 1px dashed rgba(26, 39, 68, 0.1);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.zone-label span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0.65;
  background: #ffffff;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: -15px;
}

/* Marker tags pointing to the board */
.surfboard-markers {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 3;
}

.tide-marker {
  position: absolute;
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: bottom 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.marker-current {
  right: 50%;
  margin-right: 48px;
}

.marker-current .marker-line-pointer {
  width: 25px;
  border-top: 1.5px dashed var(--primary);
}

.marker-current .marker-tag {
  background: var(--primary);
  color: #2E2E2E;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 10px var(--primary-glow);
  white-space: nowrap;
}

.marker-dip {
  left: 50%;
  margin-left: 48px;
}

.marker-dip .marker-line-pointer {
  width: 25px;
  border-top: 1.5px dashed var(--accent);
}

.marker-dip .marker-tag {
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 10px var(--accent-dim);
  white-space: nowrap;
}

/* Mobile & Stacking layouts for the unified card */
@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .dashboard-panel.panel-gauge {
    order: -1;
    margin: 20px 0;
  }
  
  .dashboard-panel.panel-live {
    gap: 20px;
  }
}

/* Narrow mobile device tag clipping prevention */
@media (max-width: 480px) {
  .surfboard-gauge-container {
    transform: scale(0.9);
  }
  
  .marker-current {
    margin-right: 36px;
  }
  
  .marker-current .marker-line-pointer {
    width: 15px;
  }
  
  .marker-dip {
    margin-left: 36px;
  }
  
  .marker-dip .marker-line-pointer {
    width: 15px;
  }
}
/* ── Water Quality info tooltip ─────────────────────────────── */
.wq-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
  outline: none;
}
.wq-info-icon {
  font-size: 13px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
.wq-info:hover .wq-info-icon,
.wq-info:focus-visible .wq-info-icon {
  opacity: 1;
}
.wq-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1000;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  overflow-wrap: anywhere;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(26, 39, 68, 0.18);
  /* Reset the heading's uppercase/spacing so body copy reads normally */
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  pointer-events: none;
}
.wq-info:hover .wq-tooltip,
.wq-info:focus-within .wq-tooltip,
.wq-info:focus-visible .wq-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 640px) {
  .wq-tooltip { left: 50%; transform: translate(-50%, -4px); }
  .wq-info:hover .wq-tooltip,
  .wq-info:focus-within .wq-tooltip { transform: translate(-50%, 0); }
}

/* Water-temp estimate marker (shown when NOAA sensor is offline and we fall
   back to a modeled Open-Meteo sea-surface temp) */
.wx-est {
  font-size: 0.82em;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.3px;
  cursor: help;
}

/* ── Classic layout (original wide desktop) ──────────────────────────────────
   Opt-in via ?layout=classic or the footer "Switch layout" link. Mobile Layout 1
   (the compact single-column view) is the default and lives in the base rules
   above; these selectors override back to the original wide arrangement. */
.wq-header-row { justify-content: flex-start; }        /* Mobile Layout 1 default */

.layout-classic .container {
  max-width: 1200px;
  padding: 0 24px;
}
.layout-classic .dashboard-panel.panel-dip {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}
.layout-classic .dip-date { display: none; }
.layout-classic .wq-header-row { justify-content: space-between; }

/* Restore the 3-across columns only above the mobile breakpoint, so classic
   still stacks (and leads with the gauge) on small screens like the original. */
@media (min-width: 901px) {
  .layout-classic .dashboard-grid {
    grid-template-columns: 1.2fr 1fr 1.2fr;
    gap: 32px;
  }
  .layout-classic .dashboard-panel.panel-gauge {
    order: 0;
    margin: 0;
  }
}
