/**
 * Theme Toggle - Style Next.js Moderne
 * Toggle élégant avec icônes soleil/lune
 */

.theme-toggle-container {
  position: fixed;
  top: var(--perennity-space-lg);
  right: var(--perennity-space-lg);
  z-index: var(--perennity-z-fixed);
}

/* Toggle Switch Style Next.js */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--perennity-neutral-200);
  border: 1px solid var(--perennity-border-subtle);
  border-radius: var(--perennity-radius-full);
  cursor: pointer;
  transition: all var(--perennity-transition-slow);
  padding: 2px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  opacity: 0.9;
}

.theme-toggle:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-color: var(--perennity-border);
  opacity: 1;
}

/* Toggle Thumb (Boule qui glisse) */
.theme-toggle-thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--perennity-bg-primary);
  border-radius: var(--perennity-radius-full);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all var(--perennity-transition-slow);
  display: flex;
  align-items: center;
  justify-content: center;
  left: 2px;
}

/* Icônes dans le thumb */
.theme-toggle-thumb svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.5;
  transition: all var(--perennity-transition-slow);
}

.theme-toggle-thumb .icon-sun {
  color: var(--perennity-accent);
  opacity: 1;
}

.theme-toggle-thumb .icon-moon {
  color: var(--perennity-accent-light);
  opacity: 0;
  position: absolute;
}

/* État Dark Mode */
[data-theme="dark"] .theme-toggle,
.dark-mode .theme-toggle {
  background: var(--perennity-primary);
  border-color: var(--perennity-border-subtle);
}

[data-theme="dark"] .theme-toggle-thumb,
.dark-mode .theme-toggle-thumb {
  transform: translateX(22px);
  background: var(--perennity-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-toggle-thumb .icon-sun,
.dark-mode .theme-toggle-thumb .icon-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle-thumb .icon-moon,
.dark-mode .theme-toggle-thumb .icon-moon {
  opacity: 1;
}

/* Animation smooth */
.theme-toggle-thumb {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus visible pour accessibilité */
.theme-toggle:focus-visible {
  outline: 2px solid var(--perennity-accent-light);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .theme-toggle-container {
    top: var(--perennity-space-md);
    right: var(--perennity-space-md);
  }
  
  .theme-toggle {
    width: 48px;
    height: 28px;
  }
  
  .theme-toggle-thumb {
    width: 22px;
    height: 22px;
  }
  
  .theme-toggle-thumb svg {
    width: 14px;
    height: 14px;
  }
  
  [data-theme="dark"] .theme-toggle-thumb,
  .dark-mode .theme-toggle-thumb {
    transform: translateX(20px);
  }
}

/* Animation au chargement */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.theme-toggle-container {
  animation: fadeInRight 0.4s var(--perennity-transition-normal) 0.2s both;
}

