/* theme-switcher.css — the footer star + hover panel.
   Sits at the very end of the footer row. Colors ride the base theme
   variables (both color modes, every theme); the star itself tints with the
   ACTIVE theme's accent via the data-active-theme attribute set by the JS. */

.theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* --- the star --- */
.ts-star {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  line-height: 0;
  color: var(--c-muted);
  transition: color 0.2s ease, transform 0.35s ease;
}

.ts-star:hover,
.theme-switcher.is-open .ts-star {
  color: var(--c-accent);
  transform: rotate(72deg) scale(1.12);
}

.ts-star-icon {
  width: 17px;
  height: 17px;
}

/* mask glyph (same system as the base theme's .popup-icon) */
.popup-icon--star {
  --popup-icon-url: url('/barataria/media/icons/star-fill.svg');
  --popup-icon-color: currentColor;
}

/* --- the panel --- */
.ts-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 236px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 2000;

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.theme-switcher.is-open .ts-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* little caret pointing at the star */
.ts-panel::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 14px;
  border: 6px solid transparent;
  border-top-color: var(--c-border-strong);
}

.ts-head {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-muted);
  padding: 8px 10px 6px;
}

.ts-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--c-text);
  font-size: 13px;
  text-align: left;
  transition: background 0.15s ease;
}

.ts-row:hover {
  background: var(--c-surface-2);
}

.ts-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.ts-label {
  flex: 1;
  min-width: 0;
}

.ts-check {
  opacity: 0;
  color: var(--c-accent);
  font-weight: 700;
  transition: opacity 0.15s ease;
}

.ts-row.is-active .ts-check { opacity: 1; }

/* Keyboard access: opening via tab shows the panel too. */
.theme-switcher:focus-within .ts-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .ts-star, .ts-panel, .ts-row, .ts-check { transition: none; }
}
