* {
  box-sizing: border-box;
}
.carousel-container {
  width: 100%;
  margin: 0px auto;
  padding: 32px;
  background: #ffffff;
  border-radius: 0px;
  overflow: hidden;
}

.keen-slider {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-right: -8px;
}
.keen-slider__slide {
  min-height: auto;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding-right: 8px;
}
.video-slide-container {
  width: 100%;
}
.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #000; /* Add black background for videos */
  group: video-container;
}

/* Ensure video element displays properly with poster */
.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block; /* Ensure block display */
  background-size: cover; /* For poster display */
  background-position: center;
  background-repeat: no-repeat;
}

/* Hide loading overlay by default - poster should show instead */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: none; /* Changed from flex to none */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  color: white;
  z-index: 10; /* Ensure it's above video when shown */
}

/* Only show loading overlay when actively loading */
.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 8px;
}
.loading-text {
  font-size: 14px;
  text-align: center;
}
.error-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1f2937;
  z-index: 15; /* Above loading overlay */
}
.error-content {
  text-align: center;
  color: white;
  padding: 16px;
}
.error-icon {
  font-size: 18px;
  margin-bottom: 8px;
}
.error-title {
  font-size: 14px;
  margin-bottom: 8px;
}
.error-subtitle {
  font-size: 12px;
  opacity: 0.75;
}
.play-button-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 20; /* Above other overlays */
}
.play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}
.play-icon {
  width: 22px;
  height: 22px;
}
.pause-icon {
  width: 22px;
  height: 22px;
}

.video-container .hover-overlay {
  transition: opacity 0.3s ease;
  z-index: 5; /* Below control buttons */
}

/* Dynamic play button sizing */
@media (min-width: 768px) {
  .play-button {
      width: 60px;
      height: 60px;
  }
  .pause-button {
      width: 60px;
      height: 60px;
  }
  .play-icon {
      width: 22px;
      height: 22px;
  }
  .pause-icon {
      width: 22px;
      height: 22px;
  }
}
@media (max-width: 767px) {
  .play-button {
      width: 80px;
      height: 80px;
  }
  .pause-button {
      width: 80px;
      height: 80px;
  }
  .play-icon {
      width: 28px;
      height: 28px;
  }
  .pause-icon {
      width: 28px;
      height: 28px;
  }
}
.video-container:hover .play-button {
  transform: scale(1.1);
  opacity: 1;
}
.pause-button-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 20; /* Same as play button */
}
.video-container:hover .pause-button-overlay {
  opacity: 1;
}
.pause-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  transition: all 0.3s ease;
}
.video-container:hover .pause-button {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.75);
}
.hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}
.video-container:hover .hover-overlay {
  background: rgba(0, 0, 0, 0.1);
}
.carousel-navigation {
  position: relative;
}
.nav-below {
  margin-top: 24px;
}
.nav-overlay {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  pointer-events: none;
}
.nav-controls {
  display: flex;
  align-items: center;
}
.nav-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-section-center {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 auto;
}
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
}
.nav-circular {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  color: #374151;
}
.nav-circular:hover {
  background: #e6e6e6;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}
.nav-minimal {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  color: #1f2937;
}
.nav-minimal:hover {
  background: white;
}
.nav-arrows {
  width: 56px;
  height: 56px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  color: #374151;
}
.nav-arrows:hover {
  background: #cccccc;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.05);
}
.nav-overlay-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.nav-overlay-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}
.dots-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.dot-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dot-btn:hover {
  background: #9ca3af;
}
.dot-btn.active {
  background: #3b82f6;
  transform: scale(1.2);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 768px) {
  .carousel-container {
      padding: 16px;
  }
}