/* =====================================================
   VTECHGROUP - ANIMATIONS UI/UX
   Toutes les animations sont désactivées automatiquement
   pour les visiteurs qui ont choisi « réduire les animations ».
   ===================================================== */

/* ---------- Barre de progression de lecture ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 4px;
  z-index: 1200;
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b96ff, #FFD321);
  transform-origin: left center;
  transform: scaleX(0);
}

/* ---------- Barre de navigation ---------- */
.custom-navbar { transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease; }
@media (min-width: 768px) {
  .custom-navbar.top-nav-collapse {
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  }
}
.custom-navbar .nav li a { position: relative; }
.custom-navbar .nav li a::after {
  content: '';
  position: absolute;
  left: 20px; right: 20px; bottom: 8px;
  height: 3px;
  background: #3b96ff;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.custom-navbar .nav li a:hover::after { transform: scaleX(1); }

/* ---------- Diaporama d'accueil ---------- */
.hero-slider .slide { background-image: none; }
.hero-slider .slide::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1);
  will-change: transform;
}
.hero-slider .slide:nth-child(1)::before { background-image: url('../images/home.jpg'); }
.hero-slider .slide:nth-child(2)::before { background-image: url('../images/home2.jpg'); }
.hero-slider .slide:nth-child(3)::before { background-image: url('../images/home3.jpg'); }
.hero-slider .slide.active::before { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}
.hero-slider .slide .content { position: relative; z-index: 1; }
.hero-slider .slide.active .hero-kicker { animation: heroIn 0.8s 0.25s cubic-bezier(.2,.7,.2,1) both; }
.hero-slider .slide.active .heading     { animation: heroIn 0.8s 0.5s  cubic-bezier(.2,.7,.2,1) both; }
.hero-slider .slide.active .btn         { animation: heroIn 0.8s 0.75s cubic-bezier(.2,.7,.2,1) both; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* réseau de points lumineux (canvas) */
.hero-network {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* indicateurs du diaporama */
.hero-dots {
  position: absolute;
  left: 0; right: 0; bottom: 36px;
  z-index: 4;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.hero-dots button {
  position: relative;
  width: 14px; height: 14px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: hidden;
  transition: width 0.4s ease, background 0.3s ease;
}
.hero-dots button:hover { background: rgba(255, 255, 255, 0.8); }
.hero-dots button.active { width: 46px; }
.hero-dots button i {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0;
  background: #FFD321;
}
.hero-dots button.active i { animation: dotFill var(--slide-time, 6s) linear forwards; }
@keyframes dotFill { from { width: 0; } to { width: 100%; } }

/* ---------- Titres de section : trait animé ---------- */
section h2.heading::after {
  content: '';
  display: block;
  width: 0;
  height: 5px;
  margin: 14px auto 0;
  background: #FFD321;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(.2,.7,.2,1) 0.3s;
}
section.in-view h2.heading::after { width: 90px; }
#about h2.heading::after, #services h2.heading::after { background: #3b96ff; }

/* ---------- Chiffres clés (à propos) ---------- */
.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 6px 0 26px;
}
.about-stats .stat {
  flex: 1 1 150px;
  padding: 16px 18px;
  background: #f2f7ff;
  border-left: 5px solid #3b96ff;
  border-radius: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-stats .stat:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(59,150,255,0.2); }
.about-stats .stat-num {
  font-size: 40px;
  font-weight: bold;
  line-height: 1;
  color: #1d3b6e;
}
.about-stats .stat-plus { font-size: 28px; font-weight: bold; color: #3b96ff; }
.about-stats .stat-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #5d6b7c;
}

/* ---------- Cartes de services ---------- */
.service-box {
  transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px));
  transition: transform 0.25s ease-out, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 4px solid #3b96ff;
}
.service-box:hover { --ty: -6px; transform: perspective(800px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px); }
.service-box .fa { transition: transform 0.5s ease, background 0.3s ease, color 0.3s ease; }
.service-box:hover .fa {
  background: #FFD321;
  color: #1d3b6e;
  transform: rotate(-8deg) scale(1.12);
}
.service-box h3 { transition: color 0.3s ease; }
.service-box:hover h3 { color: #2a7fe6; }

/* ---------- Galerie ---------- */
#portfolio .iso-box > a { position: relative; overflow: hidden; }
#portfolio .iso-box > a img { transition: transform 0.5s ease, opacity 0.4s ease; }
#portfolio img:hover { opacity: 1; }
#portfolio .iso-box:hover > a img { transform: scale(1.07); }
#portfolio .iso-box > a::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(29, 59, 110, 0.55);
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}
#portfolio .iso-box > a::after {
  content: '\f00e';
  font-family: FontAwesome;
  position: absolute;
  top: 50%; left: 50%;
  margin: -28px 0 0 -28px;
  width: 56px; height: 56px;
  line-height: 56px;
  text-align: center;
  font-size: 24px;
  color: #1d3b6e;
  background: #FFD321;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(.2,.9,.3,1.4);
  z-index: 2;
}
#portfolio .iso-box:hover > a::before { opacity: 1; }
#portfolio .iso-box:hover > a::after { opacity: 1; transform: scale(1); }
#portfolio .iso-box .iso-caption { transition: color 0.3s ease; }
#portfolio .iso-box:hover .iso-caption { color: #2a7fe6; }
.filter-wrapper li a { position: relative; }

/* ---------- Équipe ---------- */
#team .team-wrapper img { transition: transform 0.4s cubic-bezier(.2,.9,.3,1.3), filter 0.4s ease; }
#team .team-wrapper:hover img { transform: translateY(-8px) scale(1.04); filter: drop-shadow(0 14px 14px rgba(29,59,110,0.25)); }

/* ---------- Boutons : reflet et ondulation ---------- */
.about-cta, .services-cta, .hero-slider .btn, .btn-contact { position: relative; overflow: hidden; }
.about-cta::after, .services-cta::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.about-cta:hover::after, .services-cta:hover::after { left: 130%; }
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: scale(0);
  animation: ripple 0.65s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- Formulaire ---------- */
#contact .form-control { transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease; }
#contact .form-control:focus {
  border-color: #3b96ff;
  box-shadow: 0 0 0 4px rgba(59, 150, 255, 0.18);
  transform: translateY(-2px);
}
.shake { animation: shake 0.45s ease; border-color: #c0392b !important; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.form-status.pop { animation: pop 0.45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.contact-info-box .fa { transition: transform 0.4s ease, color 0.3s ease; }
.contact-info-box:hover .fa { transform: translateY(-5px) scale(1.12); color: #3b96ff; }

/* ---------- Boutons flottants ---------- */
.whatsapp-float::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  background: #25d366;
  z-index: -1;
  animation: waRing 2.6s ease-out infinite;
}
@keyframes waRing {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
.whatsapp-float { isolation: isolate; }
.to-top {
  position: fixed;
  right: 25px;
  bottom: 90px;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: #303030;
  color: #fff;
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s, background 0.3s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: #3b96ff; }

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-network, .whatsapp-float::before { display: none; }
  section h2.heading::after { width: 90px; }
}

/* ---------- Menu lisible au-dessus des images d'accueil ---------- */
@media (min-width: 768px) {
  .custom-navbar:not(.top-nav-collapse) {
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
}
