/* Container */
.videocarousel-container {
  perspective: 1600px;
  width: 100%;
  height: 100%;
  min-height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: pan-y;
  overflow: visible;
  position: relative;
  z-index: 10;
}

/* 3D Carousel */
.videocarousel {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1s ease;
}

/* Each Item */
.videocarousel-item {
  position: absolute;
  width: 100vw;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 1s ease, z-index 0.5s, opacity 0.6s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  pointer-events: auto;
}

/* Image */
.videocarousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20px;
  display: block;
}

/* Play Icon */
.videocarousel-item::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  background: url('https://vetresources.com.au/wp-content/uploads/2025/05/play.png') center/contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
  animation: pulse 2s infinite;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Modal */
.videocarousel-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
}

.videocarousel-modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.videocarousel-modal-content iframe {
  width: 100%;
  height: 600px;
  border: none;
}

.videocarousel-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: #ffffff;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease, transform 0.2s ease;
}

.videocarousel-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}


/* Navigation Layout */
.videocarousel-navigation-wrapper {
  width: 70vw;
  max-width: 480px;
  margin: 30px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
}

/* Arrow Buttons */
.videocarousel-nav-button {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #333;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
}

.videocarousel-nav-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Indicator Bar */
.videocarousel-navigation-indicator {
  flex: 1;
  height: 20px;
  max-width: 200px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: #2c2c2c;
  backdrop-filter: blur(6px);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Progress Fill */
.videocarousel-navigation-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #0c2f75, #239bc6);
  border-radius: 10px;
  z-index: 0;
  transition: width 0.3s ease;
}

.videocarousel-navigation-text {
  position: relative;
  z-index: 1;
}


@media (max-width: 768px) {
  /* Carousel container fits tight */
  .videocarousel-container {
    padding: 12px 0 0 0;
    width: 100%;
    margin: 0 auto;
    height: auto;
    min-height:250px;
  }

  /* Card stays compact */
  .videocarousel-item {
    max-width: 90vw;
    width: 100%;
    aspect-ratio: 16 / 9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    border-radius: 16px;
    margin: 0 auto;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  }

  .videocarousel-item img {
    border-radius: 16px;
    object-fit: cover;
  }

  .videocarousel-item::after {
    width: 40px;
    height: 40px;
  }

  /* Modal adjustments */
  .videocarousel-modal-content iframe {
    height: 240px;
  }

  .videocarousel-close-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
    top: 10px;
    right: 10px;
  }

  /* Navigation layout */
  .videocarousel-navigation-wrapper {
    margin-top: 12px;
    padding: 0 12px;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-direction: row;
  }

  .videocarousel-nav-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .videocarousel-navigation-indicator {
    flex: 1;
    max-width: 180px;
    height: 18px;
    font-size: 12px;
  }

  .videocarousel-navigation-progress {
    background: linear-gradient(90deg, #0c2f75, #239bc6);
  }
}
