/**
 * GoTryTech Theme Toggle & Persistence Styles
 * 
 * Feeling: Frontend Masters × Linear × Vercel Docs
 * Maps the sun and moon icon transitions and outlines the primary 
 * #gtt-theme-toggle interface utilizing design tokens.
 */

/* Theme Toggle Button Baseline */
#gtt-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background-color: var(--bg-glass-light);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-all);
  position: relative;
  overflow: hidden;
}

#gtt-theme-toggle:hover {
  background-color: var(--bg-glass);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow-sm), var(--glass-shadow);
  transform: scale(1.05);
}

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

/* Accessibility outline */
#gtt-theme-toggle:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 4px;
}

/* Icons inside the button */
#gtt-theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--duration-normal) var(--ease-bounce),
              opacity var(--duration-fast) var(--ease-out);
  position: absolute;
}

/* Toggle Sun/Moon SVGs state mapping */
#gtt-theme-toggle .gtt-theme-toggle__icon--light {
  transform: rotate(40deg);
  opacity: 0;
}
#gtt-theme-toggle .gtt-theme-toggle__icon--dark {
  transform: rotate(-40deg);
  opacity: 0;
}

/* Display Moon when data-theme is Light (pressing switches to Dark) */
[data-theme="light"] #gtt-theme-toggle .gtt-theme-toggle__icon--dark {
  transform: rotate(0deg);
  opacity: 1;
}

/* Display Sun when data-theme is Dark (pressing switches to Light) */
[data-theme="dark"] #gtt-theme-toggle .gtt-theme-toggle__icon--light {
  transform: rotate(0deg);
  opacity: 1;
}

/* Disable body transition temporarily on page init (avoiding loading transitions flash) */
.gtt-no-transition * {
  transition: none !important;
}
