@use '../abstracts' as *;

// ============================================================
// Theme switcher — fixed at the right edge
// ============================================================

.theme-switcher {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 7px;
  border-radius: $pill-radius;
  background: var(--card);
  @include glass-blur(16px);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-soft);

  @include below(switcher) {
    top: auto;
    bottom: 16px;
    right: 50%;
    transform: translateX(50%);
    flex-direction: row;
    gap: 4px;
  }
}

.theme-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.28s ease, background 0.28s ease, transform 0.28s ease;

  &:hover {
    color: var(--accent-deep);
    background: var(--glass);
    transform: translateY(-1px);
  }

  &[aria-pressed="true"] {
    background: var(--btn-grad);
    color: var(--on-accent);
    box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45);
  }

  @include focus-ring;

  svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  // Tooltip
  &::after {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: var(--card-solid);
    border: 1px solid var(--hairline);
    color: var(--ink-soft);
    font-family: $font-sans;
    font-size: 12.5px;
    padding: 5px 12px;
    border-radius: $pill-radius;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;

    @include below(switcher) {
      display: none;
    }
  }

  &:hover::after { opacity: 1; }
}
