/* Frontend Styles for Algo Video Carousel */

.algo-video-carousel {
  position: relative;
  width: 100%;
  height: 100vh; /* Default height, can be overridden by settings */
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 1;
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.carousel-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000; /* Default color, overridden by settings */
  opacity: 0.5; /* Default opacity, overridden by settings */
  z-index: 2;
}

/* Navigation Controls */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  background: #000000;
  opacity: 0.4;
}

.carousel-nav:hover {
  opacity: 1;
}

.carousel-nav.prev {
  left: 20px;
}

.carousel-nav.next {
  right: 20px;
}

/* Navigation Dots */
.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

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

.dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.dot.active {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.9);
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .carousel-nav {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .carousel-nav.prev {
    left: 10px;
  }

  .carousel-nav.next {
    right: 10px;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}

/* Loading State */
.algo-video-carousel.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  z-index: 4;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.text-container {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  z-index: 10;
  /* background: rgba(0, 0, 0, 0.1); */
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 8px;
  max-width: 90vw;
  text-align: center;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); */
  word-break: break-word;
}

@media screen and (max-width: 768px) {
  .text-container {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }
}
