/* OceanSafe Oaxaca · style.css
   Mobile-first · Zero external dependencies */

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

:root {
  --ocean:        #0077B6;
  --ocean-light:  #00B4D8;
  --ocean-dark:   #023E8A;
  --sand:         #F9C74F;
  --warning:      #F77F00;
  --danger:       #D62828;
  --safe:         #2DC653;
  --bg:           #EDF2F7;
  --card:         #FFFFFF;
  --text:         #1A1A2E;
  --muted:        #718096;
  --shadow:       0 2px 16px rgba(0, 0, 0, 0.08);
  --radius:       18px;
  --radius-sm:    10px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER ────────────────────────────────────────── */
.app-header {
  background: var(--ocean-dark);
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-icon { font-size: 1.5rem; }

.brand-name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: white;
}

.brand-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.lang-picker {
  position: relative;
}
.lang-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: white;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.25); }
.lang-hamburger {
  font-size: 1.15rem;
  line-height: 1;
  display: block;
}
.lang-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  background: white;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  overflow: hidden;
  z-index: 2000;
  min-width: 130px;
}
.lang-dropdown.open { display: flex; flex-direction: column; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.87rem;
  font-weight: 600;
  color: #1a2a3a;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  white-space: nowrap;
}
.lang-option:last-child { border-bottom: none; }
.lang-option:hover { background: #f0f6ff; }
.lang-option.active {
  background: #e3f0ff;
  color: var(--ocean);
}

/* ── BEACH BAR ─────────────────────────────────────── */
.beach-bar {
  background: var(--ocean);
  color: white;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.beach-bar-inner {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.beach-pin { font-size: 1.1rem; flex-shrink: 0; }

.beach-bar-name {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.change-beach-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.2s;
}
.change-beach-btn:hover { background: rgba(255, 255, 255, 0.32); }

/* ── DATA BADGE ────────────────────────────────────── */
.data-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 20px;
  background: #FFF3CD;
  font-size: 0.72rem;
  color: #856404;
  font-weight: 600;
  border-bottom: 1px solid #FFE499;
}

.data-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F77F00;
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.6); }
}

/* ── MAIN / CARD GRID ──────────────────────────────── */
.app-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-label {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.hidden { display: none !important; }

/* ── TIDE CARD ─────────────────────────────────────── */
.tide-card {
  background: linear-gradient(145deg, var(--ocean-dark) 0%, var(--ocean) 100%);
  color: white;
}

.tide-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tide-card .card-label { color: rgba(255, 255, 255, 0.6); }

.tide-estimated-label {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
  margin-left: 4px;
  align-self: center;
}

.current-speed-warn {
  font-size: 0.68rem;
  font-weight: 700;
  color: #721C24;
  background: #F8D7DA;
  border-radius: 5px;
  padding: 3px 6px;
  margin-top: 4px;
  display: block;
}

.tide-local-time {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

.tide-state-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 12px;
}

.tide-arrow {
  font-size: 5.5rem;
  line-height: 1;
  font-weight: 900;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.tide-arrow.rising  { animation: bounce-up   2s ease-in-out infinite; }
.tide-arrow.falling { animation: bounce-down 2s ease-in-out infinite; }
.tide-arrow.slack   { color: var(--sand); }

@keyframes bounce-up {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-9px); }
}
@keyframes bounce-down {
  0%, 100% { transform: translateY(0);  }
  50%       { transform: translateY(9px); }
}

.tide-state-text {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.3px;
  text-align: center;
  margin-top: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tide-sine-container {
  width: 100%;
  margin: 6px 0;
}
.tide-sine-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.tide-next-event {
  text-align: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
  margin-top: 4px;
  font-weight: 500;
}
.tide-next-event strong { color: white; }

.tide-events-row {
  display: flex;
  justify-content: space-around;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.tide-event-item { text-align: center; }

.tide-event-type {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2px;
}
.tide-event-type.is-now { color: var(--sand); }

.tide-event-time { font-size: 1.05rem; font-weight: 800; }
.tide-event-height { font-size: 0.72rem; color: rgba(255, 255, 255, 0.65); margin-top: 1px; }

/* ── CONDITIONS ROW ────────────────────────────────── */
.conditions-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.condition-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: background 0.3s;
}

.condition-icon   { font-size: 1.6rem; margin-bottom: 3px; }
.condition-value  { font-size: 1.85rem; font-weight: 900; line-height: 1; }
.condition-unit   { font-size: 0.68rem; color: var(--muted); margin-top: 1px; }
.condition-label  { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.condition-sublabel { font-size: 0.68rem; color: var(--muted); margin-top: 3px; font-weight: 600; }

/* UV color tiers */
.uv-low       { background: #D4EDDA; }
.uv-moderate  { background: #FFF3CD; }
.uv-high      { background: #FFE0C3; }
.uv-very-high { background: #F8D7DA; }
.uv-extreme   { background: #E8D5F5; }

/* Wave height tiers */
.wave-calm      { background: #D4EDDA; }
.wave-moderate  { background: #FFF3CD; }
.wave-rough     { background: #FFE0C3; }
.wave-dangerous { background: #F8D7DA; }

/* ── UV ACTION BANNER ──────────────────────────────── */
.uv-action-banner {
  background: linear-gradient(135deg, #F94144, #F8961E);
  color: white;
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
}
.uv-banner-icon { font-size: 1.5rem; flex-shrink: 0; }

/* ── LIFEGUARD BADGE ───────────────────────────────── */
.lifeguard-badge {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* ── CURRENT DIAGRAM ───────────────────────────────── */
.current-card { }

.current-diagram-container {
  width: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background: #ADE8F4;
}
.current-diagram-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.current-description {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  padding-top: 8px;
  border-top: 1px solid #EDF2F7;
}

/* ── WARNINGS CARD ─────────────────────────────────── */
.warnings-card { border-left: 4px solid var(--warning); }
.warnings-label { color: var(--warning) !important; }

.warnings-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warning-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  color: #3D1A00;
}
.warning-item::before {
  content: '⚠️';
  flex-shrink: 0;
  font-size: 1rem;
}

/* ── DANGER COCKTAIL CARD ──────────────────────────── */
.danger-cocktail-card {
  background: #1A1A2E;
  color: white;
}

.cocktail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.cocktail-skull { font-size: 2.4rem; flex-shrink: 0; }

.danger-cocktail-card .card-label { color: #FF6B6B; margin-bottom: 4px; }

.cocktail-subtitle {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

.cocktail-equation {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.cocktail-factor,
.cocktail-result {
  text-align: center;
  flex: 1;
  min-width: 64px;
}

.factor-icon, .result-icon  { font-size: 1.9rem; margin-bottom: 5px; }
.factor-name                { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 4px; color: rgba(255, 255, 255, 0.9); }
.factor-effect              { font-size: 0.62rem; color: rgba(255, 255, 255, 0.5); line-height: 1.35; }

.cocktail-plus,
.cocktail-equals {
  font-size: 1.35rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
  padding-top: 12px;
}
.cocktail-equals { color: #FF6B6B; }

.result-icon { font-size: 2.4rem; }
.result-text { font-size: 0.7rem; font-weight: 900; letter-spacing: 1px; color: #FF6B6B; }

.cocktail-tip {
  background: rgba(255, 255, 255, 0.07);
  border-left: 3px solid #FF6B6B;
  border-radius: 0 8px 8px 0;
  padding: 11px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
}


/* ── GITHUB STAR BANNER ─────────────────────────────── */
.github-star-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 8px 16px 24px;
  padding: 14px 16px;
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 12px;
  text-align: center;
}

.github-star-text {
  font-size: 0.82rem;
  color: #57606a;
  line-height: 1.5;
}

.github-star-link {
  display: inline-block;
  background: #24292f;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.github-star-link:hover { background: #444d56; }

/* ── MODAL ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(2px);
}

.modal {
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 48px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.2rem; font-weight: 800; }

.modal-close {
  background: #F0F4F8;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.modal-geolocation-btn {
  width: 100%;
  background: var(--ocean);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s;
}
.modal-geolocation-btn:hover { background: var(--ocean-dark); }

.modal-divider {
  text-align: center;
  font-size: 0.73rem;
  color: var(--muted);
  margin: 12px 0;
}

.beach-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.beach-list-item {
  display: flex;
  align-items: center;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  gap: 10px;
}
.beach-list-item:hover  { background: #EDF2F7; }
.beach-list-item.active { background: #E8F4FD; color: var(--ocean); font-weight: 700; }

.beach-list-name   { font-size: 0.98rem; font-weight: 600; flex: 1; }
.beach-list-detail { font-size: 0.74rem; color: var(--muted); }

.beach-danger-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ── SPLASH SCREEN ─────────────────────────────────── */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: linear-gradient(160deg, #011f3f 0%, #023E8A 45%, #0077B6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 48px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.splash-screen.splash-exit {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.splash-content {
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

.splash-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.splash-wave {
  font-size: 3.8rem;
  filter: drop-shadow(0 4px 16px rgba(0, 180, 216, 0.6));
  animation: wave-bob 3s ease-in-out infinite;
}

@keyframes wave-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%       { transform: translateY(-8px) rotate(4deg); }
}

.splash-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  line-height: 1;
}

.splash-region {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.splash-desc {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.65;
  max-width: 360px;
}

.splash-warning-box {
  background: rgba(215, 40, 40, 0.18);
  border: 1.5px solid rgba(255, 107, 107, 0.55);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  max-width: 380px;
  width: 100%;
}

.splash-warning-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }

.splash-warning-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.55;
}

.splash-warning-text strong {
  color: #FF6B6B;
  font-weight: 800;
}

.splash-geo-btn {
  width: 100%;
  max-width: 340px;
  background: white;
  color: var(--ocean-dark);
  border: none;
  border-radius: 50px;
  padding: 17px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.splash-geo-btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.3); }
.splash-geo-btn:active { transform: translateY(0);    box-shadow: 0 4px 14px rgba(0,0,0,0.2); }

.splash-btn-icon { font-size: 1.2rem; }

.splash-geo-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 600;
}

.splash-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-skip-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  transition: color 0.2s;
}
.splash-skip-btn:hover { color: rgba(255, 255, 255, 0.75); }

.splash-lang-row {
  display: flex;
  gap: 8px;
}
.splash-lang-opt {
  background: rgba(255, 255, 255, 0.10);
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.splash-lang-opt:hover {
  background: rgba(255, 255, 255, 0.20);
  color: white;
}
.splash-lang-opt.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.75);
  color: white;
}

/* ── RESPONSIVE (tablet+) ──────────────────────────── */
@media (min-width: 480px) {
  body {
    border-left:  1px solid #E2E8F0;
    border-right: 1px solid #E2E8F0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  }
}
