/* theme.css — multi-agents.site theme picker
   Drop in AFTER the page's main stylesheet. Provides:
   - 5 colorful palettes (Aurora default, Sunset, Ocean, Confetti, Sakura)
   - the fixed/inline theme picker button + dropdown
   Page-specific CSS can keep its own design; theme.css just overrides the
   shared vars so any palette-sensitive code (--accent, --bg, --ink ...) changes too.
*/

:root {
  /* === Aurora: 五彩斑斓 deep-night multi-color === */
  --bg: #0e0a26;
  --bg-card: #1a1138;
  --bg-elev: #261650;
  --ink: #fef9c3;
  --ink-soft: #c7b8e8;
  --ink-mute: #8a7ca8;
  --accent: #f472b6;          /* hot pink — primary */
  --accent-2: #c084fc;        /* lavender */
  --accent-3: #60a5fa;        /* sky blue */
  --accent-4: #fbbf24;        /* warm gold */
  --accent-soft: rgba(244, 114, 182, 0.18);
  --accent-faint: rgba(244, 114, 182, 0.08);
  --rule: #2a1f4d;
  /* rgb triplets for any rgba()-based usage */
  --accent-rgb: 244, 114, 182;
  --accent-2-rgb: 192, 132, 252;
  --accent-3-rgb: 96, 165, 250;
  --accent-4-rgb: 251, 191, 36;
}

:root[data-theme="sunset"] {
  --bg: #1f0d1a;
  --bg-card: #2d1224;
  --bg-elev: #3d182e;
  --ink: #fef3c7;
  --ink-soft: #fbcfe8;
  --ink-mute: #a88898;
  --accent: #fb923c;          /* orange */
  --accent-2: #f43f5e;        /* rose */
  --accent-3: #facc15;        /* yellow */
  --accent-4: #ec4899;        /* pink */
  --accent-soft: rgba(251, 146, 60, 0.20);
  --accent-faint: rgba(251, 146, 60, 0.08);
  --rule: #3d1f2d;
  --accent-rgb: 251, 146, 60;
  --accent-2-rgb: 244, 63, 94;
  --accent-3-rgb: 250, 204, 21;
  --accent-4-rgb: 236, 72, 153;
}

:root[data-theme="ocean"] {
  --bg: #082234;
  --bg-card: #0e2e44;
  --bg-elev: #143a55;
  --ink: #e0f7fa;
  --ink-soft: #94d3e0;
  --ink-mute: #6b8da0;
  --accent: #22d3ee;          /* cyan */
  --accent-2: #2dd4bf;        /* teal */
  --accent-3: #818cf8;        /* indigo */
  --accent-4: #facc15;        /* warm yellow */
  --accent-soft: rgba(34, 211, 238, 0.20);
  --accent-faint: rgba(34, 211, 238, 0.08);
  --rule: #1a3a52;
  --accent-rgb: 34, 211, 238;
  --accent-2-rgb: 45, 212, 191;
  --accent-3-rgb: 129, 140, 248;
  --accent-4-rgb: 250, 204, 21;
}

:root[data-theme="confetti"] {
  /* light paper background — multi-color accents pop on white */
  --bg: #fff8ee;
  --bg-card: #ffffff;
  --bg-elev: #f1ecdf;
  --ink: #1e1b4b;
  --ink-soft: #475569;
  --ink-mute: #94a3b8;
  --accent: #ec4899;          /* pink */
  --accent-2: #8b5cf6;        /* purple */
  --accent-3: #06b6d4;        /* cyan */
  --accent-4: #f59e0b;        /* amber */
  --accent-soft: rgba(236, 72, 153, 0.12);
  --accent-faint: rgba(236, 72, 153, 0.05);
  --rule: #e2e8f0;
  --accent-rgb: 236, 72, 153;
  --accent-2-rgb: 139, 92, 246;
  --accent-3-rgb: 6, 182, 212;
  --accent-4-rgb: 245, 158, 11;
}

:root[data-theme="sakura"] {
  --bg: #1a0e22;
  --bg-card: #271538;
  --bg-elev: #341c4a;
  --ink: #fce7f3;
  --ink-soft: #f5d0e8;
  --ink-mute: #a88898;
  --accent: #f472b6;          /* pink */
  --accent-2: #c084fc;        /* lavender */
  --accent-3: #fb7185;        /* rose */
  --accent-4: #fda4af;        /* peach */
  --accent-soft: rgba(244, 114, 182, 0.20);
  --accent-faint: rgba(244, 114, 182, 0.08);
  --rule: #3b1f4d;
  --accent-rgb: 244, 114, 182;
  --accent-2-rgb: 192, 132, 252;
  --accent-3-rgb: 251, 113, 133;
  --accent-4-rgb: 253, 164, 175;
}

/* === Theme picker UI ===
   - `.theme-picker.fixed` floats top-right (for pages without topbar nav)
   - `.theme-picker.inline` sits inside a header next to other nav elements */
.theme-picker {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  position: relative;
  z-index: 1000;
}
.theme-picker.fixed {
  position: fixed;
  top: 14px;
  right: 14px;
}
@media (max-width: 640px) {
  .theme-picker.fixed { top: 10px; right: 10px; }
}

.theme-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
  font-family: inherit;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.theme-picker-btn:hover {
  border-color: var(--accent);
  background: var(--bg-elev, var(--bg-card));
}
.theme-picker-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.theme-picker-btn:active { transform: translateY(1px); }

.theme-picker-btn .swatches {
  display: inline-flex;
  gap: 3px;
}
.theme-picker-btn .swatches i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2) inset;
}
.theme-picker-btn .label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-picker-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: ui-sans-serif, system-ui, -apple-system, sans-serif;
}
.theme-picker-menu[hidden] { display: none; }

.theme-picker-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.theme-picker-menu button:hover {
  background: var(--accent-soft);
  color: var(--ink);
}
.theme-picker-menu button[aria-current="true"] {
  background: var(--accent-soft);
  color: var(--ink);
}
.theme-picker-menu button .label { flex: 1; font-weight: 500; }
.theme-picker-menu button .name { color: inherit; font-weight: 600; }
.theme-picker-menu button .desc {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-top: 1px;
  font-weight: 400;
}
.theme-picker-menu button .swatches {
  display: inline-flex;
  gap: 3px;
  flex-shrink: 0;
}
.theme-picker-menu button .swatches i {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25) inset;
}