.bcd-player-wrapper {
  position: relative;
  max-width: 100%;
}

.bcd-video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  z-index: 10000;
  isolation: isolate;
}

.bcd-video-container video,
.bcd-video-container .video-js,
.bcd-video-container .vjs-tech {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block;
  box-sizing: border-box;
}

.bcd-playlist {
  margin-top: 10px;
}

.bcd-playlist-item {
  cursor: pointer;
  padding: 6px 10px;
  background: #f5f5f5;
  margin-bottom: 4px;
}

.bcd-playlist-item.active {
  background: #ddd;
  font-weight: bold;
}

.bcd-dim-overlay {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  pointer-events: none;
}

/* ✅ Floating PIP player styles */
.bcd-video-container.bcd-floating {
  transition: all 0.3s ease-in-out;
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  width: auto !important;
  max-width: 90vw;
  max-height: 50vh;
  aspect-ratio: 16 / 9;
  z-index: 99999 !important;
  background: #000;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
  cursor: move;
  transform-origin: bottom right;
}

@media (min-width: 768px) {
  .bcd-video-container.bcd-floating {
    transform: scale(0.3);
  }
}

.bcd-video-container.bcd-floating video,
.bcd-video-container.bcd-floating .video-js,
.bcd-video-container.bcd-floating .vjs-tech {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 8px;
  display: block;
  box-sizing: border-box;
}

.bcd-close-btn {
  display: none;
}

.bcd-video-container.bcd-floating .bcd-close-btn {
  display: block;
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255, 255, 255, 0.85);
  color: #000;
  font-size: 14px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
}

.bcd-floating.hidden {
  display: none !important;
}

.bcd-snap-corner {
  transition: top 0.2s, left 0.2s, right 0.2s, bottom 0.2s;
}

.vjs-light-toggle-control i {
  font-size: 16px;
  color: #fff;
}

/* Hide big play button after start */
.video-js.vjs-has-started .vjs-big-play-button {
  display: none !important;
}

/* Hide control bar items in linear mode */
.bcd-video-container[data-linear="yes"] .vjs-control-bar > *:not(.vjs-volume-panel):not(.vjs-light-toggle-control) {
  display: none !important;
}

/* Loading spinner overlay */
.bcd-loading-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.bcd-loading-icon {
  width: 64px;
  height: 64px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  50%  { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile override for PIP */
@media (max-width: 768px) {
  .bcd-floating {
    transition: all 0.3s ease-in-out;
    width: 100vw !important;
    height: auto !important;
    max-width: none;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
  }
}

/* ✅ Robust hide for playlist UI when .bcd-playlist-hidden is applied */
.bcd-playlist-hidden .bcd-playlist,
.bcd-playlist-hidden .bcd-playlist-ui,
.bcd-playlist-hidden .bcd-playlist-item,
.bcd-playlist-hidden .bcd-title {
  opacity: 0 !important;
  pointer-events: none !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  transition: none !important;
}
