/* ============================================================
   MOBILE BAY FISHING & BOATING — style.css
   Theme: fish-finder / sonar display, brackish-water palette
   ============================================================ */

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

:root {
  --bg:         #0d1410;
  --bg-card:    #141f17;
  --bg-card2:   #1a2a1f;
  --border:     #233328;
  --border-lit: #2f4636;

  --accent:     #3ddc84;      /* sonar phosphor green */
  --accent-dim: #2a9c5c;
  --amber:      #e8a33d;      /* low tide / caution */
  --red:        #e0584a;
  --blue:       #5b9bd1;      /* water / current */

  --text:       #e8e4d8;      /* bone / sand */
  --text-dim:   #8a9a8c;
  --text-muted: #45564a;

  --font-display: 'Oswald', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:     10px;
  --radius-sm:  6px;
  --header-h:   56px;
  --nav-h:      44px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, #0a100c 0%, #101c14 100%);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

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

/* Sonar blip pulse */
.sonar-blip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
  animation: blip 2.4s ease-in-out infinite;
}
@keyframes blip {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

.site-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
}
.site-title .accent { color: var(--accent); }

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.location-label { font-size: 10px; color: var(--text-dim); letter-spacing: 0.03em; }
.clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* ── Tab Nav ── */
.tab-nav {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  padding: 0 15px;
  height: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Tab Panels ── */
.tab-panel {
  display: none;
  padding: calc(var(--header-h) + var(--nav-h) + 12px) 12px 24px;
  min-height: 100vh;
}
.tab-panel.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ── Tide Card ── */
.tide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.tide-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tide-updated {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tide-now {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tide-now-stage { display: flex; align-items: center; gap: 8px; }
.tide-stage-arrow {
  font-size: 26px;
  color: var(--accent);
  font-weight: 700;
}
.tide-stage-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.tide-now-height { display: flex; align-items: baseline; gap: 3px; }
.tide-height-val {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.tide-height-unit { font-size: 13px; color: var(--text-dim); }

/* Tide graph - sonar screen look */
.tide-graph-wrap {
  width: 100%;
  background: #0a0f0b;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}
.tide-graph-wrap::before {
  /* subtle scanline grid like a depth finder */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(61,220,132,0.04) 0px, rgba(61,220,132,0.04) 1px, transparent 1px, transparent 22px),
    repeating-linear-gradient(90deg, rgba(61,220,132,0.04) 0px, rgba(61,220,132,0.04) 1px, transparent 1px, transparent 60px);
  pointer-events: none;
}
#tide-graph {
  width: 100%;
  height: 160px;
  display: block;
}

.tide-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tide-event {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.tide-event-type {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  width: 38px;
  flex-shrink: 0;
}
.tide-event-type.high { color: var(--accent); }
.tide-event-type.low  { color: var(--amber); }
.tide-event-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.tide-event-height {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ── Sun/Moon Grid ── */
.sunmoon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sm-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.sm-icon { font-size: 22px; }
.sm-label {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}
.sm-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
}

/* ── Conditions (reused for Marine) ── */
.conditions-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.conditions-label {
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.conditions-updated { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

.conditions-main {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.temp-block { display: flex; align-items: flex-start; line-height: 1; }
.temp-value {
  font-family: var(--font-display);
  font-size: 64px; font-weight: 600; color: var(--blue);
  line-height: 0.9; letter-spacing: -1px;
}
.temp-unit { font-family: var(--font-display); font-size: 22px; color: var(--text-dim); margin-top: 6px; }
.conditions-desc { flex: 1; }
.wx-desc { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.feels-like { font-size: 12px; color: var(--text-dim); }

.conditions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.cond-item {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 8px;
  text-align: center; gap: 2px;
}
.cond-icon { font-size: 18px; }
.cond-label {
  font-size: 9px; color: var(--text-muted); letter-spacing: 0.05em;
  font-weight: 600; text-transform: uppercase;
}
.cond-val { font-family: var(--font-mono); font-size: 12px; color: var(--text); font-weight: 500; }

/* ── Alerts ── */
.alerts-banner {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(224, 88, 74, 0.15);
  border: 1px solid rgba(224, 88, 74, 0.5);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.alert-icon { font-size: 20px; flex-shrink: 0; }
.alert-text { font-size: 13px; color: #f0a89e; line-height: 1.5; }

/* ── Hourly Strip (reused) ── */
.hourly-strip {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.hourly-strip::-webkit-scrollbar { display: none; }
.hourly-item {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; min-width: 64px;
}
.hourly-time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.hourly-icon { font-size: 18px; }
.hourly-temp { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text); }
.hourly-pop { font-size: 9px; color: var(--blue); font-family: var(--font-mono); }
.hourly-loading { color: var(--text-muted); font-size: 13px; padding: 8px 0; }

/* ── Daily List (reused for tide events list too) ── */
.daily-list { display: flex; flex-direction: column; gap: 8px; }

/* ── Bite Gauge ── */
.bite-rating-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}
.bite-gauge {
  position: relative;
  width: 130px;
  flex-shrink: 0;
}
.bite-gauge-svg { width: 100%; }
.bite-gauge-label {
  position: absolute;
  bottom: 4px;
  left: 0; right: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
}
.bite-gauge-val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
}
.bite-gauge-sub {
  font-size: 13px;
  color: var(--text-dim);
}
.bite-rating-text {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
}

/* Bite period rows */
.bite-period-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.bite-period-type {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.bite-period-type.major { background: rgba(61,220,132,0.18); color: var(--accent); }
.bite-period-type.minor { background: rgba(91,155,209,0.18); color: var(--blue); }
.bite-period-time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

/* ── Species List ── */
.species-list { display: flex; flex-direction: column; gap: 8px; }
.species-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: var(--bg-card2);
  border-left: 3px solid var(--accent-dim);
  border-radius: 4px;
}
.species-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}
.species-tip {
  font-size: 11px;
  color: var(--text-dim);
}

/* ── Link / Tool Grid (reused) ── */
.link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.link-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  text-decoration: none; transition: border-color 0.2s, background 0.2s;
}
.link-tile:hover { border-color: var(--accent); background: rgba(61,220,132,0.06); text-decoration: none; }
.link-icon { font-size: 22px; margin-bottom: 2px; }
.link-name { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text); }
.link-sub { font-size: 10px; color: var(--text-muted); line-height: 1.3; }

/* ── Iframe Viewer (reused) ── */
.viewer-card { padding: 12px; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.viewer-header .card-title { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }
.viewer-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.vtab {
  padding: 4px 10px; background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-dim); font-family: var(--font-display);
  font-size: 11px; font-weight: 500; letter-spacing: 0.03em; cursor: pointer;
  white-space: nowrap; transition: all 0.15s; text-transform: uppercase;
}
.vtab.active, .vtab:hover { border-color: var(--accent); color: var(--accent); background: rgba(61,220,132,0.08); }

.iframe-wrap {
  position: relative; width: 100%; padding-top: 70%;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: #070b08;
}
.weather-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.frame-note { margin-top: 8px; font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.frame-note a { color: var(--accent); }

/* ── Tools List (reused) ── */
.tools-list { display: flex; flex-direction: column; gap: 4px; }
.tool-section-label {
  font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-muted); padding: 10px 4px 4px;
  border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.tool-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  background: var(--bg-card2); border: 1px solid transparent;
  border-radius: var(--radius-sm); text-decoration: none; transition: all 0.15s;
}
.tool-row:hover { border-color: var(--border-lit); background: rgba(61,220,132,0.04); text-decoration: none; }
.tool-icon { font-size: 22px; flex-shrink: 0; }
.tool-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-name { font-family: var(--font-display); font-size: 15px; font-weight: 500; color: var(--text); }
.tool-desc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

/* ── About Card ── */
.about-text { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }
.refresh-btn {
  display: inline-block; padding: 10px 20px; background: transparent;
  border: 1px solid var(--accent); border-radius: var(--radius-sm); color: var(--accent);
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; transition: all 0.2s;
}
.refresh-btn:hover { background: rgba(61,220,132,0.1); }

/* ── Responsive ── */
@media (max-width: 360px) {
  .conditions-grid { grid-template-columns: 1fr 1fr; }
  .temp-value { font-size: 52px; }
  .bite-rating-wrap { flex-direction: column; }
}

@media (min-width: 640px) {
  .tab-panel { max-width: 700px; margin: 0 auto; }
  .conditions-grid { grid-template-columns: repeat(6, 1fr); }
  .iframe-wrap { padding-top: 56%; }
  .link-grid { grid-template-columns: repeat(4, 1fr); }
  .sunmoon-grid { grid-template-columns: repeat(3, 1fr); max-width: 400px; }
}
