:root {
  --sidebar-collapsed: 56px;
  --sidebar-expanded: 220px;
  --bg: #eef2f7;
  --panel: #0f1724;
  --accent: #1e90ff;
  --muted: #98a0b3;
  --glass: rgba(255, 255, 255, 0.03);
}

/* -------------------------
   Global
------------------------- */
html, body {
  height: 100%;
  overflow: hidden;   /* prevent any page scroll / white gap */
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
}

#map {
  height: 100vh;
  width: 100%;
}

.edited-badge {
  color: #fff;
  background: #28a745;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ── Sidebar bottom: compact toggle row ─────────────────────────────────── */
.bottom-toggles {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 6px;
  padding: 4px 8px 6px;
  width: 100%;
  box-sizing: border-box;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.mini-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 3px 6px;
  border-radius: 5px;
  transition: background 0.15s;
  flex: 1 1 auto;
  min-width: 0;
}
.mini-toggle:hover { background: rgba(255,255,255,0.05); }

.mini-toggle input { display: none; }

.mini-toggle-track {
  position: relative;
  width: 28px;
  height: 15px;
  border-radius: 15px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  transition: background 0.2s;
}
.mini-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transition: transform 0.2s, background 0.2s;
}
.mini-toggle input:checked + .mini-toggle-track {
  background: #1e90ff;
}
.mini-toggle input:checked + .mini-toggle-track::after {
  transform: translateX(13px);
  background: #fff;
}

.mini-toggle-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms, transform 180ms, color 0.15s;
}
.sidebar:hover .mini-toggle-label,
.sidebar.expanded .mini-toggle-label,
.sidebar.pinned .mini-toggle-label,
.sidebar.focused .mini-toggle-label {
  opacity: 1;
  transform: none;
}
.mini-toggle input:checked ~ .mini-toggle-label { color: rgba(255,255,255,0.9); }

/* Keep old .switch for any remaining uses (compare panel etc.) */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  vertical-align: middle;
}
.switch input { display: none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cfcfcf;
  transition: 0.25s;
  border-radius: 28px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.slider:before {
  position: absolute;
  content: "";
  height: 22px; width: 22px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background-color: #0b5fff; }
.switch input:checked + .slider:before { transform: translateX(24px); }
.switch-label { margin-left: 8px; font-size: 13px; vertical-align: middle; user-select: none; }

/* -------------------------
   Marker Styles
------------------------- */
.marker-wrap {
  width: 18px;
  height: 18px;
  position: relative;
  display: inline-block;
  transform: translate3d(0,0,0);
  pointer-events: none;
}

/* -------------------------
   Port Icons in Circle
------------------------- */
.marker-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff; /* default, overwritten inline if edited */
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;  /* ensures img stays inside circle */
}

.marker-circle .marker-img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* fills circle without stretching */
  border-radius: 50%; /* ensures corners are circular */
}

/* Combined / half-split icon support */
.port-div-icon .marker-circle {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff; /* subtle background if image has transparency */
}

/* main combined/single image */
.port-div-icon .marker-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* halves (hidden by default) */
.port-div-icon .half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  display: none;
  z-index: 2;
}

/* left / right positions */
.port-div-icon .half-left { left: 0; border-top-left-radius: 50%; border-bottom-left-radius: 50%; }
.port-div-icon .half-right { right: 0; border-top-right-radius: 50%; border-bottom-right-radius: 50%; }

/* images inside each half should fill their half cleanly */
.port-div-icon .half-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* marker-badge already exists in your CSS; ensure it's above halves */
.port-div-icon .marker-badge { z-index: 3; }




.marker-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ff6b00;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  transform-origin: center;
  pointer-events: none;
  z-index: 3;
}

.marker-circle.compare-highlight {
  background: #ff9800;
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255,152,0,0.18);
}

.marker-circle.compare-pulse {
  animation: compare-pulse 1.6s infinite ease-out;
}

@keyframes compare-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,152,0,0.55); }
  60% { box-shadow: 0 0 0 12px rgba(255,152,0,0.06); }
  100% { box-shadow: 0 0 0 0 rgba(255,152,0,0); }
}

.marker-compare {
  box-shadow: 0 0 0 6px rgba(255,191,0,0.2) !important;
  transform: scale(1.05);
  z-index: 6000;
}

.leaflet-marker-icon.marker-compare {
  transform: scale(1.15);
  z-index: 10001;
}

/* -------------------------
   Popups / Image Modal
------------------------- */
.popup-header { font-weight: bold; font-size: 15px; margin-bottom: 6px; }
.popup-image-wrapper { position: relative; width: 100%; margin-bottom: 6px; }
.popup-image-wrapper img { width: 100%; border-radius: 6px; cursor: pointer; }
.popup-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-arrow.left { left: 6px; }
.popup-arrow.right { right: 6px; }

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.image-modal img { max-width: 90%; max-height: 90%; }
.image-modal .close-btn {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
}
.image-modal .modal-arrow { position: absolute; top: 50%; font-size: 40px; color: #fff; cursor: pointer; user-select: none; }
.image-modal .modal-arrow.left { left: 30px; } 
.image-modal .modal-arrow.right { right: 30px; }

.popup-links a { display: block; color: #0066cc; text-decoration: none; margin-bottom: 4px; font-size: 13px; }
.popup-toggle { cursor: pointer; font-size: 13px; margin-top: 6px; color: #333; }
.popup-details { display: none; margin-top: 6px; max-height: 160px; overflow-y: auto; font-size: 12px; }

/* -------------------------
   Sidebar
------------------------- */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-collapsed);
  background: linear-gradient(180deg,var(--panel),#071021);
  color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 6px; gap: 6px;
  box-shadow: 2px 0 12px rgba(2,6,23,0.6);
  transition: width 220ms cubic-bezier(.2,.9,.2,1);
  z-index: 1000;
  border-right: 1px solid rgba(255,255,255,0.03);
}

.sidebar:hover,
.sidebar.expanded,
.sidebar.focused { width: var(--sidebar-expanded); }

/* When closing a modal, briefly force sidebar to collapse regardless of focus */
.sidebar.force-collapsed,
.sidebar.force-collapsed:hover,
.sidebar.force-collapsed.focused,
.sidebar.force-collapsed.expanded,
.sidebar.force-collapsed.pinned { width: var(--sidebar-collapsed) !important; }

.top-area { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; box-sizing: border-box; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.brand .logo {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.brand .title {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 180ms, transform 180ms;
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}

.sidebar:hover .title,
.sidebar.expanded .title,
.sidebar.focused .title {
  opacity: 1;
  transform: none;
}
.sidebar.force-collapsed .title,
.sidebar.force-collapsed.focused .title {
  opacity: 0 !important;
  transform: translateX(-6px) !important;
}

/* Tools */
.tools {
  margin-top: 8px;
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px;
  box-sizing: border-box;
}

.tool {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: visible;
  color: var(--muted);
  transition: background 160ms, color 160ms, transform 160ms;
}

.tool .icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--glass);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  flex: 0 0 40px;
}

.tool .icon img {
  width: 22px; height: 22px;
  object-fit: contain;
}

.tool .label {
  font-size: 14px; font-weight: 500; color: #fff;
  opacity: 0; transform: translateX(-6px);
  transition: opacity 180ms, transform 180ms;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar:hover .tool .label,
.sidebar.expanded .tool .label,
.sidebar.focused .tool .label {
  opacity: 1; transform: none;
}
.sidebar.force-collapsed .tool .label,
.sidebar.force-collapsed.focused .tool .label {
  opacity: 0 !important; transform: translateX(-6px) !important;
}

.tool:hover { background: rgba(255,255,255,0.03); color: #fff; }
.tool.active {
  background: linear-gradient(90deg, rgba(30,144,255,0.15), rgba(98,172,255,0.06));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
/* Remove active highlight when sidebar collapses */
.sidebar:not(:hover):not(.expanded):not(.pinned):not(.focused) .tool.active {
  background: transparent;
  box-shadow: none;
}

/* Tooltip */
.tool .tooltip {
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: #0b1220;
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(2,6,23,0.6);
  font-size: 13px;
  display: none;
  color: #fff;
  white-space: nowrap;
}

.sidebar:not(:hover) .tool:hover .tooltip { display: block; }

/* Bottom area */
.bottom {
  margin-top: auto;
  width: 100%;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pin {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
}

.pin .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.03);
}

.pin.active { background: rgba(255,255,255,0.03); color: #fff; }

/* Adjust main area */
.main-placeholder {
  margin-left: var(--sidebar-collapsed);
  transition: margin-left 220ms;
  padding: 18px;
}

.sidebar:hover ~ .main-placeholder,
.sidebar.expanded ~ .main-placeholder,
.sidebar.focused ~ .main-placeholder {
  margin-left: var(--sidebar-expanded);
}

/* -------------------------
   Compare Mode & Panel
------------------------- */
body.compare-mode { cursor: crosshair; }

.compare-panel {
  position: fixed;
  right: 12px; top: 80px;
  width: 420px;
  max-height: 78vh;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border-radius: 8px;
  padding: 12px;
  z-index: 99999;
  overflow: auto;

  display: none;
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
  transition: transform 220ms ease, opacity 220ms ease;
}

.compare-panel.open {
  display: block;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.compare-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.compare-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.compare-list .pill {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px;
  background: #f4f6f8;
  border-radius: 6px;
  font-size: 13px;
}
.compare-list .pill .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.compare-actions button[disabled] { opacity: 0.5; cursor: not-allowed; }
.compare-table-wrapper { margin-top: 10px; max-height: 60vh; overflow: auto; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 10px; }

/* -------------------------
   Sidebar Search
------------------------- */
/* -------------------------
   Sidebar Search — styled in port-search.css
   (do not duplicate rules here, they conflict)
------------------------- */

/* Autocomplete dropdown */
#portSearchContainer .autocomplete-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 6px;
  right: 6px;
  z-index: 5000;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

#portSearchContainer .autocomplete-suggestions div {
  padding: 6px 8px;
  cursor: pointer;
  color: #111;
}

#portSearchContainer .autocomplete-suggestions div:hover,
#portSearchContainer .autocomplete-suggestions .highlight {
  background: #0b5fff;
  color: #fff;
}

#portSearchContainer .search-message {
  font-size: 12px;
  color: red;
  margin-top: 2px;
}


/* Hide bottom controls completely when sidebar is collapsed */
.sidebar:not(:hover):not(.expanded):not(.pinned):not(.focused) #pinBtn,
.sidebar:not(:hover):not(.expanded):not(.pinned):not(.focused) .bottom-toggles,
.sidebar:not(:hover):not(.expanded):not(.pinned):not(.focused) .bottom .pin,
.sidebar.force-collapsed #pinBtn,
.sidebar.force-collapsed .bottom-toggles,
.sidebar.force-collapsed .bottom .pin {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

/* Show when expanded/hovered/pinned/focused */
.sidebar:hover #pinBtn,
.sidebar.expanded #pinBtn,
.sidebar.pinned #pinBtn,
.sidebar.focused #pinBtn,
.sidebar:hover .bottom-toggles,
.sidebar.expanded .bottom-toggles,
.sidebar.pinned .bottom-toggles,
.sidebar.focused .bottom-toggles,
.sidebar:hover .bottom .pin,
.sidebar.expanded .bottom .pin,
.sidebar.pinned .bottom .pin,
.sidebar.focused .bottom .pin {
  opacity: 1;
  pointer-events: auto;
}

#pinBtn, .bottom-toggles, .bottom .pin {
  transition: opacity 200ms ease;
}

/* ── AIS Live indicator dot on sidebar button ───────────────────────────── */
.tool[data-tool="ais"] .icon {
  position: relative;
}
.ais-live-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s;
  display: none;
}
.tool[data-tool="ais"].ais-active .ais-live-dot {
  display: block;
  background: #4caf50;
  box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
  animation: ais-pulse 1.5s infinite;
}
@keyframes ais-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(76,175,80,0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(76,175,80,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}

/* ── AIS vessel icon base ───────────────────────────────────────────────── */
.ais-vessel-icon {
  background: transparent !important;
  border: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* -------------------------
   Responsive
------------------------- */
@media (max-width: 600px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; }
}

/* ── Copernicus live dot on sidebar tool ─────────────────────────────────── */
.tool[data-tool="copernicus"] .icon {
  position: relative;
}
.tool-live-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.2s, box-shadow 0.2s;
}
.tool-live-dot.live {
  background: #2ecc71;
  box-shadow: 0 0 0 2px rgba(46,204,113,0.3);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(46,204,113,0.3); }
  50%      { box-shadow: 0 0 0 5px rgba(46,204,113,0.08); }
}

/* Brand area — use HPI logo image */
.brand .logo {
  background: transparent !important;
  padding: 0 !important;
  overflow: hidden;
}
.brand .logo img {
  width: 40px; height: 40px;
  object-fit: contain;
  border-radius: 8px;
}

/* About section separator */
.sidebar-about-divider {
  width: 100%;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin: 4px 0;
}

/* ── DUTH logo in sidebar bottom ─────────────────────────────────────────── */
/* ── Sidebar DUTH bottom logos ──────────────────────────────────────────── */
/* Two logos: vertical (collapsed, always visible) + horizontal (expanded) */
.sidebar-duth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 4px;
  position: relative;
  min-height: 40px;
  /* VERTICAL LOGO POSITION: increase margin-bottom to move logo up from bottom.
     Current: 12px. To move it higher, increase this value. */
  margin-bottom: 30px;
}

/* ── Vertical logo: shown when sidebar is collapsed (always visible) ─────── */
/* FILE: images/logo_white_crop_duth_vert_v2.png  —  SIZE: width:32px */
.duth-logo-vert {
  width: 55px;
  object-fit: contain;
  opacity: 0.8;
  transition: opacity 200ms, transform 200ms;
  position: absolute;
}
/* Hide vertical when sidebar is expanded/hovered */
.sidebar:hover .duth-logo-vert,
.sidebar.expanded .duth-logo-vert,
.sidebar.pinned .duth-logo-vert,
.sidebar.focused .duth-logo-vert {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}
.sidebar.force-collapsed .duth-logo-vert {
  opacity: 0.55 !important;
  transform: scale(1) !important;
}

/* ── Horizontal logo: shown when sidebar is expanded/hovered ─────────────── */
/* FILE: images/logo_blue_crop_duth.png  —  SIZE: height:44px */
.duth-logo-horiz {
  height: 50px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 200ms, transform 200ms;
  position: absolute;
}
.sidebar:hover .duth-logo-horiz,
.sidebar.expanded .duth-logo-horiz,
.sidebar.pinned .duth-logo-horiz,
.sidebar.focused .duth-logo-horiz {
  opacity: 0.75;
  transform: scale(1);
}
.sidebar.force-collapsed .duth-logo-horiz {
  opacity: 0 !important;
  transform: scale(0.85) !important;
}

/* ── Brand title update ──────────────────────────────────────────────────── */
.brand .title { font-size: 13px; font-weight: 700; letter-spacing: 0.3px; }


/* ── Zoom controls themed to match dark UI ──────────────────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}
.leaflet-control-zoom a {
  width: 34px !important; height: 34px !important; line-height: 34px !important;
  background: rgba(15,23,36,0.92) !important;
  color: rgba(255,255,255,0.75) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.07) !important;
  font-size: 18px !important; font-weight: 300 !important;
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s !important;
}
.leaflet-control-zoom a:last-child { border-bottom: none !important; }
.leaflet-control-zoom a:hover {
  background: rgba(30,144,255,0.2) !important;
  color: #fff !important;
}
.leaflet-control-zoom-in  { border-radius: 0 !important; }
.leaflet-control-zoom-out { border-radius: 0 !important; }


/* ── Cursor coordinate display ───────────────────────────────────────────── */
#cursorCoords {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  background: rgba(10, 16, 28, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.coord-dms { font-family: monospace; letter-spacing: 0.3px; }
.coord-sep { color: rgba(255,255,255,0.3); }
.coord-dd  { font-family: monospace; color: rgba(255,255,255,0.5); font-size: 11px; }

/* ── Two-compass layout ──────────────────────────────────────────────────── */
.cop-two-compass-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 0 4px;
}
.cop-compass-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.cop-compass-cell-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.85;
}
.cop-compass-dir-val {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1px;
}
.cop-compass-divider {
  width: 1px;
  height: 80px;
  background: rgba(255,255,255,0.08);
  margin: 0 10px;
  align-self: center;
}

/* ── Submit Port modal input focus states ────────────────────────────────── */
#submitModal input:focus,
#submitModal textarea:focus {
  border-color: rgba(30,144,255,0.5) !important;
  background: rgba(255,255,255,0.10) !important;
}
#submitModel select:focus {
  border-color:rgba(30,144,255,0.5) !important;
}
#submitModal input::placeholder,
#submitModal textarea::placeholder {
  color: rgba(255,255,255,0.25);
}

/* ── 3D View button in port detail panel ─────────────────────────────────── */
.pdp-btn-3d {
  background: linear-gradient(135deg, #0f4c1e, #1a7a35) !important;
  color: #fff !important;
  border: 1px solid rgba(46,204,113,0.3) !important;
}
.pdp-btn-3d:hover {
  background: linear-gradient(135deg, #1a7a35, #27ae60) !important;
  border-color: rgba(46,204,113,0.6) !important;
}

/* ── Bug Report modal submit button ─────────────────────────────────────── */
#brSubmitBtn:hover  { opacity: 0.88; }
#brSubmitBtn:active { opacity: 1; transform: scale(0.99); }

/* ── Changelog version badge ─────────────────────────────────────────────── */
/* Add a small "NEW" dot on the changelog sidebar icon until user opens it */
.tool[data-tool="changelog"] .icon::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46,204,113,0.8);
  animation: newDotPulse 2s ease-in-out infinite;
}
@keyframes newDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.8); }
}
/* Remove dot after user has seen changelog */
.tool[data-tool="changelog"].seen .icon::after { display: none; }

/* ── 3D View tab in port detail panel ───────────────────────────────────── */
.pdp-3d-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}
.pdp-3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 6px;
  flex-shrink: 0;
}
.pdp-3d-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.pdp-3d-external {
  font-size: 11px;
  color: #4fc3f7;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.pdp-3d-external:hover { opacity: 1; }

.pdp-3d-frame-wrap {
  width: 100%;
  /* Fixed height — gives a good view inside the panel */
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  background: #0a1020;
}
.pdp-3d-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.pdp-3d-tip {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-align: center;
  padding: 6px 0 2px;
}

/* ── Changelog "new" dot on sidebar icon ────────────────────────────────── */
.tool[data-tool="changelog"] .icon {
  position: relative;
}
.tool[data-tool="changelog"]:not(.seen) .icon::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 6px rgba(46,204,113,0.8);
  animation: newDotPulse 2s ease-in-out infinite;
}
@keyframes newDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* ── Bug report submit button hover ─────────────────────────────────────── */
#brSubmitBtn:hover  { opacity: 0.88; }
#brSubmitBtn:active { transform: scale(0.99); }



/* ═══════════════════════════════════════════════════════════════════════════
   VESSEL DETAIL PANEL
═══════════════════════════════════════════════════════════════════════════ */
.vdp-panel {
  position: fixed;
  top: 0; right: 0;
  width: 320px;
  height: 100vh;
  background: #0a1628;
  border-left: 1px solid rgba(255,255,255,0.08);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(.2,.9,.2,1);
  box-shadow: -6px 0 32px rgba(0,0,0,0.6);
  overflow: hidden;
}
.vdp-panel.open { transform: translateX(0); }

.vdp-close-btn {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 20;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  color: rgba(255,255,255,0.75);
  width: 30px; height: 30px;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.vdp-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

.vdp-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.vdp-scroll::-webkit-scrollbar { width: 3px; }
.vdp-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Hero image area ─────────────────────────────────────────────────────── */
.vdp-hero-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background: linear-gradient(135deg, #0d2040 0%, #1a3a6e 100%);
  overflow: hidden;
}
.vdp-hero-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.15);
}
.vdp-hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.vdp-hero-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 110px;
  background: linear-gradient(to bottom, transparent, #0a1628);
}
.vdp-hero-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 14px 14px;
}
.vdp-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px; border: 1px solid;
  margin-bottom: 5px;
}
.vdp-vessel-name {
  font-size: 18px; font-weight: 800;
  color: #fff; letter-spacing: 0.3px;
  line-height: 1.25;
}
.vdp-vessel-ids {
  display: flex; flex-wrap: wrap; gap: 5px;
  margin-top: 5px;
}
.vdp-id-chip {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.vdp-body { padding: 8px 0 20px; }
.vdp-empty {
  font-size: 12px; color: rgba(255,255,255,0.3);
  text-align: center; padding: 32px 16px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.vdp-card {
  margin: 0 12px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 12px 14px;
}
.vdp-card-title {
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 10px;
}

/* Motion grid */
.vdp-motion-grid {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 6px;
}
.vdp-motion-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vdp-motion-lbl { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }

/* Speed bar */
.vdp-speed-wrap { width: 100%; text-align: center; }
.vdp-speed-val { font-size: 22px; font-weight: 800; line-height: 1; }
.vdp-speed-unit { font-size: 12px; font-weight: 500; opacity: 0.7; }
.vdp-speed-status { font-size: 10px; color: rgba(255,255,255,0.4); margin: 2px 0 6px; }
.vdp-speed-track {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
.vdp-speed-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.vdp-speed-scale {
  display: flex; justify-content: space-between;
  font-size: 9px; color: rgba(255,255,255,0.25);
  margin-top: 3px;
}

/* Info rows */
.vdp-row {
  display: grid; grid-template-columns: 44% 56%;
  gap: 0 6px; padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  align-items: baseline;
}
.vdp-row:last-child { border-bottom: none; }
.vdp-key { font-size: 10px; color: rgba(255,255,255,0.38); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.vdp-val { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 500; word-break: break-word; }

/* Inline rows (in motion card) */
.vdp-inline-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 2px; }
.vdp-ikey { font-size: 10px; color: rgba(255,255,255,0.38); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.vdp-ival { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 600; }

/* External links */
.vdp-links-card {
  margin: 0 12px 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.vdp-link-btn {
  display: block; width: 100%;
  padding: 9px 12px;
  background: rgba(30,144,255,0.08);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 8px;
  color: #4fc3f7; font-size: 12px; font-weight: 600;
  text-decoration: none; text-align: center;
  transition: background 0.15s;
}
.vdp-link-btn:hover { background: rgba(30,144,255,0.18); }

/* ── Vessel panel — no data / position-only state ───────────────────────── */
.vdp-nodata-card {
  margin: 16px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.vdp-nodata-icon  { font-size: 36px; line-height: 1; margin-bottom: 4px; }
.vdp-nodata-title {
  font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 0.3px;
}
.vdp-nodata-sub {
  font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.6;
  max-width: 240px;
}
.vdp-nodata-mmsi {
  font-size: 12px; font-weight: 700;
  color: #4fc3f7;
  background: rgba(79,195,247,0.1);
  border: 1px solid rgba(79,195,247,0.2);
  border-radius: 6px;
  padding: 4px 12px;
  letter-spacing: 0.5px;
}
.vdp-nodata-motion {
  display: flex; gap: 12px;
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.7);
}
.vdp-nodata-hint {
  font-size: 10px; color: rgba(255,255,255,0.28); line-height: 1.6;
}
