.video-player-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.video-wrapper {
  position: relative;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  cursor: pointer;
}

#video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  pointer-events: none;
  z-index: 8;
}
.video-loader .spinner {
  animation: videoSpin 1s linear infinite;
}
@keyframes videoSpin {
  to { transform: rotate(360deg); }
}

.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.2s, opacity 0.2s;
}
.big-play-btn:hover {
  background: var(--colorofdetails);
}

.video-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 20px;
  border-radius: 16px;
  z-index: 10;
  font-size: 1rem;
}
.video-error button {
  background: var(--colorofdetails);
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
}

.video-top-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s;
}
.video-top-title {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s;
}
.video-wrapper.controls-visible .video-top-overlay,
.video-wrapper.controls-visible .video-top-title {
  opacity: 1;
}

.video-controls-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  padding: 40px 16px 12px;
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.video-controls-layer.visible {
  opacity: 1;
  visibility: visible;
}

.progress-container {
  position: relative;
  width: 100%;
  padding: 4px 0;
  cursor: pointer;
}
.video-progress-track {
  position: relative;
  height: 5px;
  background: #afafaf;
  border-radius: 10px;
  transition: height 0.1s;
}
.video-controls-layer:hover .video-progress-track {
  height: 8px;
}
.video-progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255,255,255,0.4);
  border-radius: 10px;
  z-index: 0;
}
.video-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--progress-fill, #f00);
  border-radius: 10px;
  z-index: 1;
}
.video-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: var(--progress-fill, #ff164b);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.2s;
}
.video-controls-layer:hover .video-progress-handle {
  opacity: 1;
}

.time-tooltip {
  position: absolute;
  top: -28px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  display: none;
}

.controls-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-ctrl-btn:hover {
  background: rgba(255,255,255,0.1);
}
.video-play-pause-btn {
  padding: 6px;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 2px;
}
.mute-btn {
  padding: 8px;
}
.volume-slider {
  width: 0;
  overflow: hidden;
  transition: width 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.3);
}
.volume-container:hover .volume-slider,
.volume-slider:focus {
  width: 80px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -5px;
}
.volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}
.volume-slider {
  background: transparent;
}

.time-labels {
  font-size: 13px;
  color: white;
  margin-left: 8px;
  white-space: nowrap;
}

.speed-btn {
  position: relative;
}
.speed-label {
  font-size: 14px;
  font-weight: 600;
}
.speed-menu {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 10px;
  background: rgba(28,28,28,0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 5px 0;
  min-width: 70px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 20;
}
.speed-option {
  padding: 5px 10px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.1s;
  text-align: center;
}
.speed-option:hover {
  background: rgba(255,255,255,0.1);
}
.speed-option.active {
  color: var(--progress-fill);
  font-weight: bold;
}

.pip-btn.active {
  color: var(--colorofdetails, #f00);
}

.video-description {
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: var(--shadow);
}

@media (max-width: 600px) {
  .video-player-container {
    padding: 10px;
  }
  .video-wrapper {
    border-radius: 12px;
  }
  .controls-bottom {
    gap: 4px;
  }
  .controls-left,
  .controls-right {
    gap: 2px;
  }
  .time-labels {
    font-size: 11px;
    margin-left: 4px;
  }
  .volume-container:hover .volume-slider,
  .volume-slider:focus {
    width: 50px;
  }
  .video-top-title {
    font-size: 0.9rem;
    left: 10px;
    right: 10px;
  }
}
