/*
 * ===================================
 * CAROUSEL STYLING (DENGAN PERBAIKAN)
 * ===================================
 */

/* --- Base & Sizing --- */
.carousel-item {
  height: 80vh; /* Sedikit lebih tinggi untuk dampak maksimal */
  min-height: 400px;
  overflow: hidden;
}

/* --- Efek Gambar (Grayscale & Overlay) --- */
.carousel-item img {
  height: 100% !important;
  width: 100% !important;
  position: absolute !important;
  object-fit: cover !important;
  filter: grayscale(100%); /* Gambar default menjadi hitam-putih */
  transition: filter 1.5s ease-in-out; /* Transisi lambat saat warna muncul */
}

/* Warna gambar akan kembali saat slide aktif */
.carousel-item.active img {
  filter: grayscale(0%);
}

/* Menambahkan overlay gelap untuk keterbacaan teks */
.carousel-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  /* PERBAIKAN DI SINI */
  z-index: 1; /* Pastikan overlay di bawah tombol (z-index: 2) dan caption (z-index: 10) */
}

/* --- Caption & Animasi Teks --- */
.carousel-caption {
  bottom: 0;
  top: 50%;
  left: 15%;
  right: 15%;
  transform: translateY(-50%);
  z-index: 10; /* Pastikan caption di atas segalanya */
  text-align: center;
}

/* Definisikan keyframes untuk animasi */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Terapkan animasi pada elemen di slide yang aktif */
.carousel-item.active .carousel-caption h1,
.carousel-item.active .carousel-caption p,
.carousel-item.active .carousel-caption .btn {
  opacity: 0; /* Mulai dari transparan */
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Beri delay untuk setiap elemen agar muncul berurutan */
.carousel-item.active .carousel-caption p {
  animation-delay: 0.2s;
}
.carousel-item.active .carousel-caption .btn {
  animation-delay: 0.4s;
}

.carousel-caption h1 {
  font-weight: 700;
}

/* --- Indikator & Kontrol --- */
.carousel-indicators {
  z-index: 2; /* Pastikan indikator juga di atas overlay */
}
.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  margin: 0 5px;
}

.carousel-indicators .active {
  background-color: #fff;
}

.carousel-control-prev,
.carousel-control-next {
  z-index: 2; /* Pastikan tombol kontrol juga di atas overlay */
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
}
