/* ==========================================================
   TixHub — Theme Toggle Widget
   theme-toggle.css
   Floating panel for switching between Current / Dark / Cream
   ========================================================== */

.tx-theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.tx-theme-toggle__trigger {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: var(--tx-card-bg);
  border: 1px solid var(--tx-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-size: 18px;
  padding: 0;
}

.tx-theme-toggle__trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.tx-theme-toggle__panel {
  position: absolute;
  bottom: 56px;
  right: 0;
  background: var(--tx-card-bg);
  border: 1px solid var(--tx-border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  padding: 14px;
  min-width: 240px;
  display: none;
}

.tx-theme-toggle.open .tx-theme-toggle__panel {
  display: block;
}

.tx-theme-toggle__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx-hint);
  margin-bottom: 10px;
  font-weight: 600;
}

.tx-theme-toggle__options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tx-theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--tx-text);
  text-align: left;
  width: 100%;
  transition: background-color 0.12s, border-color 0.12s;
}

.tx-theme-option:hover {
  background: var(--tx-dropdown-hover);
}

.tx-theme-option.active {
  border-color: var(--tx-coral);
  background: var(--tx-dropdown-hover);
}

.tx-theme-option__swatch {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tx-border);
}

/* Two-tone swatch: half page-bg, half accent */
.tx-theme-option__swatch::before,
.tx-theme-option__swatch::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
}
.tx-theme-option__swatch::before { left: 0; }
.tx-theme-option__swatch::after  { right: 0; }

.tx-theme-option[data-theme="default"] .tx-theme-option__swatch::before { background: #ECE5D8; }
.tx-theme-option[data-theme="default"] .tx-theme-option__swatch::after  { background: #D85A30; }

.tx-theme-option[data-theme="cool"] .tx-theme-option__swatch::before { background: #F1F2F4; }
.tx-theme-option[data-theme="cool"] .tx-theme-option__swatch::after  { background: #3D5A80; }

.tx-theme-option[data-theme="plum"] .tx-theme-option__swatch::before { background: #5B2333; }
.tx-theme-option[data-theme="plum"] .tx-theme-option__swatch::after  { background: #C9A227; }

.tx-theme-option[data-theme="dark"] .tx-theme-option__swatch::before { background: #111110; }
.tx-theme-option[data-theme="dark"] .tx-theme-option__swatch::after  { background: #E85540; }

.tx-theme-option__label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.tx-theme-option__name {
  font-weight: 500;
  font-size: 13px;
  color: var(--tx-text);
}
.tx-theme-option__desc {
  font-size: 11px;
  color: var(--tx-muted);
}

.tx-theme-option__check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--tx-coral);
  font-size: 14px;
  opacity: 0;
}
.tx-theme-option.active .tx-theme-option__check { opacity: 1; }

@media (max-width: 480px) {
  .tx-theme-toggle { bottom: 12px; right: 12px; }
  .tx-theme-toggle__panel { min-width: 220px; }
}
