/* DLUX Video Player Global Styles */
/* Site-wide Video.js customizations and fixes */

/* Fix black bar issue - remove margins from video element */
.dlux-video-player .vjs-tech {
  margin: 0 !important;
  top: 0 !important;
  left: 0 !important;
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
}

/* Ensure video container fills space properly and contains absolutely positioned elements */
.dlux-video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9; /* Provide proper aspect ratio for height reference */
  height: auto;
}

.dlux-video-player .video-js {
  background-color: #000;
  width: 100% !important;
  height: 100% !important;
  position: absolute;
  top: 0;
  left: 0;
}

/* Fix poster and text track positioning */
.dlux-video-player .vjs-poster,
.dlux-video-player .vjs-text-track-display {
  top: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
}

/* DLUX Dark Theme Customizations */
.dlux-video-player .vjs-control-bar {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
  height: 3em;
}

.dlux-video-player .vjs-button > .vjs-icon-placeholder:before {
  font-size: 1.8em;
  line-height: 1.67;
}

.vjs-menu-button-popup .vjs-menu ul { 
  padding: 0 !important;
  margin: 0 !important;
  list-style: none !important; 
}

.vjs-menu-button-popup .vjs-menu ul li {
  margin: 0 !important;
}

.vjs-quality-selector .vjs-menu-item {
  color: #adb5bd;
  padding: 0.5em 1em;
}

.vjs-quality-selector .vjs-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.vjs-quality-selector .vjs-menu-item.vjs-selected {
  background-color: #dc3545;
  color: #fff;
}

/* Big Play Button */
.vjs-big-play-button {
  background-color: rgba(17, 18, 34, 0.8) !important;
  border: 2px solid #dc3545 !important;
  border-radius: 50% !important;
  width: 80px !important;
  height: 80px !important;
  line-height: 80px !important;
  margin: -40px 0 0 -40px !important;
}

.vjs-big-play-button:hover {
  background-color: #dc3545 !important;
  border-color: #dc3545 !important;
}

/* Loading Spinner */
.vjs-loading-spinner {
  border-color: #dc3545 !important;
}

/* Progress Bar */
.vjs-play-progress {
  background-color: #dc3545 !important;
}

.vjs-load-progress {
  background-color: rgba(255, 255, 255, 0.3) !important;
}

.vjs-progress-control:hover .vjs-progress-holder {
  font-size: 1.2em;
}

/* Volume Bar */
.vjs-volume-level {
  background-color: #dc3545;
}

/* Time Display */
vjs-current-time,
vjs-duration,
.vjs-time-divider {
  display: block;
  padding: 0 0.5em;
}

/* Fullscreen Button */
.vjs-fullscreen-control {
  position: absolute;
  right: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .vjs-control-bar {
    height: 2.5em;
  }
  
  .vjs-button > .vjs-icon-placeholder:before {
    font-size: 1.5em;
  }
  
  .vjs-big-play-button {
    width: 60px;
    height: 60px;
    line-height: 60px;
    margin: -30px 0 0 -30px;
  }
  
  /* Hide some controls on mobile */
  .vjs-playback-rate,
  .vjs-chapters-button {
    display: none;
  }
}

/* Editor-specific styles */
.tiptap .dlux-video-player {
  margin-bottom: 0rem;
}

/* SPK Drive preview modal styles */
.modal .dlux-video-player .video-js {
  max-height: 80vh;
}

/* Blog post video styles */
.blog-content .dlux-video-player {
  margin: 1.5rem 0;
}

/* Ensure proper aspect ratio */
.dlux-video-player.vjs-fluid,
.dlux-video-player.vjs-16-9,
.dlux-video-player.vjs-4-3 {
  padding-top: 0 !important;
}

/* Fix for IPFS videos */
.dlux-video-player video[src*="ipfs"] {
  object-fit: contain;
}

