/* ============================================
   Shared Theme Toggle Button
   Scope: All pages — floating day/night switch
   ============================================ */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-raised, #171d28);
  border: 1px solid var(--border, #1e2736);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 300;
  transition: border-color 0.25s ease, transform 0.2s ease, background 0.25s ease;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent, #22d3ee);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

/* Sun icon (shown in dark mode — click to go light) */
.theme-toggle .icon-sun {
  color: #fbbf24;
  display: block;
}

.theme-toggle .icon-moon {
  color: var(--accent, #22d3ee);
  display: none;
}

/* In light mode — show moon icon (click to go dark) */
.theme-toggle[data-theme='light'] .icon-sun {
  display: none;
}

.theme-toggle[data-theme='light'] .icon-moon {
  display: block;
}

/* Light-mode button appearance */
[data-theme='light'] .theme-toggle {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .theme-toggle:hover {
  border-color: var(--accent, #0891b2);
}

/* ===== Responsive adjustments ===== */
@media (max-width: 480px) {
  .theme-toggle {
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
  }

  .theme-toggle svg {
    width: 16px;
    height: 16px;
  }
}
