/* Base carousel styles */
.custom-carousel {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin: 57px -50vw 40px -50vw;
  padding: 10px 0;
  overflow: hidden;
  /* background: #000; */
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 0 auto;
  padding: 20px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Image base styles */
.carousel-image {
  position: relative;
  height: 100%;
  flex: 0 0 auto;
  width: 400px;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  overflow: hidden;
}

/* OVERLAY NOIR SUR LES IMAGES */
.carousel-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4); /* Overlay noir semi-transparent */
  z-index: 1;
  transition: background 0.3s ease;
}

/* Overlay moins visible sur l'image active */
.carousel-image.active::before {
  background: rgba(0, 0, 0, 0.3); /* Moins sombre pour l'image active */
}

/* Overlay au hover */
.carousel-image:hover::before {
  background: rgba(0, 0, 0, 0.2); /* Plus clair au hover */
}

/* Active image */
.carousel-image.active {
  width: 400px;
  transform: scale(1.1);
  z-index: 2;
}

.carousel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
  position: relative;
  z-index: 0; /* Sous l'overlay */
}

/* Hover effects */
.carousel-image:hover {
  transform: translateY(-10px);
}

.carousel-image:hover img {
  transform: scale(1.05);
}

/* OVERLAY CONTENT - BLOC CENTRÉ DEVANT LES SLIDES - CORRIGÉ */
.carousel-content {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15; /* Au-dessus de tout */
  text-align: center;
  color: white;
  width: 80%;
  max-width: 600px;
}

.slide-content {
  padding: 40px 30px;
  border-radius: 15px;
}

.slide-title {
  font-size: 3.5rem;
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.2;
}
.slide-text {
  margin-bottom: 10px;
}

/* Navigation controls */
.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20; /* Au-dessus de l'overlay */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.carousel-controls:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(0, 0, 0, 0.9);
}

.carousel-prev {
  left: 20px;
}

.carousel-next {
  right: 20px;
}

/* Indicateurs */
.carousel-indicators {
  display: flex;
  justify-content: center;
  margin-top: 40px; /* Augmenté pour plus d'écart */
  gap: 10px;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: #ff7900;
  transform: scale(1.2);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .carousel-container {
    max-width: 100%;
    padding: 0 60px;
  }

  .carousel-image {
    width: 350px;
  }

  .carousel-image.active {
    width: 350px;
  }

  .slide-title {
    font-size: 2.2rem;
  }

  .slide-content {
    padding: 35px 25px;
  }
}

@media (max-width: 992px) {
  .carousel-container {
    height: 400px;
    padding: 0 50px;
  }

  .carousel-image {
    width: 300px;
  }

  .carousel-image.active {
    width: 300px;
  }

  .slide-title {
    font-size: 2rem;
  }

  .slide-content {
    padding: 30px 20px;
  }

  .carousel-content {
    width: 85%;
  }

  .carousel-controls {
    display: none; /* Cache les flèches de navigation */
  }

  .carousel-indicators {
    display: none; /* Cache les indicateurs de slide */
  }

  .carousel-image.active {
    transform: none !important;
  }
}

@media (max-width: 768px) {
  .custom-carousel {
    margin: 36px -50vw 40px -50vw;
  }

  .carousel-container {
    height: 350px;
    padding: 0 40px;
    gap: 10px;
  }

  .carousel-controls {
    display: none; /* Cache les flèches de navigation */
  }

  .carousel-indicators {
    display: none; /* Cache les indicateurs de slide */
  }

  .carousel-image.active {
    transform: none !important;
  }

  .carousel-image {
    width: 150px;
  }

  .carousel-image.active {
    width: 150px;
  }

  .carousel-controls {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .slide-title {
    font-size: 1.5rem;
  }

  .slide-text {
    font-size: 1rem;
  }

  .slide-content {
    padding: 25px 15px;
    margin-top: -10rem;
  }

  .carousel-content {
    width: 90%;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.custom-carousel {
  animation: fadeIn 0.8s ease-out;
}

/* ANIMATION INFINIE - Option 2: Pulsation des indicateurs */
@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

.indicator.active {
  animation: pulse 2s ease-in-out infinite;
}

/* ANIMATION INFINIE - Option 3: Rotation des images actives */
@keyframes rotateActive {
  0% {
    transform: scale(1.1) rotate(0deg);
  }
  100% {
    transform: scale(1.1) rotate(360deg);
  }
}

.carousel-image.active.rotate-animation {
  animation: rotateActive 10s linear infinite;
}

/* ANIMATION INFINIE - Option 4: Effet de vagues sur le fond */
.custom-carousel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 121, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.8) 25%,
    rgba(255, 121, 0, 0.1) 50%,
    rgba(0, 0, 0, 0.8) 75%,
    rgba(255, 121, 0, 0.1) 100%
  );
  background-size: 400% 400%;
  animation: gradientWave 8s ease infinite;
  z-index: 0;
}

@keyframes gradientWave {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Contrôles d'animation */
.animation-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  gap: 10px;
}

.animation-btn {
  background: rgba(255, 121, 0, 0.8);
  border: none;
  border-radius: 5px;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.animation-btn:hover {
  background: rgba(255, 121, 0, 1);
  transform: scale(1.05);
}

.animation-btn.active {
  background: #ff7900;
  box-shadow: 0 0 10px rgba(255, 121, 0, 0.5);
}
