/**
 * ARINWA — Interactions & animations (thème DEGER)
 */

/* ── Barre de progression scroll ── */
.dg-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 1100;
  background: linear-gradient(90deg, var(--arinwa-red), var(--arinwa-green));
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ── Reveal au scroll (stagger) ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.55s ease,
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Hero Ken Burns + texte animé ── */
.dg-hero .carousel-item.active .hero-kenburns {
  animation: none;
  transform: none;
}

.dg-hero .carousel-item .hero-slide-content > * {
  opacity: 0;
  transform: translateY(20px);
}

.dg-hero .carousel-item.active .hero-slide-content > * {
  animation: arinwaHeroTextIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.dg-hero .carousel-item.active .hero-slide-content > *:nth-child(1) { animation-delay: 0.15s; }
.dg-hero .carousel-item.active .hero-slide-content > *:nth-child(2) { animation-delay: 0.3s; }
.dg-hero .carousel-item.active .hero-slide-content > *:nth-child(3) { animation-delay: 0.45s; }
.dg-hero .carousel-item.active .hero-slide-content > *:nth-child(4) { animation-delay: 0.6s; }

@keyframes arinwaHeroTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dg-hero .carousel-indicators {
  position: absolute;
  bottom: 1.25rem;
  left: 0;
  right: 0;
  transform: none;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  background: transparent !important;
}

.dg-hero .carousel-indicators button {
  width: 10px !important;
  height: 10px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255, 255, 255, 0.7) !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  opacity: 0.7;
  transition: transform 0.25s, background 0.25s, opacity 0.25s;
  text-indent: -9999px;
  overflow: hidden;
}

.dg-hero .carousel-indicators button.active {
  background: #fff;
  transform: scale(1.2);
}

/* ── Cartes accès rapide — tilt + shine ── */
.dg-quick-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  will-change: transform;
}

.dg-quick-card.is-tilting {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.dg-quick-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
  z-index: 2;
}

.dg-quick-card:hover::after {
  transform: translateX(120%);
}

.dg-quick-card .quick-title {
  transition: transform 0.3s ease;
}

.dg-quick-card:hover .quick-title {
  transform: translateY(-4px);
}

/* ── Icônes piliers — hover interactif ── */
.dg-icon-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
}

.dg-icon-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.dg-icon-card .icon-circle {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s;
}

.dg-icon-card:hover .icon-circle {
  transform: scale(1.08) rotate(-4deg);
  background: var(--arinwa-red);
  color: #fff;
}

/* ── Boutons ripple ── */
.dg-btn {
  position: relative;
  overflow: hidden;
}

.dg-btn .dg-ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.45);
  animation: arinwaRipple 0.55s ease-out;
  pointer-events: none;
}

@keyframes arinwaRipple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ── Galerie — transitions filtre ── */
.gallery-card {
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.35s ease;
}

.gallery-card.is-filtering-out {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.gallery-card.is-filtering-in {
  animation: arinwaGalleryIn 0.4s ease forwards;
}

@keyframes arinwaGalleryIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gallery-filter-btn {
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.gallery-filter-btn:active {
  transform: scale(0.96);
}

/* ── Stats — pulse au compteur ── */
.dg-stat-big .number.is-counting {
  animation: arinwaStatPulse 0.35s ease;
}

@keyframes arinwaStatPulse {
  50% { transform: scale(1.06); }
}

.dg-stat-big .number {
  display: inline-block;
  transition: transform 0.2s;
}

/* ── Partenaires — hover ── */
.dg-partners-row img {
  transition: transform 0.35s ease, filter 0.35s ease;
  filter: grayscale(30%);
}

.dg-partners-row img:hover {
  transform: scale(1.06);
  filter: grayscale(0%);
}

/* ── Pages intérieures ── */
.dg-inner-hero {
  background: linear-gradient(135deg, var(--arinwa-red-dark) 0%, #1f2937 100%);
  color: #fff;
  padding: 3rem 0;
  position: relative;
  overflow: hidden;
}

.dg-inner-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../img/banner.jpeg') center/cover no-repeat;
  opacity: 0.15;
}

.dg-inner-hero .container-xl {
  position: relative;
  z-index: 1;
}

.dg-inner-hero h1 {
  color: #fff;
  font-weight: 800;
  margin: 0;
}

.dg-inner-hero .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.85);
}

.dg-inner-hero .breadcrumb-item.active {
  color: #fff;
}

.dg-content-card {
  background: #fff;
  border: 1px solid var(--arinwa-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.3s, transform 0.3s;
}

.dg-content-card:hover {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

/* Onglets interactifs (propos) */
.dg-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dg-tab-btn {
  border: 2px solid var(--arinwa-border);
  background: #fff;
  color: var(--arinwa-text);
  font-weight: 700;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.dg-tab-btn:hover {
  border-color: var(--arinwa-red);
  color: var(--arinwa-red);
}

.dg-tab-btn.is-active {
  background: var(--arinwa-red);
  border-color: var(--arinwa-red);
  color: #fff;
}

.dg-tab-panel {
  display: none;
  animation: arinwaTabIn 0.35s ease;
}

.dg-tab-panel.is-active {
  display: block;
}

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

.dg-stat-click {
  border: none;
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  cursor: pointer;
}

.dg-stat-click:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
}

.dg-stat-click .stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--arinwa-red);
  display: block;
}

/* Contact interactif */
.dg-contact-map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 2rem;
}

.dg-contact-map iframe {
  width: 100%;
  height: 380px;
  border: 0;
  display: block;
}

.dg-info-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--arinwa-border);
  margin-bottom: 1rem;
  transition: border-color 0.25s, transform 0.25s;
}

.dg-info-card:hover {
  border-color: var(--arinwa-green);
  transform: translateX(4px);
}

.dg-info-card i {
  font-size: 1.5rem;
  color: var(--arinwa-red);
}

.dg-form-modern .form-control {
  border-radius: 8px;
  border: 1px solid var(--arinwa-border);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.dg-form-modern .form-control:focus {
  border-color: var(--arinwa-green);
  box-shadow: 0 0 0 3px rgba(21, 128, 61, 0.15);
}

/* Chargement page */
body.arinwa-site.is-loading {
  overflow: hidden;
}

.dg-page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s, visibility 0.4s;
  animation: arinwaHideLoader 3.2s ease forwards;
}

@keyframes arinwaHideLoader {
  0%, 85% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

.dg-page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dg-page-loader__bar {
  width: 120px;
  height: 3px;
  background: var(--arinwa-border);
  border-radius: 999px;
  overflow: hidden;
}

.dg-page-loader__bar::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--arinwa-red), var(--arinwa-green));
  animation: arinwaLoader 1s ease-in-out infinite;
}

@keyframes arinwaLoader {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
