/* assets/colormap.css — Colour Map page styles.
   Reuses CSS custom properties defined in colormap.html <style>:
     --royal #542084, --teal-ink #04b9c4, --bench #f5f1e5,
     --ink #1a1a1a, --ink-soft #6b7280, --line-dark #d1c9b8, --card-bg #fff */

/* ── Two-column layout ─────────────────────────────────────────────────── */
.cmap-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - 122px); /* viewport minus header */
  min-height: 480px;
  overflow: hidden;
}

/* ── Left panel ─────────────────────────────────────────────────────────── */
.cmap-panel {
  background: var(--card-bg);
  border-right: 1px solid var(--line-dark);
  overflow-y: auto;
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cmap-panel h2 {
  font-family: 'Archivo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}

.cmap-layers-h {
  margin: 0 0 8px !important;
  padding-top: 4px;
  border-top: 1px solid var(--line-dark);
}

.cmap-panel section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmap-panel h3 {
  font-family: 'Archivo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin: 0;
}

/* Layer rows: checkbox + ring swatch + name + count */
.cmap-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s;
}
.cmap-layer-row:hover {
  background: var(--bench);
}
.cmap-layer-row input[type="checkbox"] {
  flex: 0 0 auto;
  accent-color: var(--royal);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.cmap-ring-swatch {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor; /* color set inline */
  background: transparent;
}
.cmap-layer-name {
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmap-layer-count {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
}

/* Sign-in prompt when logged out */
.cmap-signin-prompt {
  font-size: 13px;
  color: var(--ink-soft);
  padding: 6px 4px;
  line-height: 1.5;
}

/* Status / skip count */
.cmap-status {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0;
  min-height: 1em;
}

/* ── Stage (canvas area) ─────────────────────────────────────────────────── */
.cmap-stage {
  position: relative;
  background: var(--bench);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

#cmap-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bench);
  cursor: crosshair;
}

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
.cmap-tooltip {
  position: absolute;
  pointer-events: none;
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(26, 26, 26, .14);
  width: 220px;
  overflow-wrap: break-word;
  z-index: 10;
}
.cmap-tooltip.pinned {
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(26, 26, 26, .22);
  border-color: var(--royal);
}
.cmap-tooltip.pinned .wish-icon { margin-top: 4px; }
.cmap-tooltip[hidden] {
  display: none;
}
.cmap-tip-name {
  font-weight: 600;
  color: var(--ink);
}
.cmap-tip-brand {
  color: var(--ink-soft);
  font-size: 12px;
}
.cmap-tip-hex {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--teal-ink);
}
.cmap-tip-swatch {
  width: 100%;
  height: 48px;
  border-radius: 4px;
  border: none;
  margin-bottom: 8px;
}

/* ── Readout strip (scale + stress) ─────────────────────────────────────── */
.cmap-readout {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  align-items: center;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  backdrop-filter: blur(4px);
  pointer-events: none;
  white-space: nowrap;
}

#cmap-scale,
#cmap-stress {
  display: inline;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.cmap-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  pointer-events: none;
  padding: 0 24px;
  line-height: 1.6;
}

/* ── Responsive: collapse panel on small screens ─────────────────────────── */
@media (max-width: 640px) {
  .cmap-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .cmap-panel {
    border-right: none;
    border-bottom: 1px solid var(--line-dark);
    max-height: 220px;
  }
  .cmap-stage {
    height: 60vh;
    min-height: 300px;
  }
}
