/* theme-toggle.css - Styles pour le système de thème sombre/clair */

/* Variables CSS pour les thèmes */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

/* Transitions fluides pour le changement de thème */
* {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Styles pour les boutons de thème */
.theme-toggle-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

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

.theme-toggle-btn i {
  font-size: 1.25rem;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.theme-toggle-btn:hover i {
  color: var(--text-secondary);
}

/* Animation de rotation pour l'icône */
.theme-icon-rotate {
  animation: themeRotate 0.2s ease-in-out;
}

@keyframes themeRotate {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(90deg);
  }
  100% {
    transform: rotate(180deg);
  }
}

/* Styles pour les éléments qui changent avec le thème */
.theme-transition {
  transition: all 0.3s ease;
}

/* Fond d'écran qui s'adapte au thème */
.theme-bg {
  background-color: var(--bg-primary);
}

.theme-bg-secondary {
  background-color: var(--bg-secondary);
}

.theme-bg-tertiary {
  background-color: var(--bg-tertiary);
}

/* Texte qui s'adapte au thème */
.theme-text {
  color: var(--text-primary);
}

.theme-text-secondary {
  color: var(--text-secondary);
}

.theme-text-muted {
  color: var(--text-muted);
}

/* Bordures qui s'adaptent au thème */
.theme-border {
  border-color: var(--border-color);
}

/* Ombres qui s'adaptent au thème */
.theme-shadow {
  box-shadow: var(--shadow);
}

.theme-shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* Styles spécifiques pour les cartes */
.theme-card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}

/* Styles pour les inputs */
.theme-input {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.theme-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.theme-input::placeholder {
  color: var(--text-muted);
}

/* Styles pour les boutons */
.theme-btn-primary {
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.theme-btn-primary:active {
  transform: translateY(0);
}

/* Animation d'entrée pour les éléments de thème */
@keyframes themeFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme-fade-in {
  animation: themeFadeIn 0.3s ease-out;
}

/* Indicateur de chargement du thème */
.theme-loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: none;
}

.theme-loading.show {
  display: block;
}

/* Préférences utilisateur */
@media (prefers-color-scheme: dark) {
  .theme-auto {
    color-scheme: dark;
  }
}

@media (prefers-color-scheme: light) {
  .theme-auto {
    color-scheme: light;
  }
}

/* Support pour les navigateurs plus anciens */
@supports not (color-scheme: dark) {
  .theme-auto {
    /* Fallback pour les anciens navigateurs - aucune règle spécifique nécessaire */
  }
}
