/* ============================================================================
   STYLE.CSS — Optimisé et organisé
   - Variables CSS pour cohérence
   - Code mort supprimé
   - Préfixes vendor unifiés
   - Performance améliorée
============================================================================ */

/* =================== */
/*      VARIABLES      */
/* =================== */
:root {
  /* Couleurs */
  --color-primary: #16a34a;
  --color-primary-dark: #15803d;
  --color-secondary: #5f8474;
  --color-gray-300: #d1d5db;
  --color-gray-900: #111827;
  --color-white: #ffffff;

  /* Transitions */
  --transition-base: 0.2s cubic-bezier(0.2, 0.65, 0.3, 1);
  --transition-slow: 1.5s cubic-bezier(0.2, 0.65, 0.3, 1);

  /* Espacements */
  --spacing-dot: 8px;
  --spacing-pagination: 1rem;

  /* Color scheme */
  color-scheme: light;
}

/* =================== */
/*      BASE RESET     */
/* =================== */
html,
body {
  overflow-x: hidden;
  background-color: var(--color-white);
  color: #111111;
}

html {
  forced-color-adjust: none;
  scroll-behavior: smooth; /* ✅ Ajout pour smooth scroll natif */
}

/* =================== */
/*     HERO SLIDER     */
/* =================== */
.slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow);
  will-change: opacity;
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.slide[data-cover] {
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* États initiaux avant animation GSAP */
.slide .content h1,
.slide .content h2,
.slide .content p,
.slide .content a {
  opacity: 0;
  transition: none;
}

.slide .overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.slide.active .overlay {
  opacity: 0.5;
}

/* Utilitaires de fondu */
.fade-transition {
  transition: opacity var(--transition-base);
  opacity: 1;
}

.fade-out {
  opacity: 0;
}

/* =================== */
/*   DOTS NAVIGATION   */
/* =================== */
.dot {
  width: 16px;
  height: 8px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  user-select: none;
}

.dot:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.5);
  transform: scaleY(1.2);
}

.dot.active {
  width: 32px;
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(22, 163, 74, 0.6);
}

.dot.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.4) 0%,
    rgba(255, 255, 255, 0) 100%
  );
}

.dot.active::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150%;
  height: 400%;
  border-radius: 2px;
  border: 1px solid rgba(22, 163, 74, 0.4);
  pointer-events: none;
}

.dot:focus-visible {
  outline: 2px solid rgba(22, 163, 74, 0.6);
  outline-offset: 3px;
}

/* =================== */
/*   NAV ACTIVE STATE  */
/* =================== */

#navbar nav a.active {
  color: var(--color-primary);
}

#navbar nav a.active::after {
  width: 100%;
}

/* Transition douce pour les liens de nav */
#navbar nav a {
  transition:
    color 1s ease,
    text-decoration-color 1s ease;
}

/* =================== */
/*   CONTROLS & UTILS  */
/* =================== */
#prev,
#next,
.dot,
button {
  user-select: none;
}
/* Etat de base */
#navbar a[href="#contact"] {
  position: relative;
  box-shadow:
    0 0 0 0 rgba(22, 163, 74, 0),
    0 0 0 rgba(22, 163, 74, 0);
  transform: scale(1);
}

/* Etat avec glow animé */
#navbar a.kit-essai-cta-glow {
  animation: kit-essaiGlow 2.5s ease-in-out infinite;
}

/* Etat de sortie douce */
#navbar a.kit-essai-cta-smooth {
  transition:
    box-shadow 0.5s ease,
    transform 0.5s ease;
  box-shadow:
    0 0 0 0 rgba(22, 163, 74, 0),
    0 0 0 rgba(22, 163, 74, 0);
  transform: scale(1);
}

@keyframes kit-essaiGlow {
  0% {
    box-shadow:
      0 0 0 0 rgba(22, 163, 74, 0.6),
      0 0 12px rgba(22, 163, 74, 0.8);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 12px rgba(22, 163, 74, 0),
      0 0 24px rgba(22, 163, 74, 0.9);
    transform: scale(1.03);
  }
  100% {
    box-shadow:
      0 0 0 0 rgba(22, 163, 74, 0.6),
      0 0 12px rgba(22, 163, 74, 0.8);
    transform: scale(1);
  }
}

/* =================== */
/*   LANG SWITCH MENU  */
/* =================== */
#navbar.nav-visible #language-button {
  opacity: 1;
  pointer-events: auto;
}

#language-menu {
  opacity: 0;
  transform: translate(-50%, 0) scale(0.95);
  pointer-events: none;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

#language-menu.open {
  opacity: 1 !important;
  transform: translate(-50%, 0) scale(1) !important;
  pointer-events: auto !important;
}

/* =================== */
/*   RTL / LTR HELPERS */
/* =================== */
.ltr-fragment {
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
  display: inline-block;
}

.bidi-auto {
  unicode-bidi: plaintext;
}

.contact-line {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

[dir="rtl"] .contact-line {
  flex-direction: row-reverse;
}

.socials {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

[dir="rtl"] .socials {
  flex-direction: row-reverse;
}

.footer-col {
  text-align: start;
}

.footer-links a {
  display: inline-block;
  padding-block: 0.25rem;
}

/* Inversion des chevrons en RTL */
[dir="rtl"] #prev i,
[dir="rtl"] #next i {
  transform: scaleX(-1);
}

/* =================== */
/*     ANIMATIONS      */
/* =================== */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

@keyframes rotate-orbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Classes d'animation */
.hero-title {
  background-size: 200% auto;
  animation: gradient-shift 8s ease infinite;
}

.orbit {
  transform: translate(-50%, -50%);
  animation: rotate-orbit 20s linear infinite;
}

.orbit-2 {
  animation-duration: 30s;
  animation-direction: reverse;
}

/* =================== */
/*   3D EFFECTS        */
/* =================== */
.image-frame,
.problem-card,
.solution-card {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* =================== */
/*   CUSTOM SCROLLBAR  */
/* =================== */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #1f1f1f;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--color-secondary),
    var(--color-primary)
  );
  border-radius: 8px;
  border: 3px solid #f0f0f0;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--color-secondary),
    var(--color-primary-dark)
  );
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-secondary) #1f1f1f;
}

/* =================== */
/*   ACCESSIBILITY     */
/* =================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* =================== */
/*   RESPONSIVE        */
/* =================== */
@media (max-width: 640px) {
  :root {
    --spacing-dot: 6px;
    --spacing-pagination: 1.25rem;
  }

  .dot {
    width: 12px;
    height: 3px;
  }

  .dot.active {
    width: 24px;
  }

  .slide .content {
    transform: translateY(14px);
  }
}

@media (max-width: 402px) {
  .hide-below-402 {
    display: none;
  }
}

/* =================== */
/*   UTILITY CLASSES   */
/* =================== */
.clients-track {
  margin-right: 4rem;
  align-items: center;
  padding-block: 1rem;
}

.bg-white\/70 {
  backdrop-filter: blur(20px) saturate(180%);
}

.footer-link {
  position: relative;
  color: #ffffff;
}
