.theme-control {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.theme-control__slider {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-control__ring {
  position: relative;
  width: 36px;
  height: 36px;
  cursor: pointer;
  outline: none;
  border-radius: 50%;
}

.theme-control__ring:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.theme-control__ring-svg {
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-control__ring:hover .theme-control__ring-svg,
.theme-control.is-dragging .theme-control__ring-svg {
  transform: scale(1.08);
  filter: drop-shadow(0 0 4px var(--text-muted));
}

.theme-control__trail {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.theme-control__trail-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  margin: -1.5px 0 0 -1.5px;
  transition: opacity 0.3s ease-out;
}

.theme-control__indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--text-primary);
  border-radius: 50%;
  margin: -2px 0 0 -2px;
  pointer-events: none;
  transition: transform 0.05s linear;
  box-shadow: 0 0 0 1px var(--bg);
}

.theme-control.is-dragging .theme-control__indicator {
  transform-origin: center;
  box-shadow: 0 0 6px var(--text-primary), 0 0 0 1px var(--bg);
}

.theme-control.is-releasing .theme-control__ring-svg {
  animation: ring-pulse 0.2s ease-out;
}

@keyframes ring-pulse {
  0% { transform: scale(1.08); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.theme-control__ring-svg {
  animation: idle-pulse 4s ease-in-out infinite;
}

@keyframes idle-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.theme-control:hover .theme-control__ring-svg {
  animation: none;
  opacity: 1;
}

.theme-control__modes {
  display: flex;
  gap: 2px;
  background: var(--link-bg);
  padding: 2px;
  border-radius: 2px;
}

.theme-control__mode-btn {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 8px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  border-radius: 1px;
  transition: color 0.15s ease,
              background-color 0.15s ease,
              transform 0.1s ease;
  outline: none;
}

.theme-control__mode-btn:hover {
  color: var(--text-primary);
}

.theme-control__mode-btn:focus-visible {
  box-shadow: 0 0 0 1px var(--accent);
}

.theme-control__mode-btn.is-active {
  color: var(--text-primary);
  background: var(--bg);
}

.theme-control__mode-btn:active {
  transform: scale(0.92);
}

@media (prefers-reduced-motion: reduce) {
  .theme-control__ring-svg {
    animation: none;
  }
  
  .theme-control__trail-dot {
    display: none;
  }
  
  .theme-control.is-releasing .theme-control__ring-svg {
    animation: none;
  }
}

@media (max-width: 480px) {
  .theme-control {
    bottom: 12px;
    right: 12px;
  }
}
