/**
 * theme-panel.css — Shared ThemeSelector + ScrollToTop Styles
 * ─────────────────────────────────────────────────────────────
 * Single source of truth for the theme settings panel visual design.
 * All rules use CSS custom properties so they adapt to each template's theme.
 * Load this file in every template's <head> before main.css.
 *
 * Class contract (defined in shared/ui-components.js):
 *   .theme-gear / .theme-gear.open
 *   .theme-panel / .theme-panel-title / .theme-panel-subtitle / .theme-panel-hint
 *   .theme-tabs / .theme-tab / .theme-tab.active
 *   .theme-colors / .theme-swatch / .theme-swatch.active
 *   .theme-swatch-dot / .theme-swatch-label / .theme-swatch-check
 *   .theme-fonts / .theme-font-group / .theme-font-label
 *   .theme-font-btn / .theme-font-btn.active / .theme-font-check
 *   .theme-reset-btn
 *   .scroll-top-btn
 */

/* ── Gear Button ─────────────────────────────────────────── */
.theme-gear {
  position: fixed;
  bottom: 32px;
  left: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card, #171717);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--accent, #ffb81c);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.4s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
}
.theme-gear:hover {
  transform: rotate(90deg) scale(1.1);
}
.theme-gear.open {
  font-size: 24px;
  transform: scale(1.05);
}

/* ── Panel ───────────────────────────────────────────────── */
.theme-panel {
  position: fixed;
  bottom: 92px;
  left: 32px;
  width: 300px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-card, #171717);
  border: 1px solid var(--border-hover, rgba(255,255,255,0.18));
  border-radius: var(--radius, 12px);
  padding: 24px;
  z-index: 9998;
  animation: themePanelIn 0.3s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
}
@keyframes themePanelIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.theme-panel::-webkit-scrollbar { width: 4px; }
.theme-panel::-webkit-scrollbar-track { background: transparent; }
.theme-panel::-webkit-scrollbar-thumb { background: var(--border-hover, rgba(255,255,255,0.18)); border-radius: 4px; }

/* ── Panel Header ────────────────────────────────────────── */
.theme-panel-title {
  font-family: var(--font-display, sans-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #f5f5f5);
  margin-bottom: 4px;
}
.theme-panel-subtitle {
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  color: var(--text-muted, rgba(255,255,255,0.4));
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.theme-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
}
.theme-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary, rgba(255,255,255,0.55));
  font-family: var(--font-body, sans-serif);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: -1px;
}
.theme-tab.active {
  border-bottom-color: var(--accent, #ffb81c);
  color: var(--accent, #ffb81c);
}

/* ── Color Swatches ──────────────────────────────────────── */
.theme-colors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.theme-swatch {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.3s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
  text-align: left;
  width: 100%;
}
.theme-swatch:hover,
.theme-swatch.active {
  background: var(--bg-elevated, var(--accent-subtle, rgba(255,255,255,0.05)));
  border-color: var(--border-hover, rgba(255,255,255,0.18));
  transform: translateX(4px);
}
.theme-swatch-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.theme-swatch-label {
  font-family: var(--font-body, sans-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #f5f5f5);
  flex: 1;
}
.theme-swatch.active .theme-swatch-label {
  color: var(--accent, #ffb81c);
}
.theme-swatch-check {
  color: var(--accent, #ffb81c);
  font-size: 14px;
}

/* ── Font Pickers ────────────────────────────────────────── */
.theme-fonts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.theme-font-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-font-label {
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, rgba(255,255,255,0.4));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.theme-font-btn {
  padding: 9px 14px;
  background: transparent;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.3s;
  text-align: left;
  color: var(--text, #f5f5f5);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.theme-font-btn:hover,
.theme-font-btn.active {
  background: var(--bg-elevated, var(--accent-subtle, rgba(255,255,255,0.05)));
  border-color: var(--border-hover, rgba(255,255,255,0.18));
}
.theme-font-btn.active {
  color: var(--accent, #ffb81c);
}
.theme-font-check {
  font-size: 13px;
  color: var(--accent, #ffb81c);
}

/* ── Reset Button ────────────────────────────────────────── */
.theme-reset-btn {
  width: 100%;
  padding: 12px;
  margin: 16px 0 8px;
  background: var(--bg-elevated, var(--accent-subtle, rgba(255,255,255,0.05)));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: var(--radius-btn, 8px);
  color: var(--text-secondary, rgba(255,255,255,0.55));
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
}
.theme-reset-btn:hover {
  background: var(--accent-subtle, rgba(255,184,28,0.05));
  border-color: var(--accent, #ffb81c);
  color: var(--accent, #ffb81c);
  transform: translateY(-2px);
}

/* ── Hint ────────────────────────────────────────────────── */
.theme-panel-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.1));
  font-family: var(--font-body, sans-serif);
  font-size: 11px;
  color: var(--text-muted, rgba(255,255,255,0.4));
  text-align: center;
  letter-spacing: 0.05em;
}

/* ── Dark Mode Toggle ────────────────────────────────────── */
.dark-mode-toggle {
  position: fixed;
  bottom: 32px;
  left: 92px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card, #171717);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--accent, #ffb81c);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: all 0.3s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
}
.dark-mode-toggle:hover {
  transform: scale(1.1);
  border-color: var(--accent, #ffb81c);
}

/* ── Scroll To Top ───────────────────────────────────────── */
.scroll-top-btn {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card, #171717);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--accent, #ffb81c);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.4s var(--ease-out, cubic-bezier(0.25,0.46,0.45,0.94));
}
.scroll-top-btn:hover {
  transform: translateY(-4px) scale(1.1);
}
