/* -----------------------------------
   THEME TOGGLE BUTTON (INSIDE HEADER)
----------------------------------- */

#theme-toggle {
  position: fixed;
  top: 0.2rem;
  right: calc(50% - 550px + 300px); 
  /* 550px = half of your wrapper max-width (1100px) */
  
  z-index: 9999;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Tooltip */
#theme-toggle::after {
  content: "Toggle theme";
  position: absolute;
  top: -32px;
  right: 0;
  background: var(--card);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid rgba(0,0,0,0.1);
}

#theme-toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--accent);
}

@media (max-width: 1200px) {
  #theme-toggle {
    right: 20px;
  }
}