/* ═══════════════════════════════════════════════════════════════
   DIY Port Days - PWA stylesheet
   Design system mirrors the brand: ocean blue, sand gold, cream bg,
   Playfair Display for headings, Lato for body.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ocean:        #1B4F72;
  --ocean-light:  #2471A3;
  --ocean-deep:   #153A55;
  --sand:         #D4A843;
  --sand-light:   #E8C674;
  --teal:         #0E6655;
  --dark:         #2C3E50;
  --gray:         #7F8C8D;
  --gray-light:   #BDC3C7;
  --light-bg:     #FAF8F4;
  --card-bg:      #FFFFFF;
  --blue-bg:      #E8F1F8;
  --pink-bg:      #FDE8E8;
  --green-bg:     #E8F8F0;
  --gold-bg:      #FDF8E8;
  --purple-bg:    #F3ECF8;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg:    0 6px 20px rgba(0,0,0,0.12);

  --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --topbar-h:     56px;
  --tabbar-h:     64px;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--light-bg);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-top: var(--topbar-h);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a { color: var(--ocean); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ─────────── TOPBAR ─────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0));
  padding-top: env(safe-area-inset-top, 0);
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 12px;
  padding-right: 12px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-brand { display: flex; align-items: baseline; gap: 8px; }
.topbar-mark {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
  color: var(--sand);
}
.topbar-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.3px;
}
.back-btn, .menu-btn {
  color: white;
  font-size: 22px;
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.back-btn:active, .menu-btn:active { background: rgba(255,255,255,0.15); }
.back-btn[hidden] { visibility: hidden; }

/* ─────────── TABBAR ─────────── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--card-bg);
  border-top: 1px solid #E8E8E8;
  display: flex;
  z-index: 50;
  box-shadow: 0 -1px 3px rgba(0,0,0,0.04);
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--gray);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 4px;
  text-decoration: none;
  transition: color 0.15s;
}
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { letter-spacing: 0.3px; }
.tab.active { color: var(--ocean); }
.tab.active .tab-icon { color: var(--sand); }

/* ─────────── APP CONTAINER ─────────── */
.app { max-width: 720px; margin: 0 auto; padding: 16px; min-height: 60vh; }
.loading { text-align: center; color: var(--gray); padding: 60px 20px; }

/* ─────────── VIEW: LIBRARY / STORE (port cards) ─────────── */
.view-header {
  padding: 12px 4px 20px;
}
.view-header .kicker {
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sand);
  font-weight: 700;
  margin-bottom: 6px;
}
.view-header h1 {
  font-size: 28px;
  color: var(--ocean);
  margin-bottom: 4px;
}
.view-header .sub {
  font-size: 15px;
  color: var(--gray);
}

.port-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 560px) {
  .port-grid { grid-template-columns: 1fr 1fr; }
}

.port-card {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.port-card:active { transform: scale(0.98); box-shadow: var(--shadow-md); }
.port-card.locked { opacity: 0.72; }

.port-card-banner {
  height: 110px;
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 60%, var(--teal) 100%);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: white;
  overflow: hidden;
}
.port-card-banner::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,0.35) 0%, transparent 70%);
}
.port-card-banner .region {
  position: absolute; top: 12px; left: 14px;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--sand-light); font-weight: 700;
}
.port-card-banner h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  position: relative;
  z-index: 1;
}

.port-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.port-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--gray);
}
.port-card-meta span {
  background: var(--light-bg);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.port-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid #F0F0F0;
}
.port-card-price {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--ocean);
}
.port-card-price .strike {
  color: var(--gray); font-weight: 400; font-size: 14px;
  text-decoration: line-through; margin-right: 6px;
}
.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 10px;
}
.badge-owned { background: var(--green-bg); color: var(--teal); }
.badge-soon { background: #EFEFEF; color: var(--gray); }
.badge-featured { background: var(--gold-bg); color: #7D6608; }

/* ─────────── EMPTY STATE ─────────── */
.empty-state {
  text-align: center;
  padding: 50px 24px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 {
  font-family: var(--font-heading);
  color: var(--ocean);
  font-size: 22px;
  margin-bottom: 8px;
}
.empty-state p { color: var(--gray); font-size: 15px; margin-bottom: 18px; }
.btn {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 100%);
  color: white;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
  transition: transform 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-secondary {
  background: white;
  color: var(--ocean);
  border: 2px solid var(--ocean);
}
.btn-gold {
  background: linear-gradient(135deg, var(--sand) 0%, #B8922E 100%);
  color: white;
}

/* ─────────── VIEW: PORT DETAIL / STOREFRONT ─────────── */
.storefront {
  background: var(--card-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}
.storefront-hero {
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 55%, var(--teal) 100%);
  color: white;
  padding: 36px 20px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.storefront-hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,0.35) 0%, transparent 70%);
}
.storefront-hero .kicker {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--sand); font-weight: 700; margin-bottom: 8px;
  position: relative;
}
.storefront-hero h1 {
  font-family: var(--font-heading);
  font-size: 32px; font-weight: 700; margin-bottom: 6px;
  position: relative;
}
.storefront-hero .sub { font-size: 15px; opacity: 0.9; position: relative; }

.storefront-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  padding: 16px;
  background: var(--light-bg);
}
.storefront-stats .stat {
  text-align: center;
  padding: 8px 4px;
}
.storefront-stats .label {
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gray); font-weight: 700;
}
.storefront-stats .value {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 700; color: var(--ocean);
  margin-top: 2px;
}

.storefront-body { padding: 20px; }
.storefront-body h2 {
  font-size: 18px;
  color: var(--ocean);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--sand);
  display: inline-block;
}
.storefront-body p { font-size: 14px; color: #444; line-height: 1.65; margin-bottom: 12px; }
.storefront-body ul { padding-left: 20px; margin-bottom: 12px; color: #444; font-size: 14px; }
.storefront-body li { margin-bottom: 4px; }

.storefront-cta {
  padding: 20px;
  background: var(--gold-bg);
  border-top: 3px solid var(--sand);
  text-align: center;
}
.storefront-cta .price {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  color: var(--ocean);
  margin-bottom: 4px;
}
.storefront-cta .price-note {
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 14px;
}
.storefront-cta .btn { width: 100%; max-width: 320px; padding: 16px; font-size: 16px; }
.storefront-cta .small {
  display: block; margin-top: 10px; font-size: 12px; color: var(--gray);
}

/* ─────────── VIEW: PORT GUIDE (Nassau content) ─────────── */
.guide-hero {
  background: linear-gradient(135deg, var(--ocean) 0%, var(--ocean-light) 100%);
  color: white;
  padding: 32px 20px 24px;
  text-align: center;
  border-radius: 14px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.guide-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,0.3) 0%, transparent 70%);
}
.guide-hero .kicker {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--sand); font-weight: 700; margin-bottom: 6px;
  position: relative;
}
.guide-hero h1 {
  font-family: var(--font-heading);
  font-size: 28px; font-weight: 700; margin-bottom: 4px;
  position: relative;
}
.guide-hero .sub { font-size: 15px; opacity: 0.9; margin-bottom: 18px; position: relative; }
.guide-hero .stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}
.guide-hero .stat {
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.guide-hero .stat .label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85;
}
.guide-hero .stat .value { font-size: 14px; font-weight: 700; margin-top: 2px; }

.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--ocean);
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sand);
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

/* Tip boxes with colored left borders (carried over from PDF/mobile design) */
.tip-box { border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.tip-box.gold  { background: var(--gold-bg);  border-left: 4px solid var(--sand); }
.tip-box.blue  { background: var(--blue-bg);  border-left: 4px solid var(--ocean-light); }
.tip-box.pink  { background: var(--pink-bg);  border-left: 4px solid #E74C3C; }
.tip-box.green { background: var(--green-bg); border-left: 4px solid var(--teal); }
.tip-box h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--dark); }
.tip-box p { font-size: 14px; line-height: 1.55; color: #444; }

/* Stop cards */
.stop-card {
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stop-header {
  background: var(--ocean);
  color: white;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stop-num {
  background: rgba(255,255,255,0.2);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.stop-header h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}
.stop-body { padding: 18px; }
.stop-body p { font-size: 14px; line-height: 1.65; margin-bottom: 12px; color: #444; }

.walk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-bg);
  color: var(--ocean);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.directions {
  background: #F0F6FB;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ocean);
  line-height: 1.5;
}
.history-section { margin-bottom: 12px; }
.history-section .label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal);
  margin-bottom: 4px;
}
.history-section p { font-size: 14px; color: #444; line-height: 1.65; }

.fun-fact {
  background: var(--purple-bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  font-style: italic;
  color: #6C3483;
  line-height: 1.55;
}
.fun-fact strong { font-style: normal; }

.tip-inline {
  background: var(--gold-bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #7D6608;
  line-height: 1.55;
}
.tip-inline strong { color: #7D6608; }

.map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #34A853 0%, #2E8B47 100%);
  color: white;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  margin-top: 4px;
  transition: transform 0.15s;
}
.map-btn:active { transform: scale(0.97); }

.route-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.route-table th {
  background: var(--ocean);
  color: white;
  padding: 10px 8px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
}
.route-table td { padding: 10px 8px; border-bottom: 1px solid #E8E8E8; }
.route-table tr:nth-child(even) td { background: #F8F9FA; }

.ref-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #EEE;
  font-size: 14px;
}
.ref-row:last-child { border-bottom: none; }
.ref-row .ref-label { font-weight: 700; color: var(--ocean); width: 100px; flex-shrink: 0; }
.ref-row .ref-value { color: #444; }

.toc-list { list-style: none; background: white; border-radius: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.toc-list li { border-bottom: 1px solid #EEE; }
.toc-list li:last-child { border-bottom: none; }
.toc-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--dark);
  font-size: 15px;
  font-weight: 500;
}
.toc-list a:active { background: #F0F0F0; }
.toc-list .toc-arrow { color: var(--gray-light); font-size: 18px; }

/* Lunch / beach special cards */
.stop-card.lunch .stop-header { background: linear-gradient(135deg, #D4A843, #B8922E); }
.stop-card.beach .stop-header { background: linear-gradient(135deg, #2980B9, #1A6EA0); }

/* ─────────── ACCOUNT VIEW ─────────── */
.account-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}
.account-card h3 {
  font-family: var(--font-heading);
  color: var(--ocean);
  font-size: 18px;
  margin-bottom: 8px;
}
.account-card p {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 10px;
}
.account-card .danger {
  color: #C0392B;
}
.account-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
}
.account-link .arrow { color: var(--gray-light); }

/* ─────────── INSTALL HINT ─────────── */
.install-hint {
  position: fixed;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0) + 12px);
  left: 12px; right: 12px;
  background: var(--ocean-deep);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}
.install-hint strong { color: var(--sand-light); }
.install-close {
  color: white;
  font-size: 20px;
  line-height: 1;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.install-close:active { background: rgba(255,255,255,0.15); }

/* ─────────── UTILITIES ─────────── */
.muted { color: var(--gray); font-size: 13px; }
.center { text-align: center; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
