/* YouTube Video Player Styles */

.youtube-player-container {
  width: 100%;
  max-width: 800px;
  margin: 50px auto;
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.youtube-player-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
}

.youtube-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Playlist Wrapper with Navigation */
.video-playlist-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #1a1a1a;
}

.video-playlist-container {
  flex: 1;
  overflow: hidden;
}

.video-playlist {
  display: flex;
  gap: 12px;
  padding: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide scrollbar for cleaner look */
  -ms-overflow-style: none;
}

.video-playlist::-webkit-scrollbar {
  display: none; /* Hide scrollbar for cleaner look */
}

/* Playlist Navigation */
.playlist-nav {
  background: rgba(26, 26, 26, 0.9);
  border: none;
  color: #fff;
  font-size: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px;
}

.playlist-nav:hover {
  background: rgba(214, 57, 58, 0.9);
  transform: scale(1.1);
}

.playlist-prev {
  margin-right: 0;
}

.playlist-next {
  margin-left: 0;
}

.playlist-item {
  flex: 0 0 120px;
  background: #333;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
}

.playlist-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.playlist-item.active {
  border: 2px solid #d6393a;
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(214, 57, 58, 0.3);
}

.playlist-thumbnail {
  position: relative;
  width: 100%;
  height: 68px;
  overflow: hidden;
}

.playlist-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.playlist-item:hover .playlist-thumbnail img {
  transform: scale(1.05);
}

.playlist-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(214, 57, 58, 0.9);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.playlist-item:hover .playlist-play-icon,
.playlist-item.active .playlist-play-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.playlist-play-icon i {
  color: #fff;
  font-size: 12px;
  margin-left: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .youtube-player-container {
    margin: 30px auto;
    border-radius: 8px;
  }

  .playlist-nav {
    width: 35px;
    height: 35px;
    font-size: 14px;
    margin: 8px;
  }

  .video-playlist {
    padding: 15px;
    gap: 10px;
  }

  .playlist-item {
    flex: 0 0 100px;
  }

  .playlist-thumbnail {
    height: 56px;
  }

  .playlist-play-icon {
    width: 25px;
    height: 25px;
  }

  .playlist-play-icon i {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .playlist-nav {
    width: 30px;
    height: 30px;
    font-size: 12px;
    margin: 6px;
  }

  .video-playlist {
    padding: 12px;
    gap: 8px;
  }

  .playlist-item {
    flex: 0 0 80px;
  }

  .playlist-thumbnail {
    height: 45px;
  }

  .playlist-play-icon {
    width: 20px;
    height: 20px;
  }

  .playlist-play-icon i {
    font-size: 8px;
  }
}

/* Loading states */
.youtube-player-container.loading {
  background: #222;
}

.youtube-player-container.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #666;
  border-top: 3px solid #d6393a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 20;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
