/* Video Player Custom Styles */

/* Custom slider styles for volume and progress */
.slider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.slider::-webkit-slider-track {
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: #3b82f6;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
  background: #2563eb;
  transform: scale(1.2);
}

.slider::-moz-range-track {
  background: rgba(255, 255, 255, 0.2);
  height: 4px;
  border-radius: 2px;
  border: none;
}

.slider::-moz-range-thumb {
  background: #3b82f6;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
  background: #2563eb;
  transform: scale(1.2);
}

/* Progress bar hover effects */
.group\/progress:hover .slider::-webkit-slider-thumb {
  opacity: 1;
}

.group\/progress:hover .slider::-moz-range-thumb {
  opacity: 1;
}

/* Danmaku animation styles */
.danmaku-message {
  animation: danmaku-scroll 8s linear infinite;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

@keyframes danmaku-scroll {
  from {
    transform: translateX(100vw);
  }
  to {
    transform: translateX(-100%);
  }
}

/* Video player container responsive */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Custom scrollbar for comments */
.comments-container {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e0 #f7fafc;
}

.comments-container::-webkit-scrollbar {
  width: 6px;
}

.comments-container::-webkit-scrollbar-track {
  background: #f7fafc;
  border-radius: 3px;
}

.comments-container::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 3px;
}

.comments-container::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Keyboard shortcut styles */
kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #24292e;
  background-color: #fafbfc;
  border: 1px solid #d1d5da;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #d1d5da;
}

/* Fullscreen styles */
.video-player-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: black !important;
}

.video-player-fullscreen video {
  width: 100vw !important;
  height: 100vh !important;
}

/* Loading spinner */
.video-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #3b82f6;
  animation: spin 1s ease-in-out infinite;
}

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

/* Settings panel animations */
.settings-panel {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Comment input focus styles */
.comment-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Danmaku input styles */
.danmaku-input {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Video overlay gradient */
.video-overlay {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    transparent 20%,
    transparent 80%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

/* Hover effects for buttons */
.video-button {
  transition: all 0.2s ease;
}

.video-button:hover {
  transform: scale(1.05);
}

.video-button:active {
  transform: scale(0.95);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .video-controls {
    padding: 12px;
  }
  
  .video-controls button {
    padding: 8px;
  }
  
  .danmaku-message {
    font-size: 14px;
  }
  
  .settings-panel {
    right: 0;
    left: 0;
    margin: 0 12px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .slider::-webkit-slider-track {
    background: rgba(255, 255, 255, 0.8);
  }
  
  .danmaku-message {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 1);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .danmaku-message {
    animation: none;
    position: static;
    display: block;
    margin-bottom: 4px;
  }
  
  .video-button {
    transition: none;
  }
}
