/* ============================================================
   THEME SWITCHER — Floating bottom-left palette picker
   Mirrors the CMF pattern. Uses CSS vars so the switcher itself
   re-themes when the user picks a new theme.
   ============================================================ */

.theme-switcher {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.theme-switcher-toggle {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--btn-radius);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  transition: border-color 0.15s, color 0.15s;
}
.theme-switcher-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

.theme-panel {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--card-radius);
  padding: 0.6rem;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  min-width: 220px;
}
.theme-panel.open { display: flex; }

.theme-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.theme-option:hover { background: var(--bg-raised); }
.theme-option.active {
  border-color: var(--accent);
  background: var(--bg-raised);
}

.theme-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.swatch-a {
  background:
    linear-gradient(135deg, #fcc419 0%, #fcc419 50%, #d63031 50%, #d63031 100%);
}
.swatch-b {
  background:
    linear-gradient(135deg, #e63946 0%, #e63946 50%, #f4a261 50%, #f4a261 100%);
}
.swatch-c {
  background:
    repeating-linear-gradient(
      135deg,
      #ef233c 0,
      #ef233c 8px,
      #ffc93c 8px,
      #ffc93c 16px
    );
}
.swatch-d {
  background:
    linear-gradient(135deg, #b8312f 0%, #b8312f 50%, #f2c94c 50%, #f2c94c 100%);
}

.theme-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}
.theme-option-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-transform: uppercase;
}
.theme-option-vibe {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.theme-option.active .theme-option-name { color: var(--accent); }

.theme-key {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}
.theme-option.active .theme-key { color: var(--accent); }
