/* Enhanced Video Player - Uscreen.tv Style */
.enhanced-player-wrapper {
  position: relative;
  display: inline-block;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Controls discoverability hint */
.enhanced-player-wrapper::before {
  content: 'Hover for enhanced controls';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 215, 0, 0.9);
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
  z-index: 20;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Hide hint when hovering */
.enhanced-player-wrapper:hover::before {
  opacity: 0;
}

.enhanced-player-wrapper mux-player {
  width: 100%;
  height: 100%;
  display: block;
}

/* Controls Container */
.enhanced-video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 20px;
  color: white;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.enhanced-video-controls:hover {
  opacity: 1 !important;
}

/* Progress Section */
.controls-top {
  margin-bottom: 15px;
}

.video-progress-container {
  width: 100%;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
}

.progress-filled {
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s ease;
  position: relative;
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  width: 0%;
  pointer-events: none;
}

.progress-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background: #FFD700;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.progress-bar:hover .progress-handle {
  opacity: 1;
}

.progress-time {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Controls Bottom */
.controls-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Control Buttons */
.control-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.control-btn:active {
  transform: translateY(0);
}

/* Play/Pause Button */
.play-pause-btn {
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  width: 48px;
  height: 48px;
}

.play-pause-btn:hover {
  background: rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Volume Controls */
.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: #FFD700;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #FFD700;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Time Display */
.time-display {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  min-width: 100px;
}

/* Speed Controls */
.speed-controls,
.quality-controls {
  position: relative;
}

.speed-btn,
.quality-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
}

.speed-text,
.quality-text {
  color: rgba(255, 255, 255, 0.9);
}

.speed-menu,
.quality-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 0;
  margin-bottom: 8px;
  min-width: 80px;
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.speed-option,
.quality-option {
  background: none;
  border: none;
  color: white;
  padding: 8px 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s ease;
}

.speed-option:hover,
.quality-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Chapter Navigation */
.chapter-navigation {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chapter-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chapter-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 80px;
}

.chapter-item:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 215, 0, 0.4);
}

.chapter-title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.chapter-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive Design */
@media (max-width: 768px) {
  .enhanced-video-controls {
    padding: 15px;
  }
  
  .controls-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .controls-right {
    gap: 8px;
  }
  
  .volume-slider {
    width: 40px;
  }
  
  .time-display {
    font-size: 12px;
    min-width: 80px;
  }
  
  .chapter-list {
    gap: 6px;
  }
  
  .chapter-item {
    min-width: 60px;
    padding: 6px 8px;
  }
  
  .chapter-title {
    font-size: 10px;
  }
  
  .chapter-time {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .controls-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  
  .controls-left {
    justify-content: center;
  }
  
  .controls-right {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .time-display {
    text-align: center;
  }
}

/* Loading States */
.enhanced-player-wrapper.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #FFD700;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 5;
}

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

/* Fullscreen Styles */
.enhanced-player-wrapper:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.enhanced-player-wrapper:fullscreen .enhanced-video-controls {
  padding: 30px;
}

.enhanced-player-wrapper:fullscreen .control-btn {
  min-width: 50px;
  min-height: 50px;
}

.enhanced-player-wrapper:fullscreen .play-pause-btn {
  width: 60px;
  height: 60px;
}

/* Progress Tracker Styles */
.resume-progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.resume-modal-content {
  background: linear-gradient(135deg, #1a1a1b 0%, #2d2d2e 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 12px;
  padding: 0;
  max-width: 400px;
  width: 90%;
  color: white;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.3s ease;
}

.resume-modal-header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
}

.resume-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--luxury-gold-400), var(--luxury-gold-600));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--luxury-gold-400);
}

.resume-modal-body {
  padding: 0 24px 20px;
  text-align: center;
}

.resume-modal-body p {
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.resume-modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.resume-modal-footer .btn {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--luxury-gold-500), var(--luxury-gold-600));
  color: #050505;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--luxury-gold-400), var(--luxury-gold-500));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* Bookmark Toast */
.bookmark-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #1a1a1b 0%, #2d2d2e 100%);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  padding: 16px 20px;
  color: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 10001;
  max-width: 300px;
}

.bookmark-toast.show {
  transform: translateX(0);
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toast-content span {
  font-weight: 500;
  font-size: 14px;
}

.toast-content small {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-style: italic;
}

/* Bookmark Button */
.bookmark-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: white;
  cursor: pointer;
  padding: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.bookmark-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-1px);
}

/* Video Progress Indicators */
.video-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.video-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
  width: var(--progress, 0%);
  transition: width 0.3s ease;
}

.completion-status {
  font-size: 12px;
  font-weight: 600;
  color: #4CAF50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.completion-status:not(.completed) {
  color: rgba(255, 255, 255, 0.6);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* ENHANCED VISIBILITY STYLES - Added for Better User Experience */

/* Make controls more prominent with luxury theme */
.enhanced-video-controls {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%) !important;
  padding: 25px 20px 15px !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Larger, more visible control buttons */
.control-btn {
  min-width: 45px !important;
  min-height: 45px !important;
  padding: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-radius: 50% !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 2px solid rgba(255, 215, 0, 0.4) !important;
}

.control-btn:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: rgba(255, 215, 0, 0.8) !important;
  transform: scale(1.15) translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3) !important;
}

/* More prominent play/pause button with luxury accent */
.play-pause-btn {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 165, 0, 0.9)) !important;
  border: 2px solid rgba(255, 215, 0, 0.7) !important;
  min-width: 55px !important;
  min-height: 55px !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4) !important;
}

.play-pause-btn:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 1), rgba(255, 165, 0, 1)) !important;
  transform: scale(1.2) translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6) !important;
}

/* Speed and Quality buttons with more visible text */
.speed-btn, .quality-btn {
  min-width: 65px !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border: 2px solid rgba(255, 215, 0, 0.4) !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.5px !important;
}

.speed-text, .quality-text {
  color: rgba(255, 215, 0, 0.95) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Thicker progress bar with more visible gold gradient */
.progress-bar {
  height: 8px !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 215, 0, 0.3) !important;
  border-radius: 4px !important;
  margin-bottom: 12px !important;
}

.progress-filled {
  background: linear-gradient(90deg, #FFD700 0%, #FFA500 30%, #FFD700 60%, #FFA500 100%) !important;
  background-size: 200% 100% !important;
  animation: shimmer 2s infinite !important;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5) !important;
}

/* Larger, more visible progress handle */
.progress-handle {
  width: 20px !important;
  height: 20px !important;
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  border: 3px solid white !important;
  box-shadow: 0 3px 12px rgba(255, 215, 0, 0.6) !important;
}

/* Bigger time display with better contrast */
.time-display, .current-time, .duration {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: rgba(255, 215, 0, 0.95) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7) !important;
  letter-spacing: 0.5px !important;
}

/* Volume slider with luxury styling */
.volume-slider {
  height: 6px !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border: 1px solid rgba(255, 215, 0, 0.3) !important;
  width: 80px !important;
}

.volume-slider::-webkit-slider-thumb {
  width: 16px !important;
  height: 16px !important;
  background: linear-gradient(135deg, #FFD700, #FFA500) !important;
  border: 2px solid white !important;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6) !important;
}

/* PiP and Fullscreen buttons with high contrast */
.pip-btn, .fullscreen-btn {
  background: rgba(0, 0, 0, 0.6) !important;
  border: 2px solid rgba(255, 215, 0, 0.4) !important;
}

.pip-btn:hover, .fullscreen-btn:hover {
  background: rgba(255, 215, 0, 0.2) !important;
  border-color: rgba(255, 215, 0, 0.8) !important;
}

/* Speed and Quality menu items with luxury hover */
.speed-option:hover, .quality-option:hover {
  background: rgba(255, 215, 0, 0.15) !important;
  color: rgba(255, 215, 0, 0.95) !important;
}

.speed-option.active, .quality-option.active {
  background: rgba(255, 215, 0, 0.25) !important;
  color: rgba(255, 215, 0, 0.95) !important;
  font-weight: 700 !important;
  border-left: 3px solid #FFD700 !important;
}

/* Scrollbar styling for menus */
.speed-menu::-webkit-scrollbar, .quality-menu::-webkit-scrollbar {
  width: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.speed-menu::-webkit-scrollbar-thumb, .quality-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.6);
  border-radius: 4px;
}

/* Bookmark button styling */
.bookmark-btn {
  background: rgba(255, 215, 0, 0.1) !important;
  border: 2px solid rgba(255, 215, 0, 0.5) !important;
  border-radius: 6px !important;
  color: rgba(255, 215, 0, 0.95) !important;
  padding: 10px !important;
  font-size: 18px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.bookmark-btn:hover {
  background: rgba(255, 215, 0, 0.25) !important;
  border-color: rgba(255, 215, 0, 0.9) !important;
  transform: scale(1.15) !important;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4) !important;
}

/* Shimmer animation for progress bar */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Hover effects for all controls */
.enhanced-player-wrapper:hover .enhanced-video-controls {
  opacity: 1 !important;
}

/* Mobile optimization for better tap targets */
@media (max-width: 768px) {
  .control-btn {
    min-width: 50px !important;
    min-height: 50px !important;
  }

  .play-pause-btn {
    min-width: 60px !important;
    min-height: 60px !important;
  }

  .speed-menu, .quality-menu {
    min-width: 100px !important;
  }
}

/* High contrast mode enhancements */
@media (prefers-contrast: high) {
  .enhanced-video-controls {
    background: rgba(0, 0, 0, 0.98) !important;
    border-top: 2px solid #FFD700 !important;
  }

  .control-btn {
    border-width: 3px !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Hide enhanced controls on small preview thumbnails */
.lesson-thumb-wrapper .enhanced-video-controls {
  display: none !important;
}

.lesson-thumb-wrapper mux-player {
  pointer-events: auto !important;
}

/* Hide enhanced controls on small videos (<400px width) */
@media (max-width: 400px) {
  .enhanced-player-wrapper {
    background: transparent !important;
  }

  .enhanced-player-wrapper .enhanced-video-controls {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .enhanced-player-wrapper:hover .enhanced-video-controls {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

/* Hide enhanced controls on lesson thumbnail previews */
.lesson-thumb-wrapper .enhanced-video-controls {
  display: none !important;
}

/* Ensure modal video has full enhanced controls */
.modal .enhanced-video-controls {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .enhanced-video-controls {
    background: rgba(0, 0, 0, 0.95);
  }
  
  .control-btn {
    border: 2px solid white;
  }
  
  .progress-bar {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid white;
  }
  
  .progress-filled {
    background: white;
  }
  
  .progress-handle {
    background: white;
    border-color: black;
  }
  
  .resume-modal-content {
    background: black;
    border: 2px solid white;
  }
  
  .bookmark-toast {
    background: black;
    border: 2px solid white;
  }
}
