/* TEXT CAROUSEL */

.text-carousel {
  position: relative;
  width: 100%;
  height: 700px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 120px;
  transition: transform var(--transition) ease-in-out; /* Eased zoom animation */
}

/* Dim effect layer */
.carousel-dim-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0); /* transparent by default */
  transition: background-color 0.4s ease;
  z-index: 2; /* Just above the background, below the content */
  pointer-events: none; /* Don't block clicks */
}

/* Pause icon */
.carousel-pause-icon {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 2em;
  color: white;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  z-index: 5;
}

.carousel-bg,
.carousel-bg-next {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease-in-out;
  z-index: 1;
  will-change: transform;
}

.carousel-bg-next {
  z-index: 2;
  opacity: 0;
}

.carousel-bg-next:hover {
  transform: scale(1.01) blur(15px);
}

/* Slide-in animation */
@keyframes slideBgLeft {
  from {
    transform: translateX(100%);
    opacity: 1;
  }
  to {
    transform: translateX(0%);
    opacity: 1;
  }
}

.slide-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 7px;
  background-color: rgba(255, 255, 255, 0.5);
  z-index: 10;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  transform: scaleX(0);
  transform-origin: left;
  animation: fillProgress linear forwards;
  animation-duration: 4s; /* can be updated dynamically */
}

@keyframes fillProgress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Pause animation on hover */
.text-carousel:hover .progress-fill {
  animation-play-state: paused;
}

.text-carousel:hover .carousel-bg {
  transform: scale(1.1);
}

.text-carousel:hover .carousel-dim-overlay {
  background-size: 110%; /* slight zoom on hover */
  background-color: rgba(255, 255, 255, 0.2); /* light dimming effect */
}

.text-carousel:hover .carousel-pause-icon {
  opacity: 1;
}

.slide-counter {
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 0.95rem;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 5;
  font-weight: 500;
}

.carousel-inner {
  flex-grow: 1;
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.text-slide {
  display: none;
  position: absolute;
  width: 100%;
  height: 100%;
}

.text-slide.active {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 1.5s ease-in-out;
}

.text-overlay {
  background-color: rgba(255, 255, 255, 0.3);
  padding: 20px 30px;
  /* border-radius: 15px; */
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  max-width: 90%;
  color: white;
}

.text-overlay-emoji {
  font-size: 7em;
}

.slide-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding-bottom: 10px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #bbb;
  transition: background-color 0.3s, transform 0.3s;
  cursor: pointer;
  z-index: 15;
}

.active-dot {
  background-color: white;
  transform: scale(1.6);
  z-index: 15;
}

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

.carousel-chevron {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.2);
  color: white;
  font-size: 2.5em;
  font-weight: bold;
  padding: 12px 25px;
  cursor: pointer;
  z-index: 20;
  transition: background-color 0.3s, transform 0.3s ease-in-out;
  user-select: none;
}

.carousel-chevron:hover {
  background-color: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(1.2);
  transition: cubic-bezier(0.175, 0.885, 0.32, 1.275) ease-in-out;
}

.chevron-left {
  left: 1.5rem;
  padding: 12px 20px;
}

.chevron-right {
  right: 1.5rem;
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.slide-in-left { animation: slideInLeft 0.8s ease forwards; }
.slide-in-right { animation: slideInRight 0.8s ease forwards; }
.slide-in-up { animation: slideInUp 0.8s ease forwards; }
.slide-in-down { animation: slideInDown 0.8s ease forwards; }

.slide-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 7px;
  background-color: rgba(255, 255, 255, 0.25);
  z-index: 15;
  overflow: hidden;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.5);
}
