/* port-detail-panel.css — right panel (port detail + compare) */

/* ── Panel shell ─────────────────────────────────────────────────────────── */
.pdp-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 340px;
  max-width: 94vw;
  background: #0d1623;
  border-left: 1px solid rgba(255,255,255,0.07);
  box-shadow: -6px 0 32px rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 600ms cubic-bezier(0.16,1,0.3,1),
              opacity 400ms ease;
}
.pdp-panel.open {
  transform: translateX(0);
  opacity: 1;
}

/* Port content area — grows to fill panel, tabs + panel scroll inside it */
#pdpPortContent {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.pdp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: rgba(255,255,255,0.025);
}
.pdp-header-left {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.pdp-cat-dot {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}
.pdp-title {
  font-size: 15px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.pdp-subtitle {
  font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pdp-close {
  background: rgba(255,255,255,0.07); border: none; border-radius: 6px;
  color: rgba(255,255,255,0.6); width: 28px; height: 28px;
  font-size: 13px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.pdp-close:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ── Gallery ─────────────────────────────────────────────────────────────── */
.pdp-gallery { flex-shrink: 0; background: #060d18; }
.pdp-gallery-strip { position: relative; height: 160px; overflow: hidden; }
.pdp-gallery-thumb {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 0.3s ease; cursor: pointer;
}
.pdp-gallery-thumb.active { opacity: 1; }
.pdp-gallery-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 4px 0; background: rgba(0,0,0,0.5);
}
.pdp-gnav {
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 24px; height: 24px; border-radius: 50%; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.pdp-gnav:hover { background: rgba(255,255,255,0.22); }
.pdp-gcount { font-size: 11px; color: rgba(255,255,255,0.6); min-width: 40px; text-align: center; }
.pdp-no-image {
  height: 72px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ── Stats tiles ─────────────────────────────────────────────────────────── */
.pdp-stats {
  display: grid; grid-template-columns: repeat(4,1fr);
  border-bottom: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.pdp-stat {
  display: flex; flex-direction: column; align-items: center;
  padding: 7px 4px; border-right: 1px solid rgba(255,255,255,0.05); gap: 2px;
}
.pdp-stat:last-child { border-right: none; }
.pdp-stat-icon { font-size: 13px; }
.pdp-stat-val  { font-size: 11px; font-weight: 700; color: #fff; text-align: center; }
.pdp-stat-lbl  { font-size: 10px; color: rgba(255,255,255,0.35); text-align: center; }

/* ── Action row (Fly to + Compare) ──────────────────────────────────────── */
.pdp-action-row {
  display: flex; gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.pdp-action-btn {
  flex: 1; padding: 7px 4px;
  border-radius: 7px; border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pdp-btn-fly {
  background: rgba(241,196,15,0.1); color: #f1c40f;
  border-color: rgba(241,196,15,0.25);
}
.pdp-btn-fly:hover {
  background: rgba(241,196,15,0.22); border-color: rgba(241,196,15,0.5);
}
.pdp-btn-3d {
  background: rgba(46,204,113,0.1); color: #2ecc71;
  border-color: rgba(46,204,113,0.25);
}
.pdp-btn-3d:hover {
  background: rgba(46,204,113,0.22); border-color: rgba(46,204,113,0.5);
}
.pdp-btn-compare {
  background: rgba(52,152,219,0.1); color: #4fc3f7;
  border-color: rgba(52,152,219,0.25);
}
.pdp-btn-compare:hover {
  background: rgba(52,152,219,0.22); border-color: rgba(52,152,219,0.5);
}
/* CMEMS button active state */
.cop-spot-btn.active {
  background: rgba(231,76,60,0.15);
  border-color: rgba(231,76,60,0.4);
  color: #e74c3c;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.pdp-tabs {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0; background: rgba(255,255,255,0.02);
}
.pdp-tab {
  flex: 1; padding: 8px 4px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.4); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.pdp-tab:hover  { color: rgba(255,255,255,0.75); }
.pdp-tab.active { color: #4fc3f7; border-bottom-color: #4fc3f7; }

/* tab panels */
.pdp-tabpanel {
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  /* no padding here — accordion sections handle their own spacing */
}
.pdp-tabpanel.active { display: flex; flex-direction: column; }
.pdp-tabpanel::-webkit-scrollbar { width: 4px; }
.pdp-tabpanel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

/* ── Accordion (Overview tab) ────────────────────────────────────────────── */
.pdp-acc {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pdp-acc-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.75); font-size: 12px; font-weight: 700;
  text-align: left; letter-spacing: 0.3px;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.pdp-acc-head:hover { background: rgba(255,255,255,0.04); color: #fff; }
.pdp-acc-head.open  { color: #4fc3f7; }

.pdp-acc-icon  {
  font-size: 14px; flex-shrink: 0;
  display: inline-block;
  transform-origin: 50% 55%;
}
.pdp-acc-head.open .pdp-acc-icon {
  animation: pdpAccIconPulse 2.2s ease-in-out infinite;
}
@keyframes pdpAccIconPulse {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%       { transform: scale(1.18) rotate(-6deg); }
}
.pdp-acc-title { flex: 1; }
.pdp-acc-chevron {
  font-size: 16px; color: rgba(255,255,255,0.3); flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), color 0.15s;
  display: inline-block;
  line-height: 1;
}
.pdp-acc-head.open .pdp-acc-chevron {
  transform: rotate(90deg);
  color: #4fc3f7;
}

/* Accordion body — animated slide */
.pdp-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4,0,0.2,1);
}
.pdp-acc-body.open {
  max-height: 1200px;
}

.pdp-acc-inner {
  padding: 4px 14px 12px;
}

/* ── Info table ──────────────────────────────────────────────────────────── */
.pdp-info-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pdp-info-table tr + tr td { border-top: 1px solid rgba(255,255,255,0.04); }
.pdp-info-table td { padding: 5px 2px; vertical-align: top; }
.pdp-info-key { color: rgba(255,255,255,0.38); width: 44%; padding-right: 8px; }
.pdp-info-val { color: rgba(255,255,255,0.85); }
.pdp-info-table--mt { margin-top: 10px; }

.pdp-empty-section { font-size: 12px; color: rgba(255,255,255,0.25); padding: 6px 0; }

/* ── Depth bars ──────────────────────────────────────────────────────────── */
.pdp-depth-bars  { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 4px; }
.pdp-depth-row   { display: flex; align-items: center; gap: 8px; }
.pdp-depth-label { font-size: 11px; color: rgba(255,255,255,0.45); width: 110px; flex-shrink: 0; }
.pdp-depth-track-wrap {
  flex: 1; display: flex; align-items: center; gap: 5px; position: relative;
}
.pdp-depth-track { flex:1; height:6px; background:rgba(255,255,255,0.07); border-radius:3px; overflow:hidden; }
.pdp-depth-fill  { height:100%; border-radius:3px; transition:width 0.5s ease; }
.pdp-depth-value { font-size:11px; color:#fff; font-weight:600; width:44px; text-align:right; flex-shrink:0; }

/* ℹ info icon + tooltip */
.pdp-depth-info {
  font-size: 11px; color: rgba(255,255,255,0.3); cursor: default;
  flex-shrink: 0; line-height: 1; user-select: none;
  transition: color 0.15s;
}
.pdp-depth-info:hover { color: #4fc3f7; }

/* Custom tooltip on the track wrapper */
.pdp-depth-track-wrap[data-tip] { position: relative; cursor: default; }

/* JS-driven tooltip — positioned by JS to always stay inside panel
   (shared style used by depth-bar tooltips and Copernicus info tooltip) */
#pdpDepthTooltip,
#copRepTooltip {
  position: fixed;
  background: #0d1829;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 11.5px;
  color: rgba(255,255,255,0.85);
  white-space: normal;
  word-break: break-word;
  line-height: 1.6;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  width: 220px;
  display: none;
}

/* ── Restriction rows (plain table, no colors) ───────────────────────────── */
/* Restrictions use the standard pdp-info-table — no special styles needed */

/* ── Facilities section ──────────────────────────────────────────────────── */
.pdp-facilities-wrap {
  margin-top: 10px;
}
.pdp-facilities-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.7px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  margin-bottom: 6px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pdp-fac-list {
  display: flex; flex-direction: column;
}
/* Each row matches pdp-info-table tr exactly */
.pdp-fac-row {
  display: flex; align-items: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding: 5px 2px;
}
.pdp-fac-name {
  /* same as pdp-info-key */
  color: rgba(255,255,255,0.38); font-size: 12px; font-weight: 400;
  width: 44%; padding-right: 8px; flex-shrink: 0;
}
.pdp-fac-indicator {
  display: flex; align-items: center; gap: 5px;
  /* same as pdp-info-val */
  color: rgba(255,255,255,0.85); font-size: 12px;
}
.pdp-fac-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; flex-shrink: 0;
}
.pdp-fac-yes { background: #2ecc71; box-shadow: 0 0 5px rgba(46,204,113,0.6); }
.pdp-fac-no  { background: #e74c3c; box-shadow: 0 0 5px rgba(231,76,60,0.6); }
.pdp-fac-val { font-size: 12px; font-weight: 400; color: rgba(255,255,255,0.85); }
.pdp-fac-val-yes { color: #2ecc71; }
.pdp-fac-val-no  { color: #e74c3c; }
/* Unknown dash — same color and size as other values */
.pdp-fac-val-unk { color: rgba(255,255,255,0.85); font-size: 12px; }

/* ── Copernicus tab placeholder ──────────────────────────────────────────── */
.pdp-cop-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 40px 24px; text-align: center;
}
.pdp-cop-icon  { font-size: 42px; line-height: 1; }
.pdp-cop-title { font-size: 14px; font-weight: 700; color: #fff; }
.pdp-cop-desc  { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.5; }
.pdp-cop-btn   {
  margin-top: 6px;
  padding: 8px 20px;
  background: linear-gradient(135deg, #0077b6, #00b4d8);
  border: none; border-radius: 7px;
  color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}
.pdp-cop-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Contact / Links tab ─────────────────────────────────────────────────── */
.pdp-links-list { display:flex; flex-direction:column; gap:8px; padding: 12px 14px; }
.pdp-link-item  {
  display:flex; align-items:center; gap:8px;
  padding:9px 12px; background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08); border-radius:7px;
  color:#4fc3f7; text-decoration:none; font-size:13px;
  transition:background 0.15s;
}
.pdp-link-item:hover { background:rgba(255,255,255,0.1); }
.pdp-no-links { font-size:12px; color:rgba(255,255,255,0.3); padding:24px 14px; text-align:center; }

/* ══════════════════════════════════════════════════════════════════════════
   COMPARE MODE
══════════════════════════════════════════════════════════════════════════ */
.pdp-compare-wrap {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.cmp-banner {
  padding: 10px 14px; font-size: 12px; color: rgba(255,255,255,0.55);
  background: rgba(52,152,219,0.08); border-bottom: 1px solid rgba(52,152,219,0.15);
  flex-shrink: 0; line-height: 1.4;
}
.cmp-selected-list {
  flex: 0 0 auto; max-height: 260px; overflow-y: auto;
  padding: 8px 12px; display: flex; flex-direction: column; gap: 6px;
}
.cmp-selected-list::-webkit-scrollbar { width:4px; }
.cmp-selected-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1); border-radius:2px; }
.cmp-empty {
  font-size: 12px; color: rgba(255,255,255,0.3);
  text-align: center; padding: 20px 0; line-height: 1.6;
}
.cmp-sel-card {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px; padding: 6px 8px; transition: border-color 0.15s;
}
.cmp-sel-card:hover { border-color: rgba(255,255,255,0.14); }
.cmp-sel-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: #3498db; color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cmp-sel-thumb {
  width: 40px; height: 32px; border-radius: 5px;
  background-size: cover; background-position: center; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; background-color: #0a1525;
}
.cmp-sel-info { flex: 1; min-width: 0; }
.cmp-sel-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-sel-cat  { font-size: 10px; font-weight: 500; margin-top: 1px; }
.cmp-sel-remove {
  background: rgba(255,255,255,0.06); border: none; border-radius: 4px;
  color: rgba(255,255,255,0.45); width: 22px; height: 22px;
  font-size: 11px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.cmp-sel-remove:hover { background: rgba(231,76,60,0.2); color: #e74c3c; }

.cmp-action-row {
  display: flex; gap: 6px; padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0;
}
.cmp-btn {
  flex: 1; padding: 7px 4px; border-radius: 7px; border: 1px solid transparent;
  font-size: 11px; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.cmp-btn.primary   { background: rgba(52,152,219,0.2); color:#4fc3f7; border-color:rgba(52,152,219,0.35); }
.cmp-btn.primary:hover:not(:disabled) { background:rgba(52,152,219,0.35); }
.cmp-btn.primary:disabled { opacity:0.35; cursor:not-allowed; }
.cmp-btn.secondary { background:rgba(255,255,255,0.06); color:rgba(255,255,255,0.7); border-color:rgba(255,255,255,0.1); }
.cmp-btn.secondary:hover { background:rgba(255,255,255,0.12); color:#fff; }
.cmp-btn.danger    { background:rgba(231,76,60,0.1); color:#e74c3c; border-color:rgba(231,76,60,0.2); }
.cmp-btn.danger:hover { background:rgba(231,76,60,0.2); }

/* Results area */
.cmp-results {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 0 0 16px;
  border-top: 1px solid rgba(255,255,255,0.07); display: none;
}
.cmp-results::-webkit-scrollbar { width:4px; }
.cmp-results::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.1); border-radius:2px; }

/* ── Port chips (vertical list at top of results) ─────────────────────── */
.cmp-port-chips {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cmp-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.cmp-chip-num {
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cmp-chip-thumb {
  width: 34px; height: 26px; border-radius: 4px;
  background-size: cover; background-position: center;
  background-color: #0a1525; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.cmp-chip-info  { flex: 1; min-width: 0; }
.cmp-chip-name  { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-chip-meta  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 1px; }

/* ── Section headings ─────────────────────────────────────────────────── */
.cmp-section-head {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}

/* ── Attribute table: key col + N numbered value cols ─────────────────── */
.cmp-tbl { width: 100%; font-size: 11px; }

.cmp-tbl-row {
  display: flex; border-bottom: 1px solid rgba(255,255,255,0.04);
  min-height: 26px;
}
.cmp-tbl-row:last-child { border-bottom: none; }
.cmp-tbl-row.cmp-diff { /* no highlight — values speak for themselves */ }

.cmp-tbl-header { background: rgba(255,255,255,0.03); }

/* Key column — fixed width, never grows */
.cmp-tbl-key {
  flex: 0 0 68px; min-width: 0;
  padding: 5px 6px;
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.38);
  border-right: 1px solid rgba(255,255,255,0.06);
  word-break: break-word;
  display: flex; align-items: center;
}

/* Each value column — equal width, truncate overflow */
.cmp-tbl-col-head {
  flex: 1; min-width: 0;
  padding: 4px 4px;
  text-align: center;
  font-size: 11px; font-weight: 800;
  color: rgba(255,255,255,0.5);
  border-right: 1px solid rgba(255,255,255,0.04);
}
.cmp-tbl-col-head:last-child { border-right: none; }

.cmp-tbl-val {
  flex: 1; min-width: 0;
  padding: 5px 4px;
  text-align: center;
  color: rgba(255,255,255,0.78);
  border-right: 1px solid rgba(255,255,255,0.04);
  word-break: break-word;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.cmp-tbl-val:last-child { border-right: none; }

/* Best value (highest depth) gets a green glow */
.cmp-tbl-val.cmp-best {
  color: #2ecc71; font-weight: 700;
}

/* Restriction cells — plain text, no color */

/* Clickable links in contact section */
.cmp-link {
  color: #4fc3f7; text-decoration: none; font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; max-width: 100%;
}
.cmp-link:hover { text-decoration: underline; }

/* Ruler hint footer */
.cmp-ruler-hint {
  margin: 10px 12px 4px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(241,196,15,0.07);
  border: 1px solid rgba(241,196,15,0.15);
  font-size: 11px; color: rgba(255,255,255,0.45);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   COPERNICUS TAB
══════════════════════════════════════════════════════════════════════════ */

.cop-loading {
  padding: 40px; text-align: center;
  font-size: 13px; color: rgba(255,255,255,0.4);
}

/* Header meta row */
.cop-header-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 4px; padding: 8px 14px 4px;
  font-size: 10px; color: rgba(255,255,255,0.35);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Stat cards grid */
.cop-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 10px 12px 6px;
}
.cop-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px; padding: 8px 4px;
}
.cop-card-icon { font-size: 14px; }
.cop-card-val  { font-size: 13px; font-weight: 700; }
.cop-card-lbl  { font-size: 9px; color: rgba(255,255,255,0.35); text-align: center; }

/* Section headings */
.cop-section-head {
  padding: 8px 12px 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.8px;
  text-transform: uppercase; color: rgba(255,255,255,0.3);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}

/* Storm events grid */
.cop-storm-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 5px; padding: 4px 12px 8px;
}
.cop-storm-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(52,152,219,0.08);
  border: 1px solid rgba(52,152,219,0.15);
  border-radius: 6px; padding: 6px 4px;
}
.cop-storm-val { font-size: 12px; font-weight: 700; color: #4fc3f7; }
.cop-storm-lbl { font-size: 9px; color: rgba(255,255,255,0.35); text-align: center; }

/* Top storms list */
.cop-top-storms { padding: 4px 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.cop-storm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; font-size: 11px;
}
.cop-storm-rank { font-weight: 800; color: #f1c40f; width: 22px; flex-shrink: 0; }
.cop-storm-hs   { font-weight: 700; color: #e74c3c; width: 46px; flex-shrink: 0; }
.cop-storm-date { color: rgba(255,255,255,0.6); flex: 1; }
.cop-storm-dur  { color: rgba(255,255,255,0.35); font-size: 10px; }

/* Return levels grid */
.cop-rl-grid {
  display: flex; gap: 5px; padding: 4px 12px 8px; flex-wrap: wrap;
}
.cop-rl-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: rgba(155,89,182,0.1);
  border: 1px solid rgba(155,89,182,0.2);
  border-radius: 6px; padding: 6px 10px;
}
.cop-rl-val { font-size: 12px; font-weight: 700; color: #c39bd3; }
.cop-rl-lbl { font-size: 9px; color: rgba(255,255,255,0.35); }

/* Report PNG */
.cop-report-wrap {
  padding: 6px 12px 8px;
}
.cop-report-img {
  width: 100%; border-radius: 8px; cursor: zoom-in;
  border: 1px solid rgba(255,255,255,0.08);
  transition: opacity 0.2s;
}
.cop-report-img:hover { opacity: 0.9; }
.cop-img-error {
  padding: 20px; text-align: center;
  font-size: 12px; color: rgba(255,255,255,0.3);
  border: 1px dashed rgba(255,255,255,0.1);
  border-radius: 8px;
}

/* TXT link */
.cop-txt-link {
  padding: 4px 12px 16px; text-align: center;
}
.cop-txt-link a {
  font-size: 12px; color: #4fc3f7; text-decoration: none;
}
.cop-txt-link a:hover { text-decoration: underline; }

/* No data placeholder */
.pdp-cop-placeholder {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px;
  padding: 40px 24px; text-align: center;
}
.pdp-cop-icon  { font-size: 42px; line-height: 1; }
.pdp-cop-title { font-size: 14px; font-weight: 700; color: #fff; }
.pdp-cop-desc  { font-size: 12px; color: rgba(255,255,255,0.4); line-height: 1.5; }

/* ── Copernicus summary rows ────────────────────────────────────────────────── */
.cop-summary-grid {
  padding: 2px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cop-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 12px;
}
.cop-sum-row:last-child { border-bottom: none; }
.cop-sum-lbl {
  color: rgba(255,255,255,0.5);
  flex: 1;
}
.cop-sum-val {
  font-weight: 700;
  text-align: right;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   COPERNICUS TAB — Enhanced v2
══════════════════════════════════════════════════════════════════════════ */

/* Show CMEMS spot button */
.cop-spot-btn-wrap { padding: 8px 12px 4px; }
.cop-spot-btn {
  width: 100%; padding: 9px 14px;
  background: rgba(30,144,255,0.1);
  border: 1px solid rgba(30,144,255,0.3);
  border-radius: 8px; color: #4fc3f7;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cop-spot-btn:hover {
  background: rgba(30,144,255,0.2);
  border-color: rgba(30,144,255,0.6);
}

/* CMEMS spot pulsing ring on the map — color set via --cop-color custom prop */
.cmems-spot-outer {
  width: 24px; height: 24px; border-radius: 50%;
  background: color-mix(in srgb, var(--cop-color, #1e90ff) 20%, transparent);
  border: 2px solid color-mix(in srgb, var(--cop-color, #1e90ff) 85%, transparent);
  display: flex; align-items: center; justify-content: center;
}
.cmems-spot-inner {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cop-color, #6bd1ff);
  box-shadow: 0 0 6px color-mix(in srgb, var(--cop-color, #6bd1ff) 90%, transparent);
}
/* Port ring marker — invisible div, pulse handled by SVG overlay */
.cmems-port-ring {
  width: 35px; height: 35px; border-radius: 50%;
  background: transparent;
  pointer-events: none;
}

/* Group containers */
.cop-group {
  margin: 6px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  overflow: hidden;
}
.cop-group-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.7px;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cop-group-icon { font-size: 13px; }

/* Stat cards (Wave Heights & Return Levels) */
.cop-stat-cards {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 10px;
}
.cop-stat-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px; padding: 10px 6px; border-radius: 8px;
  border: 1px solid transparent;
  text-align: center; min-height: 64px;
}
.cop-stat-val {
  font-size: 15px; font-weight: 800; line-height: 1.2;
  white-space: nowrap; /* prevent unit wrapping to next line */
}
.cop-stat-lbl { font-size: 11px; color: rgba(255,255,255,0.6); font-weight: 600; }
.cop-stat-sub { font-size: 9px; color: rgba(255,255,255,0.25); }

/* Compass */
.cop-compass-wrap {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 14px;
}
.cop-compass {
  flex-shrink: 0; border-radius: 50%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
}
.cop-compass-legend {
  display: flex; flex-direction: column; gap: 7px;
}
.cop-compass-leg-row {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: rgba(255,255,255,0.7);
}
.cop-compass-dot {
  width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0;
}

/* Storm statistics rows */
.cop-storm-summary { padding: 6px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.cop-storm-stat-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.cop-storm-stat-row:hover { background: rgba(255,255,255,0.04); }
.cop-storm-stat-icon { font-size: 13px; flex-shrink: 0; width: 18px; }
.cop-storm-stat-lbl { flex: 1; font-size: 11px; color: rgba(255,255,255,0.5); }
.cop-storm-stat-val { font-size: 13px; font-weight: 700; }


/* ═══════════════════════════════════════════════════════════════════════════
   COPERNICUS — Representativeness badge + tooltip
═══════════════════════════════════════════════════════════════════════════ */
.cop-rep-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 4px 0 2px;
}
.cop-rep-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}
.cop-rep-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.cop-rep-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  cursor: help;
  margin-left: 2px;
  outline: none;
}
.cop-rep-info:hover,
.cop-rep-info:focus {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.cop-rep-caution {
  color: #e67e22;
  font-weight: 600;
}

/* ── Port-Directed Conditions (primary group) ─────────────────────────── */
.cop-group-primary {
  border: 1px solid rgba(46,204,113,0.18);
  background: rgba(46,204,113,0.04);
  border-radius: 10px;
}
.cop-group-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #2ecc71;
  background: rgba(46,204,113,0.12);
  border: 1px solid rgba(46,204,113,0.3);
  border-radius: 10px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
}
.cop-group-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  line-height: 1.5;
  padding: 6px 14px 10px;
}

/* ── Animated storm-stat icons (play only while hovering the row) ────────── */
.cop-storm-stat-icon { display: inline-block; }

.cop-storm-stat-row:hover .cop-anim-wave {
  animation: copWaveBob 2.4s ease-in-out infinite;
  transform-origin: 50% 70%;
}
@keyframes copWaveBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%       { transform: translateY(-2px) rotate(6deg); }
  50%       { transform: translateY(0) rotate(0deg); }
  75%       { transform: translateY(2px) rotate(-6deg); }
}

.cop-storm-stat-row:hover .cop-anim-clock {
  animation: copClockSpin 3.5s linear infinite;
  transform-origin: 52% 54%;
}
@keyframes copClockSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.cop-storm-stat-row:hover .cop-anim-chart {
  animation: copChartBounce 1.8s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes copChartBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-3px) scale(1.08); }
}

/* Storm-definition footnote (detail panel + compare table) */
.cop-storm-note, 
.cmp-storm-note {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  line-height: 1.5;
  font-style: normal;
}
.cop-storm-note {padding: 6px 8px 0;}
.cmp-storm-note {padding: 6px 12px 10px;}
