/* ============================================================
   CruiseShipID — design system
   Shared shell + components used across all 9 sections.
   ============================================================ */

:root {
  --navy: #1b2a4a;
  --navy-2: #24375f;
  --ink: #1c2430;
  --muted: #5c6b80;
  --line: #e3e8f0;
  --bg: #ffffff;
  --bg-soft: #f4f6fa;
  --accent: #0a6ece;
  --accent-2: #0e7ae0;
  --gold: #e6a23c;
  --danger: #c0392b;
  --ok: #2f9e6e;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(20,30,50,.08);
  --shadow-lg: 0 10px 30px rgba(20,30,50,.18);
  --maxw: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 20px; }
img { max-width: 100%; }
.hidden { display: none !important; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ------------------------- Header / shell ------------------------- */
.site-header { background: var(--navy); color: #e8edf6; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; max-width: var(--maxw); margin: 0 auto; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 800; color: #fff !important; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.brand .mark { width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, var(--accent-2), var(--gold)); display: inline-block; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.topbar-right a { color: #e8edf6; font-size: 13px; }
.btn { display: inline-block; border: 1px solid transparent; border-radius: var(--radius); padding: 8px 14px; font-size: 14px; cursor: pointer; font-family: inherit; text-align: center; line-height: 1.2; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent-2); color: #fff !important; }
.btn-primary:hover { background: var(--accent); }
.btn-outline { background: transparent; border-color: #4a5c86; color: #e8edf6 !important; }
.btn-outline:hover { background: rgba(255,255,255,.08); }
.btn-ghost { background: transparent; color: var(--accent) !important; border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }

.global-search { display: flex; flex: 0 1 340px; min-width: 200px; }
.global-search input {
  flex: 1; border-radius: var(--radius) 0 0 var(--radius); border: 1px solid #3d4f78;
  background: #16213b; color: #fff; padding: 9px 12px; font-size: 14px; outline: none;
}
.global-search input::placeholder { color: #9aa8c6; }
.global-search button {
  border-radius: 0 var(--radius) var(--radius) 0; border: 1px solid #3d4f78; border-left: none;
  background: var(--accent-2); color: #fff; padding: 0 14px; cursor: pointer;
}
.global-search .suggest { position: absolute; top: 100%; left: 0; right: 0; background: #fff; color: var(--ink); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; }
.global-search .suggest a { display: block; padding: 9px 12px; color: var(--ink); border-bottom: 1px solid var(--bg-soft); }
.global-search .suggest a:hover { background: var(--accent); color: #fff; text-decoration: none; }

.site-nav { background: var(--navy-2); border-top: 1px solid #31446f; }
.site-nav ul { list-style: none; margin: 0; padding: 0 20px; max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; }
.site-nav a { display: block; padding: 11px 15px; color: #dbe3f2; font-size: 14px; }
.site-nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.site-nav a.active { color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--gold); }

.breadcrumb { font-size: 13px; color: var(--muted); padding: 12px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb .sep { margin: 0 6px; color: #b6c0d0; }
.breadcrumb .current { color: var(--ink); }

/* ------------------------- Footer ------------------------- */
.site-footer { background: var(--navy); color: #b7c2d9; margin-top: 48px; }
.footer-cols { max-width: var(--maxw); margin: 0 auto; padding: 34px 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.footer-cols h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin: 0 0 10px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 6px 0; }
.footer-cols a { color: #b7c2d9; font-size: 13px; }
.footer-cols a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #31446f; max-width: var(--maxw); margin: 0 auto; padding: 14px 20px; font-size: 12px; color: #8492b0; }

/* ------------------------- Layout / pages ------------------------- */
.page-body { padding: 16px 0 0; }
.page-head { margin-bottom: 18px; }
.subtitle { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.count-line { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* ------------------------- Buttons / inputs ------------------------- */
input[type=text], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(10,110,206,.12); }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 5px; font-weight: 600; }
.field { margin-bottom: 13px; }
.form-grid { display: grid; gap: 13px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; background: var(--bg-soft); color: var(--navy); border: 1px solid var(--line); }
.pill.today { background: #eef6ff; color: var(--accent); border-color: #cfe4fa; }

.chip { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 13px; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--muted); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ------------------------- Tables ------------------------- */
table.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 2px solid var(--line); padding: 10px 12px; }
.tbl td { border-bottom: 1px solid var(--bg-soft); padding: 11px 12px; font-size: 14px; vertical-align: middle; }
.tbl tr:hover td { background: var(--bg-soft); }
.tbl .num { text-align: right; }

/* ------------------------- Tabs ------------------------- */
.tabs { border-bottom: 2px solid var(--line); display: flex; gap: 4px; margin: 18px 0; flex-wrap: wrap; }
.tabs button { background: none; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; margin-bottom: -2px; font-family: inherit; }
.tabs button:hover { color: var(--accent); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ------------------------- Pagination ------------------------- */
.pager { display: flex; gap: 6px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.pager button, .pager .pg { min-width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.pager button:hover { border-color: var(--accent); color: var(--accent); }
.pager .pg.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager .pg.dots { border: none; cursor: default; }
.pager .info { color: var(--muted); font-size: 13px; margin-left: 8px; }

/* ------------------------- Ship cards ------------------------- */
.ship-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 16px; }
.ship-card { overflow: hidden; display: flex; flex-direction: column; }
.ship-card .thumb { height: 150px; background: linear-gradient(135deg, var(--navy-2), var(--accent)); position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.ship-card .thumb .ph { color: #fff; font-weight: 700; font-size: 14px; padding: 8px 12px; }
.ship-card .body { padding: 13px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ship-card .name { font-size: 16px; font-weight: 700; color: var(--navy); }
.ship-card .meta { font-size: 13px; color: var(--muted); }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table td { padding: 5px 6px; border: 1px solid var(--line); }
.spec-table td.k { color: var(--muted); background: var(--bg-soft); width: 45%; }
.action-links { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; font-weight: 600; }

/* ------------------------- Line grid ------------------------- */
.line-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 16px; }
.line-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.line-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.line-logo { width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 13px; flex: 0 0 auto; }
.line-item .nm { font-weight: 700; color: var(--navy); }
.line-item .tier { font-size: 12px; color: var(--muted); }

/* ------------------------- Port entries ------------------------- */
.port-entry { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.port-entry + .port-entry { border-top: 1px solid var(--line); }
.port-entry .name { font-size: 17px; font-weight: 700; color: var(--navy); }
.port-entry .blurb { color: var(--muted); font-size: 14px; }

/* ------------------------- News ------------------------- */
.news-feed { display: flex; flex-direction: column; gap: 14px; }
.news-card { display: flex; gap: 14px; padding: 14px; }
.news-card .nthumb { width: 90px; height: 62px; border-radius: 6px; background: linear-gradient(135deg, #cfd8e6, #aab6cc); flex: 0 0 auto; }
.news-card h3 { font-size: 16px; margin: 0 0 3px; }
.news-card .teaser { color: var(--muted); font-size: 13.5px; }
.news-card .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.cat-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ------------------------- Map / tracker ------------------------- */
.tracker-layout { display: flex; gap: 16px; height: 72vh; min-height: 520px; }
#map { flex: 1; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.line-filter { width: 250px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.line-filter .lf-head { padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; gap: 6px; }
.lf-head .mini { font-size: 11px; font-weight: 600; color: var(--accent); cursor: pointer; }
.lf-head .mini:hover { text-decoration: underline; }
.line-filter .lf-list { overflow-y: auto; flex: 1; }
.lf-line { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--bg-soft); }
.lf-line:hover { background: var(--bg-soft); }
.lf-line .swatch { width: 13px; height: 13px; border-radius: 50%; flex: 0 0 auto; }
.lf-line .logo-mini { width: 22px; height: 22px; border-radius: 5px; color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.lf-line label { margin: 0; display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--ink); font-size: 13px; }

.overlay-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.overlay-bar .lbl { font-size: 13px; color: var(--muted); }

.ship-marker { transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.ship-marker .dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.35); }
.ship-marker .heading { font-size: 16px; line-height: 10px; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.6); }

.ol-content { }

/* Info panel */
.info-panel { position: absolute; top: 12px; right: 12px; width: 360px; max-width: calc(100% - 24px); background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 20; max-height: calc(100% - 24px); overflow-y: auto; }
.info-panel .ip-head { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.info-panel .ip-name { font-size: 17px; font-weight: 800; color: var(--navy); }
.info-panel .ip-line { font-size: 13px; color: var(--muted); }
.info-panel .ip-x { margin-left: auto; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); line-height: 1; }
.info-panel .ip-x:hover { color: var(--ink); }
.info-panel .ip-body { padding: 13px 14px; }
.ip-hero { height: 150px; background: linear-gradient(135deg, var(--navy-2), var(--accent)); border-radius: 6px; margin-bottom: 12px; display: flex; align-items: flex-end; }
.ip-hero .ph { color: #fff; font-weight: 700; font-size: 13px; padding: 8px 11px; }
.pos-sentence { font-size: 14px; margin: 0 0 4px; }
.obs { font-size: 12px; color: var(--muted); }
.weather-blk { display: flex; gap: 10px; margin-top: 12px; font-size: 13px; }
.weather-blk .wl { flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 9px; text-align: center; }
.weather-blk .wv { font-weight: 700; color: var(--navy); }
.weather-blk .wk { font-size: 11px; color: var(--muted); }

/* Mini itinerary table in panel */
.itin-mini { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12.5px; }
.itin-mini td { padding: 5px 6px; border-bottom: 1px solid var(--bg-soft); }
.itin-mini td.d { color: var(--muted); white-space: nowrap; }

/* ------------------------- Deck plan viewer ------------------------- */
.deck-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: #fff; }
.deck-row .thumb { width: 130px; height: 82px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; display: flex; align-items: flex-end; }
.deck-row .thumb .dnum { font-size: 11px; color: var(--muted); padding: 4px 6px; }
.deck-row .dc-name { font-weight: 700; color: var(--navy); }
.deck-row .dc-label { color: var(--muted); font-size: 13px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(10,16,28,.88); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox img, .lightbox .lb-frame { max-width: 92vw; max-height: 88vh; border-radius: 6px; background: #000; }
.lightbox .lb-frame { display: flex; align-items: center; justify-content: center; min-width: 320px; min-height: 240px; }
.lightbox .lb-x { position: absolute; top: 18px; right: 24px; background: none; border: none; color: #fff; font-size: 30px; cursor: pointer; }

/* Empty / loading states */
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--muted); margin: 0 0 6px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 900px) {
  .tracker-layout { flex-direction: column; height: auto; }
  .line-filter { width: 100%; max-height: 240px; }
  #map { height: 60vh; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .ship-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}
@media (max-width: 520px) {
  .footer-cols { grid-template-columns: 1fr; }
  .global-search { flex-basis: 100%; }
}
