/**
 * 42AI Hue Picker — theme palette CSS
 *
 * Defines 3 gradient stops (--hue-1, --hue-2, --hue-3) per theme.
 * Default = "belief" (matches the platform's belief manifold colors).
 * Three additional themes available via .hue-{name} class on <html>.
 *
 * Any page-level CSS can use these vars in gradients and they'll
 * swap live when the user picks a theme.
 *
 * REVERSAL: delete the <link rel="stylesheet" href="/hue-picker.css">
 * tag in index.html (and the <script src="/hue-picker.js"></script>
 * line below it). Existing CSS that uses --belief-* vars stays intact.
 */

:root {
  /* Default = Belief (red → yellow → green) */
  --hue-1: #dc2626;
  --hue-2: #ca8a04;
  --hue-3: #16a34a;
}
html.hue-sunset {
  --hue-1: #db2777;
  --hue-2: #f59e0b;
  --hue-3: #facc15;
}
html.hue-iridescent {
  --hue-1: #7c3aed;
  --hue-2: #ec4899;
  --hue-3: #06b6d4;
}
html.hue-sunrise {
  --hue-1: #818cf8;
  --hue-2: #fb7185;
  --hue-3: #fbbf24;
}

/* ─── Picker button (round swatch) ─── */
.hue-picker-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.hue-picker-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--hue-1), var(--hue-2), var(--hue-3));
  border: 1px solid rgba(0,0,0,0.06);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.08);
  transition: background 0.3s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.hue-picker-btn:hover {
  transform: scale(1.08);
}

/* ─── Dropdown menu ─── */
.hue-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 4px;
  width: 138px;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.14), 0 3px 8px -3px rgba(0,0,0,0.06);
  display: none;
  flex-direction: column;
  gap: 1px;
  z-index: 300;
}
.hue-picker-menu.open { display: flex; }

.hue-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  color: #0a0a0a;
  text-align: left;
}
.hue-opt:hover { background: #f0f0f0; }
.hue-opt.active {
  background: #f0f0f0;
  font-weight: 500;
}
.hue-opt.active::after {
  content: '✓';
  margin-left: auto;
  color: #555;
  font-size: 11px;
}
.hue-opt-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 1px 2px rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.hue-opt[data-hue="belief"]      .hue-opt-swatch { background: linear-gradient(135deg, #dc2626, #ca8a04, #16a34a); }
.hue-opt[data-hue="sunset"]      .hue-opt-swatch { background: linear-gradient(135deg, #db2777, #f59e0b, #facc15); }
.hue-opt[data-hue="iridescent"]  .hue-opt-swatch { background: linear-gradient(135deg, #7c3aed, #ec4899, #06b6d4); }
.hue-opt[data-hue="sunrise"]     .hue-opt-swatch { background: linear-gradient(135deg, #818cf8, #fb7185, #fbbf24); }
