/* ============================================================
   Image Colour Picker — colour-picker.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700&display=swap');

:root {
  --icp-bg:        #0f0f11;
  --icp-surface:   #1a1a1f;
  --icp-border:    #2e2e38;
  --icp-accent:    #c8ff57;
  --icp-accent2:   #ff57a8;
  --icp-text:      #e8e8f0;
  --icp-muted:     #7070a0;
  --icp-radius:    12px;
  --icp-radius-sm: 6px;
}

/* Wrap */
.icp-wrap {
  font-family: 'DM Mono', monospace;
  background: var(--icp-bg);
  border: 1px solid var(--icp-border);
  border-radius: 18px;
  padding: 28px;
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  color: var(--icp-text);
  box-shadow: 0 8px 60px rgba(0,0,0,.55);
}

/* ── Drop Zone ─────────────────────────────────────────────── */
.icp-dropzone {
  border: 2px dashed var(--icp-border);
  border-radius: var(--icp-radius);
  padding: 60px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s, background .25s;
  position: relative;
  overflow: hidden;
}
.icp-dropzone:hover,
.icp-dropzone.drag-over {
  border-color: var(--icp-accent);
  background: rgba(200,255,87,.04);
}
.icp-drop-inner { pointer-events: none; }

.icp-icon {
  width: 48px; height: 48px;
  stroke: var(--icp-accent);
  margin-bottom: 16px;
}
.icp-drop-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--icp-text);
  margin: 0 0 8px;
  line-height: 1.5;
}
.icp-drop-text span { color: var(--icp-accent); }
.icp-drop-hint {
  font-size: .72rem;
  color: var(--icp-muted);
  margin: 0;
  letter-spacing: .04em;
}

/* ── Stage ──────────────────────────────────────────────────── */
.icp-stage {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 640px) {
  .icp-stage { grid-template-columns: 1fr; }
}

.icp-canvas-wrap {
  position: relative;
  border-radius: var(--icp-radius);
  overflow: hidden;
  background: #000;
  cursor: crosshair;
  line-height: 0;
}

#icp-canvas {
  width: 100%;
  height: auto;
  display: block;
  max-height: 500px;
  object-fit: contain;
}

/* Loupe */
.icp-loupe {
  position: absolute;
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid var(--icp-accent);
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.8);
  transform: translate(-50%, calc(-100% - 14px));
  z-index: 10;
}
.icp-loupe canvas {
  width: 100%; height: 100%;
}

/* ── Panel ──────────────────────────────────────────────────── */
.icp-panel {
  background: var(--icp-surface);
  border: 1px solid var(--icp-border);
  border-radius: var(--icp-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.icp-swatch-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.icp-swatch {
  width: 64px; height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #333;
  border: 2px solid var(--icp-border);
  transition: background .12s;
}

.icp-codes { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.icp-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--icp-bg);
  border: 1px solid var(--icp-border);
  border-radius: var(--icp-radius-sm);
  padding: 6px 10px;
}
.icp-label {
  font-size: .65rem;
  font-weight: 500;
  color: var(--icp-accent);
  letter-spacing: .1em;
  width: 28px;
  flex-shrink: 0;
}
.icp-value {
  flex: 1;
  font-size: .78rem;
  color: var(--icp-text);
  font-family: 'DM Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icp-copy {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--icp-muted);
  transition: color .2s;
  display: flex;
  align-items: center;
}
.icp-copy svg { width: 14px; height: 14px; }
.icp-copy:hover { color: var(--icp-accent); }

/* History */
.icp-history-label {
  font-size: .65rem;
  letter-spacing: .1em;
  color: var(--icp-muted);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.icp-history {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 32px;
}
.icp-history-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  title: attr(data-hex);
}
.icp-history-dot:hover {
  transform: scale(1.2);
  border-color: #fff4;
}

/* Reset btn */
.icp-reset-btn {
  background: transparent;
  border: 1px solid var(--icp-border);
  border-radius: var(--icp-radius-sm);
  color: var(--icp-muted);
  font-family: 'DM Mono', monospace;
  font-size: .72rem;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  text-align: center;
}
.icp-reset-btn:hover {
  border-color: var(--icp-accent2);
  color: var(--icp-accent2);
}

/* Toast */
.icp-toast {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--icp-accent);
  color: #0f0f11;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  padding: 8px 22px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  letter-spacing: .06em;
}
.icp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
