
@import (reference) '../../styles/mixins.less';
@import (reference) '../../styles/variables.less';


.videoPlayerContainer {
  position: relative;
  width: 100%;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

  @media (max-width: 576px) {
    border-radius: 0;
    box-shadow: none;
  }
}

.videoWrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 宽高比 */
}

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

.controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  transition: opacity 0.3s ease;
  opacity: 0;

  // 移动端控制栏始终显示
  @media (max-width: 576px) {
    opacity: 1;
    padding: 12px 16px;
  }
}

.videoPlayerContainer:hover .controls {
  opacity: 1;
}

.progressBar {
  margin-bottom: 12px;
  
  :global(.ant-slider) {
    margin: 0;
  }
  
  :global(.ant-slider-rail) {
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  :global(.ant-slider-track) {
    background-color: @film-amber;
  }
  
  :global(.ant-slider-handle) {
    border-color: @film-amber;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  }
}

.controlButtons {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controlButton {
  color: #fff;
  font-size: 20px;
  padding: 4px;
  
  &:hover {
    color: @film-amber;
    background-color: transparent;
  }
  
  &:focus {
    color: @film-amber;
    background-color: transparent;
  }
}

.timeDisplay {
  color: #fff;
  font-size: 14px;
  margin: 0 16px;
}

.rightControls {
  display: flex;
  align-items: center;
}

.volumeControl {
  position: relative;
  margin-right: 12px;
}

.volumeSlider {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  height: 100px;
  padding: 12px 8px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  
  :global(.ant-slider) {
    height: 80px;
    margin: 0 auto;
  }
}

/* 暗色模式适配 */
:global(.dark) {
  .videoPlayerContainer {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  
  .progressBar {
    :global(.ant-slider-rail) {
      background-color: rgba(255, 255, 255, 0.15);
    }
    
    :global(.ant-slider-track) {
      background-color: #177ddc;
    }
    
    :global(.ant-slider-handle) {
      border-color: #177ddc;
    }
  }
  
  .controlButton {
    &:hover, &:focus {
      color: #177ddc;
    }
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .controls {
    padding: 12px 16px;
  }
  
  .controlButton {
    font-size: 18px;
  }
  
  .timeDisplay {
    font-size: 12px;
    margin: 0 8px;
  }
}

/* 播放暂停大按钮，显示在视频中央 */
.centerPlayButton {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  color: rgba(255, 255, 255, 0.8);
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  padding: 8px;
  display: flex;
  opacity: 0;
  transition: opacity 0.3s ease;
  
  &:hover {
    opacity: 1;
    color: #fff;
  }
}

.videoPlayerContainer:not(:hover) .centerPlayButton {
  opacity: 0;
} 