/* ==============================================
   theme-toggle.css — QuickTypeTest
   Fixed floating button, top-right on every page
   ============================================== */

/* ── Global theme tokens ─────────────────────── */
:root {
  --bg:           #f9f8f5;
  --bg-card:      #ffffff;
  --bg-subtle:    #f0efe9;
  --text:         #1c1b18;
  --text-muted:   #6b6860;
  --border:       #e4e2db;
  --accent:       #e8501a;
  --accent-soft:  #fdeee8;
  --heading:      #111009;
  --shadow-sm:    0 1px 6px rgba(0,0,0,0.07);
  --shadow:       0 4px 20px rgba(0,0,0,0.10);
  --radius:       10px;
}

[data-theme="dark"] {
  --bg:           #121210;
  --bg-card:      #1c1b18;
  --bg-subtle:    #252420;
  --text:         #e8e6df;
  --text-muted:   #9e9b91;
  --border:       #2e2d29;
  --accent:       #ff6b35;
  --accent-soft:  #2a1a12;
  --heading:      #f5f3ec;
  --shadow-sm:    0 1px 6px rgba(0,0,0,0.30);
  --shadow:       0 4px 20px rgba(0,0,0,0.40);
}

body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}

/* ── Fixed floating toggle ─────────────────────
   Paste this once inside <body> on every page:

   <button class="theme-fab" id="themeFab"
     onclick="toggleTheme()" aria-label="Toggle theme"
     data-tooltip="Dark mode">
     <span class="tt-icon">🌙</span>
   </button>
   ──────────────────────────────────────────── */
.theme-fab {
  position: absolute;
  top: 114px;
  right: 18px;
  z-index: 9999;

  width: 40px;
  height: 40px;
  border-radius: 50%;

  background: var(--bg-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);

  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;

  cursor: pointer;
  transition: transform 0.2s ease,
              box-shadow 0.2s ease,
              border-color 0.2s ease;
}

.theme-fab:hover {
  transform: scale(1.12) rotate(18deg);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}

.theme-fab:active { transform: scale(0.94); }

/* Tooltip */
.theme-fab::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--heading);
  color: var(--bg);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.theme-fab:hover::after { opacity: 1; }
