/* Ensure video container takes full width */
.video-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1400px; /* Adjust max-width as needed */
  margin: auto;
}

/* Keep the video responsive with aspect ratio */
.video-container .video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Ensures proper scaling */
  border-radius: 15px;
  overflow: visible; /* Changed from hidden to allow overlay */
  box-shadow: 9px 7px 21px -8px rgba(0,0,0,0.75);
}

.video-container #main-video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevent black bars */
  border-radius: 15px;
}

.video-container #video-title {
    padding-top: 20px;
}

.video-container .thumbnail-slider {
  display: flex;
  align-items: center;
  width: calc(100% - 40px); /* Account for padding */
  overflow: hidden;
  position: absolute;
  top: 20px; /* Position at top of video */
  left: 20px;
  z-index: 10; /* Higher than video */
  background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
  border-radius: 8px;
  padding: 10px;
  opacity: 1; /* Visible by default */
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-container .thumbnails {
  display: flex;
  gap: 10px; /* Space between thumbnails */
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox scrollbar hidden */
  width: 100%;
  cursor: pointer;
  padding: 0; /* Remove bottom padding since we're overlaying */
}

.video-container .thumbnails::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.video-container .thumbnail {
  flex: 0 0 auto; /* Prevents stretching while keeping fixed-size thumbnails */
  width: 320px; /* Larger width to show 3-4 thumbnails */
  height: auto; /* Maintain aspect ratio */
  border-radius: 8px; /* Rounded corners */
  opacity: 0.8; /* Dimmed by default */
  transition: opacity 0.2s ease;
}

.video-container .thumbnail.active {
  border: 2px solid #fff; /* Highlight border */
  opacity: 1; /* Slightly dim others */

  box-shadow: 2px 1px 4px -2px rgba(0,0,0,0.75);
}

.video-container .loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2; /* Ensure it appears above the video */
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
  color: white;
  font-size: 18px;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Show thumbnail slider on hover */
.video-container .video-wrapper:hover .thumbnail-slider {
  opacity: 1;
  visibility: visible;
}

.video-container .slider-control {
  display: none; /* Hide slider controls by default */
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 34px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.video-container .slider-control:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.video-info {
  min-height: 175px;
  width: 100%;
  color: #fff;
}
@media (max-width: 600px) {
  .video-container .loading {
    font-size: 14px;
    padding: 10px;
  }
}

@media (max-width: 768px) {
  .video-container .thumbnail {
    width: 220px; /* Larger thumbnails for tablets to show 2-3 at once */
  }

  .video-container .thumbnail-slider {
    width: calc(100% - 20px); /* Less padding on smaller screens */
    left: 10px;
    top: 10px;
  }
}

@media (max-width: 480px) {
  .video-container .thumbnail {
    width: 160px; /* Larger thumbnails for mobile to show 2 at once */
  }

  .video-container .thumbnail-slider {
    width: calc(100% - 10px); /* Even less padding on mobile */
    left: 5px;
    top: 5px;
    padding: 5px;
  }
}

@media (min-width: 600px) {
  .video-container .slider-control {
    display: flex; /* Show controls on larger screens */
    align-items: center;
    justify-content: center;
  }
}
