/**
 * DysHelp - Styles Optimisés
 * Version orientée objet avec variables CSS
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
  /* Couleurs principales */
  --color-emerald: #10b981;
  --color-emerald-dark: #059669;
  --color-purple: #a855f7;
  --color-pink: #ec4899;
  --color-blue: #3b82f6;
  --color-amber: #f59e0b;
  
  /* Couleurs de fond */
  --bg-white: rgba(255, 255, 255, 0.9);
  --bg-glass: rgba(255, 255, 255, 0.66);
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Transitions */
  --transition-smooth: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  --transition-fast: all 0.3s ease;
}

/* ============================================
   POLICE GLOBALE
   ============================================ */
* {
  font-family: 'Comic Sans MS', cursive, sans-serif !important;
}

/* ============================================
   TRANSITIONS ET ANIMATIONS
   ============================================ */
.smooth {
  transition: var(--transition-smooth);
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  opacity: 0;
  transform: translateY(20px);
}

.card-hover {
  transition: var(--transition-fast);
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   ANIMATIONS DU FOND
   ============================================ */
@keyframes gradientShift {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-6%, -4%, 0) scale(1.06);
  }
}

.animate-gradient {
  animation: gradientShift 18s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-10px) scale(1.03);
  }
}

.animate-blob {
  animation: blobFloat 10s ease-in-out infinite;
}

.animate-blob-delayed {
  animation-delay: 2.5s;
}

.animate-blob-slow {
  animation-duration: 14s;
}

/* ============================================
   MESH DOTS
   ============================================ */
.mesh-dot {
  transition: transform 0.6s ease, opacity 0.6s ease;
  opacity: 0.45;
  will-change: transform, opacity;
}

.mesh-dot:hover {
  transform: scale(1.8);
  opacity: 0.95;
}

/* ============================================
   EFFETS VISUELS
   ============================================ */
.vignette {
  pointer-events: none;
  background: radial-gradient(
    1200px 600px at center,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.08) 100%
  );
}

.toggle-active {
  background: var(--bg-white);
  color: #111827;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-md);
}

/* ============================================
   CURSOR HALO
   ============================================ */
.cursor-halo {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    460px 300px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, var(--haloAlpha, 0.22)),
    transparent 60%
  );
  transition: background 0.12s ease;
  z-index: 2;
  will-change: background;
}

.cursor-flash {
  background: radial-gradient(
    560px 360px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.25),
    transparent 65%
  );
}

/* ============================================
   NAVIGATION ACTIVE
   ============================================ */
.nav-active {
  color: var(--color-emerald-dark) !important;
  font-weight: 700;
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-emerald);
  border-radius: 2px;
}

/* ============================================
   UTILITAIRES RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .card-hover:hover {
    transform: translateY(-2px);
  }
}

/* Optimisation des performances */
.will-change-transform {
  will-change: transform;
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible pour la navigation au clavier */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-emerald);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  /* Masquer les éléments décoratifs */
  #bg-root,
  .cursor-halo,
  .fixed {
    display: none !important;
  }
  
  /* Optimiser pour l'impression */
  body {
    background: white !important;
    color: black !important;
  }
  
  .bg-white {
    background: white !important;
  }
}
