* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at top, #103654 0%, #07131f 45%, #050b12 100%);
  color: #edf4fa;
  min-height: 100vh;
}

header {
  padding: 28px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  background: rgba(7, 19, 31, 0.72);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  margin: 0;
  font-size: 34px;
}

#updated {
  margin-top: 8px;
  color: #9db7ca;
  font-size: 14px;
}

nav,
.location-dock {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 20px 0;
}

.location-dock {
  padding-top: 8px;
  padding-bottom: 14px;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.08);
  color: #edf4fa;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

button:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-1px);
}

button.active {
  background: linear-gradient(135deg, #1aa7ec, #0f6ea5);
  box-shadow: 0 6px 18px rgba(26,167,236,0.28);
}

main {
  padding: 16px;
}

.synopsis {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(14px);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.06);
  max-width: 1400px;
  margin: auto;
}

.hero-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.synopsis h2 {
  margin: 0;
  font-size: 32px;
}

.subtitle {
  margin: 8px 0 0;
  color: #9db7ca;
}

.sea-indicator {
  position: relative;
  padding: 18px 22px;
  border-radius: 18px;
  font-weight: 800;
  overflow: hidden;
}

.pulse {
  position: absolute;
  inset: -20px;
  opacity: 0.35;
  animation: pulseSea 2.4s infinite;
}

@keyframes pulseSea {
  0% { transform: scale(0.85); opacity: 0.25; }
  50% { transform: scale(1.15); opacity: 0.45; }
  100% { transform: scale(0.85); opacity: 0.25; }
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 22px 0;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.status-GREEN {
  background: rgba(33, 209, 121, 0.2);
  color: #4cff9e;
  border: 1px solid rgba(76,255,158,0.3);
}

.status-YELLOW {
  background: rgba(255, 184, 0, 0.18);
  color: #ffd65c;
  border: 1px solid rgba(255,214,92,0.28);
}

.status-RED {
  background: rgba(255, 82, 82, 0.18);
  color: #ff7a7a;
  border: 1px solid rgba(255,122,122,0.28);
}

.comfort {
  background: rgba(70,130,180,0.18);
  color: #7cc8ff;
  border: 1px solid rgba(124,200,255,0.25);
}

.fish {
  background: rgba(0, 188, 140, 0.16);
  color: #6fffd2;
  border: 1px solid rgba(111,255,210,0.25);
}

.dashboard-grid,
.insight-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, 1fr);
}

.insight-grid {
  grid-template-columns: repeat(3, 1fr);
}

.metric-card,
.insight-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
  min-height: 112px;
}

.insight-card {
  display: block;
  min-height: auto;
}

.metric-card .icon {
  font-size: 30px;
}

.metric-card label,
.insight-card label {
  display: block;
  color: #8eb5cf;
  font-size: 13px;
}

.metric-card strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.insight-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.metric-card span {
  color: #aac3d4;
  font-size: 14px;
}

.arrow {
  margin-left: auto;
  font-size: 32px;
  color: #7cc8ff;
}

.compass {
  margin-left: auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.compass-arrow {
  color: #7cc8ff;
}

.real-map-card,
.tide-graph-card {
  border-radius: 22px;
  background:
    linear-gradient(
      180deg,
      rgba(18,45,66,0.96),
      rgba(12,28,44,0.98)
    );
  border: 1px solid rgba(255,255,255,0.08);
  padding: 26px;
  margin-bottom: 18px;
  overflow: hidden;
}
.hourly-drawer {
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 16px;
  margin-bottom: 16px;
}

.section-title {
  color: #8eb5cf;
  font-weight: 700;
  margin-bottom: 8px;
}

#jamaicaMap {
  width: 100%;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  background: #0c2438;
}

.leaflet-container {
  background: #0c2438;
  font-family: Inter, Arial, sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: #0b1f31;
  color: #edf4fa;
}

.leaflet-control-attribution {
  background: rgba(5, 11, 18, 0.7) !important;
  color: #9db7ca !important;
}

.leaflet-control-attribution a {
  color: #7cc8ff !important;
}

.tide-graph {
  width: 100%;
  height: 260px;
  color: #7cc8ff;
  filter: drop-shadow(0 0 14px rgba(124,200,255,0.35));
}

.tide-label {
  color: #d7e8f5;
  font-weight: 700;
  margin-top: 8px;
}

.tide-value {
  fill: #dff4ff;
  font-size: 4.5px;
  font-weight: 700;
}

.tide-time {
  fill: #9db7ca;
  font-size: 4px;
  font-weight: 600;
}

.tide-dot {
  fill: #ffffff;
  stroke: #7cc8ff;
  stroke-width: 0.5;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

tr {
  background: rgba(255,255,255,0.04);
}

tr:hover {
  background: rgba(255,255,255,0.07);
}

td,
th {
  padding: 18px;
  font-size: 17px;
  text-align: left;
}

td:first-child {
  width: 220px;
  color: #8eb5cf;
  font-weight: 600;
}

tr td:first-child,
tr th:first-child {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

tr td:last-child,
tr th:last-child {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

small {
  color: #7f9db2;
}

.hourly-drawer summary {
  cursor: pointer;
  font-weight: 700;
}

.hourly-scroll {
  overflow-x: auto;
  margin-top: 14px;
}

.hourly-table th {
  color: #8eb5cf;
}

@media (max-width: 1000px) {
  .dashboard-grid,
  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 650px) {
  header h1 {
    font-size: 28px;
  }

  .hero-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .status-line {
    flex-direction: column;
    align-items: flex-start;
  }

  td {
    display: block;
    width: 100%;
    padding: 12px 14px;
  }

  td:first-child {
    width: 100%;
    padding-bottom: 4px;
  }
}
