/* Кастомная панель управления нативного видео (лендинг): тёмная полоса, белые иконки и текст */

.video-wrap {
  position: relative;
}

.video-wrap video {
  cursor: pointer;
}

/* Заставка при первой загрузке: видна до начала воспроизведения */
.video-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: opacity 0.25s ease;
}

.video-poster-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  cursor: default;
}

/* Когда заставка видна — скрываем панель управления, но само видео остаётся видимым под полупрозрачным слоем */
.video-wrap.poster-visible .video-custom-controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.video-poster-overlay-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.9);
  font-size: 48px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
  padding: 0;
  padding-left: 1%;
  box-sizing: border-box;
}

.video-custom-controls {
  font-size: 16px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5.3em;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
  color: #fff;
  z-index: 2;
}

/* Размер иконок в панели управления (play, громкость, PiP, fullscreen) */
.vjs-button > .vjs-icon-placeholder:before {
  font-size: 2.16em;
  line-height: 2.16;
}

/* На широком плеере (layout large) — чуть меньше */
.video-js.vjs-layout-large .vjs-button > .vjs-icon-placeholder:before {
  font-size: 2.04em;
  line-height: 2.4;
}

/* То же для кастомной панели (SVG-иконки) */
.video-ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 4px;
  box-sizing: border-box;
  line-height: 2.16;
}

.video-ctrl-btn svg {
  display: block;
  width: 2.16em;
  height: 2.16em;
  min-width: 2.16em;
  min-height: 2.16em;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .video-custom-controls .video-ctrl-btn {
    line-height: 2.4;
  }
  .video-custom-controls .video-ctrl-btn svg {
    width: 2.04em;
    height: 2.04em;
    min-width: 2.04em;
    min-height: 2.04em;
  }
}

.video-ctrl-btn:hover,
.video-ctrl-btn:focus {
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 1em #fff;
  outline: none;
}

.video-ctrl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Громкость: по умолчанию свёрнута (только иконка), при наведении выезжает слайдер; выровнена по высоте с баром воспроизведения */
.video-ctrl-volume {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 4px;
  position: relative;
}

/* Дополнительный отступ справа, когда слайдер громкости раскрыт */
.video-ctrl-volume:hover {
  margin-right: 20px;
}

.video-ctrl-volume-range {
  width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  height: 6px;
  margin: 0;
  vertical-align: middle;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #fff 0%, #fff var(--volume-pct, 0%), rgba(255, 255, 255, 0.25) var(--volume-pct, 0%) 100%);
  border-radius: 10px;
  cursor: pointer;
  transition: max-width 0.2s ease, opacity 0.2s ease;
}

.video-ctrl-volume:hover .video-ctrl-volume-range {
  max-width: 83px;
  width: 83px;
  opacity: 1;
}

.video-ctrl-volume-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.video-ctrl-volume-tooltip[data-at-cursor="true"] {
  right: auto;
}

/* Показывать % громкости только при наведении на слайдер, не на иконку */
.video-ctrl-volume.volume-slider-hover .video-ctrl-volume-tooltip {
  opacity: 1;
}

/* Обёртка слайдера громкости для полоски при наведении */
.video-ctrl-volume-range-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

.video-ctrl-volume-hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  visibility: hidden;
}

.video-ctrl-volume.volume-slider-hover .video-ctrl-volume-hover {
  visibility: visible;
}

.video-ctrl-volume-hover-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 8px;
  background: #000;
  border-radius: 0;
  left: 0;
}

.video-ctrl-volume-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.video-ctrl-volume-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: none;
  cursor: pointer;
}

/* Прогресс + время */
.video-ctrl-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  max-width: 85%;
}

.video-ctrl-progress-track {
  flex: 1;
  height: 0.2em;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
}

.video-ctrl-progress-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  width: 0%;
}

.video-ctrl-progress-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background-color: #fff;
  border-radius: 10px;
  width: 0%;
}

.video-ctrl-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  margin-top: -6px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
}

/* При наведении на прогресс: подсказка с временем в точке курсора + точка */
.video-ctrl-progress-hover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  visibility: hidden;
}

.video-ctrl-progress-track:hover .video-ctrl-progress-hover {
  visibility: visible;
}

.video-ctrl-progress-hover-time {
  position: absolute;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
  left: 0;
}

.video-ctrl-progress-hover-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 8px;
  background: #000;
  border-radius: 0;
  left: 0;
}

.video-ctrl-time {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
}

.video-ctrl-time-sep {
  margin: 0 2px;
  opacity: 0.8;
}

/* Скорость */
.video-ctrl-speed-wrap {
  position: relative;
}

.video-ctrl-speed-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  width: 44px;
  height: 44px;
  top: -41%;
}

.video-ctrl-speed-value {
  font-size: 16px;
  line-height: 1.15;
  color: #fff;
}

.video-ctrl-speed-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  padding: 4px;
  background: rgba(51, 51, 51, 0.9);
  border-radius: 7px;
  display: none;
  flex-direction: column;
  min-width: 60px;
}

.video-ctrl-speed-menu[aria-hidden="false"] {
  display: flex;
}

.video-ctrl-speed-menu button {
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
  cursor: pointer;
  border-radius: 5px;
  text-align: left;
}

.video-ctrl-speed-menu button:hover,
.video-ctrl-speed-menu button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: #fff;
}

/* Узкий экран: громкость в одну иконку */
@media (max-width: 576px) {
  .video-custom-controls {
    height: 44px;
    padding: 0 10px;
    gap: 4px;
  }
  .video-ctrl-volume:hover .video-ctrl-volume-range {
    max-width: 64px;
    width: 64px;
  }
  .video-ctrl-volume-range {
    display: block;
  }
  .video-ctrl-time {
    font-size: 12px;
  }
  .video-ctrl-speed-value {
    font-size: 12px;
  }
}
