/* ═══════════════════════════════════════
   SeaMark — Marine Hazard Atlas
   Shared Styles · style.css
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Fira+Code:wght@400;500;600&display=swap');

/* ── DESIGN TOKENS ── */
:root {
  --white: #ffffff;
  --bg: #f7f9fc;
  --bg-warm: #faf8f6;
  --surface: #ffffff;
  --surface-hover: #f0f5fa;
  --border: #e2e8f0;
  --border-light: #edf1f7;

  --text: #334155;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --heading: #0f172a;

  /* Accent palette — saturated but friendly */
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --blue-light: #dbeafe;
  --blue-pale: #eff6ff;
  --teal: #0d9488;
  --teal-bright: #14b8a6;
  --teal-light: #ccfbf1;
  --teal-pale: #f0fdfa;
  --coral: #ef4444;
  --coral-bright: #f97066;
  --coral-light: #fee2e2;
  --coral-pale: #fef2f2;
  --amber: #d97706;
  --amber-bright: #f59e0b;
  --amber-light: #fef3c7;
  --amber-pale: #fffbeb;
  --violet: #7c3aed;
  --violet-light: #ede9fe;
  --green: #16a34a;
  --green-bright: #22c55e;
  --green-light: #dcfce7;

  --danger: #ef4444;
  --warning: #f59e0b;
  --safe: #22c55e;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);

  --nav-height: 60px;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--blue-bright); }
img { max-width: 100%; display: block; }

/* ══════════════════════════════
   NAVIGATION
   ══════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none;
}
.nav-logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal-bright) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 0.75rem; font-weight: 700;
  font-family: 'Fira Code', monospace;
  letter-spacing: -0.5px;
}
.nav-logo-text {
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem; font-weight: 600;
  color: var(--heading); letter-spacing: 0.5px;
}
.nav-logo-text span { color: var(--blue); }
.nav-links { display: flex; gap: 0.25rem; }
.nav-links a {
  padding: 0.4rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s;
}
.nav-links a:hover { color: var(--blue); background: var(--blue-pale); }
.nav-links a.active {
  color: var(--blue); background: var(--blue-light); font-weight: 600;
}

/* ══════════════════════════════
   HERO
   ══════════════════════════════ */
.hero {
  padding: calc(var(--nav-height) + 4rem) 2rem 3rem;
  text-align: center;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  position: relative; overflow: hidden;
}
/* Subtle decorative gradient orbs */
.hero::before {
  content: ''; position: absolute;
  top: -120px; right: -80px; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero::after {
  content: ''; position: absolute;
  bottom: -80px; left: -60px; width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(20,184,166,0.06) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero-badge {
  display: inline-block; position: relative; z-index: 1;
  padding: 0.35rem 1.1rem; border-radius: 20px;
  background: var(--blue-light); color: var(--blue);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 1.4rem;
}
.hero h1 {
  font-size: 3.4rem; font-weight: 700; color: var(--heading);
  line-height: 1.15; margin-bottom: 1rem;
  letter-spacing: -1px; position: relative; z-index: 1;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal-bright) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 620px; margin: 0 auto 2.2rem; line-height: 1.7;
  position: relative; z-index: 1;
}

/* ── BUTTONS ── */
.hero-actions {
  display: flex; gap: 0.8rem; justify-content: center;
  flex-wrap: wrap; position: relative; z-index: 1;
}
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.6rem; border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.25s;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, #1d4ed8 100%);
  color: #fff; box-shadow: 0 2px 12px rgba(37,99,235,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
  color: #fff;
}
.btn-secondary {
  background: var(--white); color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  border-color: var(--blue); color: var(--blue);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════
   STAT CARDS ROW
   ══════════════════════════════ */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem; max-width: 760px; margin: 0 auto;
  padding: 0 2rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 1.6rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.8rem; font-size: 1.3rem;
}
.stat-icon.blue { background: var(--blue-light); color: var(--blue); }
.stat-icon.teal { background: var(--teal-light); color: var(--teal); }
.stat-icon.coral { background: var(--coral-light); color: var(--coral); }
.stat-val {
  font-family: 'Fira Code', monospace;
  font-size: 1.7rem; font-weight: 600; color: var(--heading);
}
.stat-label {
  font-size: 0.8rem; color: var(--text-light); margin-top: 0.15rem;
}

/* ══════════════════════════════
   SECTIONS
   ══════════════════════════════ */
.section {
  padding: 4.5rem 2rem;
  max-width: 1100px; margin: 0 auto;
}
.section-full {
  background: var(--white);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 4.5rem 2rem;
}
.section-full-inner { max-width: 1100px; margin: 0 auto; }

.section-badge {
  display: inline-block;
  padding: 0.25rem 0.85rem; border-radius: 16px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 0.8rem;
}
.section-badge.blue { background: var(--blue-light); color: var(--blue); }
.section-badge.teal { background: var(--teal-light); color: var(--teal); }
.section-badge.coral { background: var(--coral-light); color: var(--coral); }
.section-badge.violet { background: var(--violet-light); color: var(--violet); }
.section-badge.amber { background: var(--amber-light); color: var(--amber); }

.section h2, .section-full h2 {
  font-size: 2.1rem; font-weight: 700; color: var(--heading);
  margin-bottom: 0.6rem; letter-spacing: -0.4px;
}
.section h3, .section-full h3 {
  font-size: 1.2rem; font-weight: 600; color: var(--heading);
  margin-bottom: 0.35rem;
}
.lead {
  font-size: 1.05rem; color: var(--text-secondary);
  line-height: 1.7; max-width: 660px;
}

/* ══════════════════════════════
   CARD GRID
   ══════════════════════════════ */
.cards-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem; margin-top: 2rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-xs);
  transition: all 0.25s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon {
  width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 1rem;
}
.card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

.mini-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.3rem; text-align: center;
  box-shadow: var(--shadow-xs); transition: all 0.25s;
}
.mini-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.mini-card-emoji { font-size: 2.2rem; margin-bottom: 0.5rem; }
.mini-card h3 { font-size: 0.95rem; margin-bottom: 0.3rem; }
.mini-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }

/* ══════════════════════════════
   ANIMATION EMBED
   ══════════════════════════════ */
.animation-wrap { 
  max-width: 900px; margin: 2.5rem auto 0;
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  aspect-ratio: 3 / 2;
}
.animation-wrap iframe { width: 100%; height: 100%; border: none; display: block; }

/* ══════════════════════════════
   STEPS (How It Works)
   ══════════════════════════════ */
.steps { counter-reset: step; margin-top: 2rem; }
.step {
  display: flex; gap: 1.8rem; align-items: flex-start;
  margin-bottom: 2.5rem; position: relative;
  counter-increment: step;
}
.step-num {
  flex-shrink: 0;
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fira Code', monospace;
  font-size: 1.1rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal-bright) 100%);
  box-shadow: 0 3px 10px rgba(37,99,235,0.2);
}
.step-num::before { content: counter(step); }
.step-line {
  position: absolute; left: 24px; top: 54px; bottom: -2rem;
  width: 2px; background: var(--border-light);
}
.step:last-child .step-line { display: none; }
.step-body { flex: 1; padding-top: 0.2rem; }
.step-body h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.step-body p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; }

/* ══════════════════════════════
   TABLES
   ══════════════════════════════ */
.comp-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin-top: 1.5rem; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.comp-table th {
  background: var(--bg); color: var(--heading);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; padding: 0.75rem 1rem; text-align: left;
}
.comp-table td {
  padding: 0.7rem 1rem; font-size: 0.87rem;
  border-top: 1px solid var(--border-light); background: var(--white);
}
.comp-table tbody tr:hover td { background: var(--blue-pale); }
.yes { color: var(--green); font-weight: 700; }
.no { color: var(--coral); font-weight: 700; }

/* ══════════════════════════════
   COST CARDS
   ══════════════════════════════ */
.cost-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.5rem; margin-top: 1.8rem;
}
.cost-card {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}
.cost-card h4 { font-size: 0.95rem; margin-bottom: 1rem; }
.cost-line {
  display: flex; justify-content: space-between;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.cost-line:last-of-type { border-bottom: none; }
.cost-item { color: var(--text-secondary); }
.cost-val { font-family: 'Fira Code', monospace; font-weight: 600; color: var(--heading); }
.cost-total {
  display: flex; justify-content: space-between;
  padding-top: 0.8rem; margin-top: 0.6rem;
  border-top: 2px solid var(--blue); font-weight: 700;
}
.cost-total .cost-val {
  font-family: 'Fira Code', monospace; font-size: 1.3rem; color: var(--blue);
}

/* ══════════════════════════════
   DEMO PAGE
   ══════════════════════════════ */
.demo-layout {
  padding-top: var(--nav-height);
  display: flex; height: 100vh;
}
.sidebar {
  width: 380px; min-width: 380px;
  background: var(--white);
  border-right: 1px solid var(--border-light);
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar-header {
  padding: 1.3rem 1.5rem; border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--blue-pale) 0%, var(--white) 100%);
}
.sidebar-header h2 {
  font-family: 'Fira Code', monospace;
  font-size: 0.72rem; font-weight: 700;
  color: var(--blue); letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: 0.35rem;
}
.sidebar-header p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

.sidebar-search {
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-search input {
  width: 100%; padding: 0.6rem 1rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif; font-size: 0.88rem;
  color: var(--text); outline: none; transition: all 0.2s;
}
.sidebar-search input::placeholder { color: var(--text-light); }
.sidebar-search input:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light);
}

.sidebar-presets {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-presets-label {
  font-size: 0.66rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.5rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.3rem 0.75rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 20px; font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.sidebar-stats {
  padding: 0.8rem 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}
.s-stat {
  text-align: center; padding: 0.55rem;
  background: var(--bg); border-radius: var(--radius-sm);
}
.s-stat-val {
  font-family: 'Fira Code', monospace; font-size: 1.25rem; font-weight: 700;
}
.s-stat-val.red { color: var(--coral); }
.s-stat-val.amber { color: var(--amber); }
.s-stat-val.green { color: var(--green); }
.s-stat-label {
  font-size: 0.6rem; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
}

.sidebar-list {
  flex: 1; overflow-y: auto; padding: 0.8rem 1rem;
}
.sidebar-list-title {
  font-size: 0.66rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 0 0.4rem; margin-bottom: 0.5rem;
}
.det-card {
  padding: 0.7rem 0.9rem;
  background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); margin-bottom: 0.45rem;
  cursor: pointer; transition: all 0.2s;
  border-left: 3.5px solid transparent;
}
.det-card:hover { border-color: var(--blue-bright); background: var(--blue-pale); }
.det-card.high { border-left-color: var(--coral); }
.det-card.medium { border-left-color: var(--amber-bright); }
.det-card.low { border-left-color: var(--green-bright); }
.det-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.2rem;
}
.det-type { font-size: 0.82rem; font-weight: 600; color: var(--heading); }
.det-badge {
  font-family: 'Fira Code', monospace;
  font-size: 0.58rem; font-weight: 700; padding: 0.12rem 0.5rem;
  border-radius: 8px; text-transform: uppercase; letter-spacing: 0.3px;
}
.det-badge.high { background: var(--coral-light); color: var(--coral); }
.det-badge.medium { background: var(--amber-light); color: var(--amber); }
.det-badge.low { background: var(--green-light); color: var(--green); }
.det-meta { font-size: 0.73rem; color: var(--text-light); line-height: 1.45; }
.det-meta strong { color: var(--text-secondary); font-weight: 500; }

/* Map area */
.map-area { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

.map-badge {
  position: absolute; top: 0.8rem; left: 50%; transform: translateX(-50%);
  z-index: 800;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
  border: 1.5px solid var(--border); border-radius: 20px;
  padding: 0.35rem 1.2rem;
  font-size: 0.72rem; font-weight: 700; color: var(--blue);
  letter-spacing: 1px; box-shadow: var(--shadow-sm);
}
.map-legend {
  position: absolute; bottom: 1.5rem; right: 1rem; z-index: 800;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1.1rem; box-shadow: var(--shadow);
}
.map-legend h4 {
  font-size: 0.64rem; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 0.5rem;
}
.legend-row {
  display: flex; align-items: center; gap: 0.55rem;
  margin-bottom: 0.3rem; font-size: 0.78rem; color: var(--text-secondary);
}
.legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.dot-high { background: var(--coral); box-shadow: 0 0 6px rgba(239,68,68,0.35); }
.legend-dot.dot-med { background: var(--amber-bright); box-shadow: 0 0 6px rgba(245,158,11,0.35); }
.legend-dot.dot-low { background: var(--green-bright); box-shadow: 0 0 6px rgba(34,197,94,0.35); }

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-light) !important;
}
.leaflet-popup-content {
  font-family: 'DM Sans', sans-serif !important;
  margin: 0.9rem 1.1rem !important;
}
.pop-badge {
  display: inline-block; font-family: 'Fira Code', monospace;
  font-size: 0.6rem; font-weight: 700; padding: 0.12rem 0.5rem;
  border-radius: 6px; text-transform: uppercase; margin-bottom: 0.35rem;
}
.pop-badge.high { background: var(--coral-light); color: var(--coral); }
.pop-badge.medium { background: var(--amber-light); color: var(--amber); }
.pop-badge.low { background: var(--green-light); color: var(--green); }
.pop-title { font-weight: 700; color: var(--heading); font-size: 0.92rem; margin-bottom: 0.3rem; }
.pop-meta { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; }
.pop-meta strong { color: var(--text); font-weight: 600; }

/* ══════════════════════════════
   FOOTER
   ══════════════════════════════ */
footer {
  background: var(--white);
  border-top: 1px solid var(--border-light);
  padding: 2.5rem 2rem;
  text-align: center;
}
.footer-brand {
  font-family: 'Fira Code', monospace;
  font-size: 0.95rem; font-weight: 600;
  color: var(--heading); margin-bottom: 0.25rem;
}
.footer-brand span { color: var(--blue); }
.footer-tagline {
  font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.7rem;
}
.footer-contact { font-size: 0.85rem; color: var(--text-secondary); }
.footer-contact a { color: var(--blue); font-weight: 500; }
.footer-sub {
  font-size: 0.72rem; color: var(--text-light); margin-top: 0.8rem;
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 900px) {
  .hero h1 { font-size: 2.4rem; }
  .stats-row { grid-template-columns: 1fr; max-width: 320px; }
  .cost-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 0.8rem; }
  .step-line { display: none; }
  .demo-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; max-height: 40vh; }
  nav { padding: 0 1rem; }
  .nav-links a { padding: 0.35rem 0.55rem; font-size: 0.78rem; }
}
