/* ====================================================================
   MAGIC SPIN - LIVE CLIENT THEME SWITCHER
   ==================================================================== */

.theme-switcher-wrapper {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  font-family: var(--font-main, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

@media (max-width: 768px) {
  .theme-switcher-wrapper {
    bottom: 84px;
    right: 16px;
  }
}

/* Floating Trigger Button */
.theme-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(16, 16, 22, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--red-border);
  color: var(--white-primary);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-pill, 9999px);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75), var(--red-glow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.theme-switcher-btn:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--red-bright);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), var(--red-glow);
}

.theme-switcher-btn .btn-palette-icon {
  font-size: 1.15rem;
  display: inline-block;
  animation: themeIconPulse 2.5s ease-in-out infinite;
}

@keyframes themeIconPulse {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(15deg) scale(1.15); }
}

.theme-switcher-btn .btn-live-dot {
  width: 8px;
  height: 8px;
  background-color: var(--red-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red-bright);
  animation: liveDotBlink 1.5s infinite;
}

@keyframes liveDotBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Modal / Drawer Panel */
.theme-switcher-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 330px;
  max-width: calc(100vw - 32px);
  background: rgba(14, 14, 20, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg, 16px);
  padding: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), 0 0 35px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

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

.theme-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
}

.theme-panel-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--white-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.theme-panel-subtitle {
  font-size: 0.75rem;
  color: var(--gray-primary);
  margin-top: 0.2rem;
}

.theme-panel-close {
  background: transparent;
  border: none;
  color: var(--gray-primary);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: color 0.15s ease;
  line-height: 1;
}
.theme-panel-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.theme-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

/* Individual Theme Option Card */
.theme-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.theme-option-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--gray-secondary);
  transform: translateX(-2px);
}

.theme-option-card.active {
  background: var(--red-soft);
  border-color: var(--red-bright);
  box-shadow: 0 0 14px var(--red-border);
}

.theme-option-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.theme-color-preview-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.theme-meta-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.theme-meta-desc {
  font-size: 0.7rem;
  color: var(--gray-primary);
  margin-top: 0.15rem;
}

.theme-check-badge {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--red-bright);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
}

.theme-option-card.active .theme-check-badge {
  opacity: 1;
  transform: scale(1);
}

.theme-panel-footer {
  border-top: 1px solid var(--border-dark);
  padding-top: 0.85rem;
  font-size: 0.72rem;
  color: var(--gray-primary);
  line-height: 1.4;
}

.theme-panel-footer strong {
  color: var(--white-primary);
}
