/**
 * Video Carousel Block Frontend Styles
 */

.wp-block-echobend-video-carousel {
  width: 100%;
  max-width: 100%;
  margin: 0;
  position: relative;
  background: #000;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-carousel-wrapper {
  position: relative;
  width: 100%;
}

.video-carousel-container {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.video-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

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

.video-carousel-slide iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: none;
  display: block;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.video-carousel-slide video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  border: none;
  display: block;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

/* Hide video controls completely */
.video-carousel-slide video::-webkit-media-controls {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-panel {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-play-button {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-start-playback-button {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-timeline {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-current-time-display {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-mute-button {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-volume-slider {
  display: none !important;
}

.video-carousel-slide video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

.video-carousel-slide
  video::-webkit-media-controls-toggle-closed-captions-button {
  display: none !important;
}

/* Firefox */
.video-carousel-slide video::-moz-media-controls {
  display: none !important;
}

/* Force hide controls with additional specificity */
.video-carousel-slide video {
  pointer-events: none;
}

.video-carousel-slide video:hover {
  pointer-events: none;
}

/* Ensure iframe covers full container even on narrow screens */
@media (max-aspect-ratio: 16/9) {
  .video-carousel-slide iframe {
    width: 177.78vh; /* 16:9 aspect ratio */
    height: 100vh;
  }
}

@media (min-aspect-ratio: 16/9) {
  .video-carousel-slide iframe {
    width: 100vw;
    height: 56.25vw; /* 16:9 aspect ratio */
  }
}

/* Content Overlay */
.video-carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.7) 50%,
    transparent 100%
  );
  color: white;
  padding: 60px 30px 10px; /* More bottom padding for dots */
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 3rem;
}

.video-carousel-text {
  flex: 1;
  max-width: 60%;
}

.video-carousel-title {
  font-size: clamp(1.35rem, 3.6vw, 2.25rem);
  font-weight: 500;
  margin: 0;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: white;
  text-transform: none;
}

.video-carousel-description,
.video-carousel-client {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin: 0;
  opacity: 0.95;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
  line-height: 1.5;
}

.video-carousel-nav-container {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
}

/* Navigation Arrows */
.video-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.7;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.video-carousel-arrow:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.6);
  transform: translateY(-50%) scale(1.1);
}

.video-carousel-arrow:focus {
  outline: none;
}

.video-carousel-arrow:active {
  outline: none;
  transform: translateY(-50%) scale(0.95);
}

.video-carousel-arrow-prev {
  left: 30px;
}

.video-carousel-arrow-next {
  right: 30px;
}

.video-carousel-arrow svg {
  width: 24px;
  height: 24px;
}

/* Horizontal Bar Navigation */
.video-carousel-dots {
  display: flex;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
}

.video-carousel-dot {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  position: relative;
}

.video-carousel-dot.active {
  background: var(--color-hover);
  box-shadow: 0 2px 8px rgba(0, 115, 170, 0.4);
}

.video-carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scaleY(1.5);
}

.video-carousel-dot.active:hover {
  background: #005a87;
}

.video-carousel-dot:focus {
  outline: 2px solid #0073aa;
  outline-offset: 3px;
}

/* Loading State */
.video-carousel-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: white;
  font-size: 1.2rem;
  text-align: center;
}

.video-carousel-loading::before {
  content: "";
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* Error State */
.video-carousel-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #ff6b6b;
  font-size: 1.1rem;
  text-align: center;
  padding: 40px 20px;
  background: rgba(255, 107, 107, 0.1);
}

.video-carousel-error::before {
  content: "⚠️";
  font-size: 3rem;
  margin-bottom: 20px;
  filter: grayscale(1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .video-carousel-content {
    padding: 40px 25px 25px;
  }
}

@media (max-width: 768px) {
  .video-carousel-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    padding: 40px 25px 80px; /* More bottom padding for dots */
  }

  .video-carousel-text {
    max-width: 100%;
  }

  .video-carousel-nav-container {
    bottom: 20px; /* Closer to bottom on mobile */
  }

  .video-carousel-arrow {
    width: 40px;
    height: 40px;
    opacity: 0.6;
  }

  .video-carousel-arrow-prev {
    left: 15px;
  }

  .video-carousel-arrow-next {
    right: 15px;
  }

  .video-carousel-arrow svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .video-carousel-content {
    gap: 1.5rem;
    padding: 30px 20px 70px; /* Even more bottom padding for small screens */
  }

  .video-carousel-nav-container {
    bottom: 15px; /* Even closer on small screens */
  }

  .video-carousel-dots {
    gap: 6px;
    padding: 4px 8px;
  }

  .video-carousel-dot {
    width: 24px;
    height: 2px;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .video-carousel-dot {
    background: white;
    border: 1px solid black;
  }

  .video-carousel-dot.active {
    background: #0000ff;
    border-color: white;
  }

  .video-carousel-content {
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.95) 0%,
      rgba(0, 0, 0, 0.8) 50%,
      transparent 100%
    );
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .video-carousel-slide {
    transition: opacity 0.3s ease;
  }

  .video-carousel-dot {
    transition: background-color 0.2s ease;
  }

  .video-carousel-dot:hover {
    transform: none;
  }
}

/* Print styles */
@media print {
  .video-carousel-wrapper {
    display: none;
  }
}
