:root {
  --indicator-size: 8px;
  --indicator-mobile-size: 6px;
}

.carousel {
  aspect-ratio: 16/9;
  width: 100%;
  position: relative;
  background: black;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 1s cubic-bezier(0.28, 0.55, 0.385, 1);
  z-index: 1;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 2;
}

.slide.next-in {
  animation: scaleIn 1s cubic-bezier(0.28, 0.55, 0.385, 1) forwards;
}

.slide.prev-out {
  animation: scaleOut 1s cubic-bezier(0.28, 0.55, 0.385, 1) forwards;
}

@keyframes scaleIn {
  from {
    transform: scale(1.05);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.95);
    opacity: 0;
  }
}

.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(0, 0, 0) 0%, #2e2e2e96 43%);
}

.slide-info {
  position: absolute;
  bottom: 13rem;
  left: 2rem;
  padding: 20px;
  width: 50rem;
  color: white;
  z-index: 2;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.3s;
  transform: translate3d(
    0,
    30px,
    0
  ); /* Use 3D transform for hardware acceleration */
  will-change: transform, opacity;
}

.slide.active .slide-info {
  transform: translateY(0);
  opacity: 1;
}

.slide-info h1 {
  color: #fff;
  font-weight: bold;
  font-size: 3rem;
  margin-bottom: 10px;
  transform: translateX(-30px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.4s;
  transform: translate3d(-30px, 0, 0); /* 3D transform */
  will-change: transform, opacity;
}

.slide.active .slide-info h1 {
  transform: translateX(0);
  opacity: 1;
}

.slide-info p {
  color: #ffffffb0;
  font-size: 1.2rem;
  transform: translateX(30px);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.6s;
  transform: translate3d(30px, 0, 0); /* 3D transform */
  will-change: transform, opacity;
}
.slide.active .slide-info {
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.2s;
}

.slide.active .slide-info h1 {
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.3s;
}

.slide.active .slide-info p {
  transform: translateX(0);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1) 0.4s;
  opacity: 1;
}
/* .slide.active .slide-info p {
  opacity: 1;
} */

.slide-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.3);
  transform: scale(1.05);
  transition: transform 12s linear;
}

.slide.active .slide-bg {
  transform: scale(1);
}

.arrow {
  position: absolute;
  top: 94%;
  transform: translateY(-50%);
  background: none;
  border: none;
  width: 3rem;
  z-index: 3;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.arrow:hover {
  opacity: 1;
}

.arrow img {
  height: 1.5rem;
  transition: all 0.3s ease;
}

.back-arrow {
  right: 80px;
}

.next-arrow {
  right: 40px;
}

.slide-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

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

.indicator.active {
  background: white;
  transform: scale(1.4);
}

@media (max-width: 768px) {
  .arrow {
    display: none;
  }

  .slide-indicators {
    bottom: 15px;
    gap: 8px;
  }

  .indicator {
    width: var(--indicator-mobile-size);
    height: var(--indicator-mobile-size);
  }

  .indicator.active {
    transform: scale(1.6);
  }

  .slide-info {
    bottom: 8rem;
    padding: 0 1.5rem;
    width: 100%;
    left: 0;
  }

  .slide-info h1 {
    font-size: 1.8rem !important;
    margin-bottom: 0.8rem;
  }

  .slide-info p {
    font-size: 0.9rem !important;
  }

  .slide-bg {
    transform: scale(1.08);
  }
}

@media (max-width: 480px) {
  .slide-info {
    bottom: 6rem;
  }

  .slide-info h1 {
    font-size: 1.4rem !important;
  }

  .slide-info p {
    font-size: 0.8rem !important;
  }

  .slide-indicators {
    bottom: 10px;
  }
}
