/* ===== Видеоплеер on-records.ru ===== */

.videoplayer {
  --vp-controls-h: 35px;
  /* Высота обложки в плейлисте — фиксированная (как на широком экране); плейлист растёт по высоте */
  --vp-cover-h: 72px;

  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;

  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  color: #ffffff;
  user-select: none;
  -webkit-user-select: none;
}

.videoplayer *,
.videoplayer *::before,
.videoplayer *::after {
  box-sizing: border-box;
}

.videoplayer button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.videoplayer button:focus-visible,
.videoplayer .vp-seek:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.videoplayer [hidden] {
  display: none !important;
}

/* ===== Верхняя часть: экран + полоса управления ===== */

.vp-stage {
  position: relative;
  flex: none;
}

.vp-screen {
  position: relative;
  width: 100%;
  aspect-ratio: 12 / 5;
  background: #000000;
}

.vp-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
  cursor: pointer;
}

/* Кнопка «воспроизвести» в центре экрана */
.vp-bigplay {
  position: absolute;
  inset: 0;
  width: 84px;
  height: 84px;
  margin: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(37, 70, 77, 0.8) !important;
  border: 2px solid #ffffff !important;
  transition: transform 0.2s ease;
}

.vp-bigplay svg {
  width: 32px;
  height: 32px;
  margin-left: 5px;
  fill: #ffffff;
}

.vp-bigplay:hover {
  transform: scale(1.15);
}

.videoplayer.is-playing .vp-bigplay {
  display: none;
}

/* Полоса управления */
.vp-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--vp-controls-h);
  padding: 0 14px;
  background: rgba(37, 70, 77, 0.8);
}

.vp-toggle {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.vp-toggle svg {
  width: 14px;
  height: 14px;
  fill: #ffffff;
}

.vp-toggle .vp-ico-pause,
.videoplayer.is-playing .vp-toggle .vp-ico-play {
  display: none;
}

.videoplayer.is-playing .vp-toggle .vp-ico-pause {
  display: block;
}

.vp-time {
  flex: none;
  min-width: 2.6ch;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Полоса прокрутки: слева от точки белая, справа светло-серая */
.vp-seek {
  --p: 0;
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 16px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background:
    linear-gradient(
      to right,
      #ffffff calc(6px + (100% - 12px) * var(--p)),
      #c4c4c4 calc(6px + (100% - 12px) * var(--p))
    )
    center / 100% 4px no-repeat;
}

.vp-seek::-webkit-slider-runnable-track {
  height: 16px;
  background: transparent;
}

.vp-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

.vp-seek::-moz-range-track {
  height: 16px;
  background: transparent;
}

.vp-seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
}

/* Кнопка «полный экран» — маленькая белая квадратная рамка */
.vp-full {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.vp-fullicon {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
}

/* ===== Полноэкранный режим ===== */

.videoplayer.is-fs .vp-stage {
  width: 100%;
  height: 100%;
  background: #000000;
}

.videoplayer.is-fs .vp-screen {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* Разворачивание на всё окно браузера (без системного полного экрана) */
.videoplayer.is-fs-fixed {
  overflow: visible;
}

.videoplayer.is-fs-fixed .vp-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 2147483647;
  background: #000000;
}

html.vp-noscroll,
html.vp-noscroll body {
  overflow: hidden !important;
}

.videoplayer.is-fs .vp-video {
  position: relative;
  z-index: 0;
}

/* Полоса всегда на своём композитном слое поверх видео (иначе при аппаратном
   ускорении видео может перекрывать её). Прячем через opacity, а не transform. */
.videoplayer.is-fs .vp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateZ(0);
  will-change: opacity;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.videoplayer.is-fs .vp-stage.vp-show .vp-controls {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.videoplayer.is-fs .vp-bigplay {
  z-index: 5;
}

/* ===== Нижняя часть: плейлист ===== */

.vp-list {
  position: relative;
  flex: none;
  background: rgba(25, 45, 53, 0.5);
}

.vp-track {
  display: flex;
  gap: 14px;
  padding: 8px 14px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.vp-track::-webkit-scrollbar {
  display: none;
}

.vp-item {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.vp-item:hover,
.vp-item.is-active {
  opacity: 1;
}

.vp-cover {
  display: block;
  height: var(--vp-cover-h);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(37, 70, 77, 0.6);
}

.vp-item.is-active .vp-cover {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.vp-title {
  height: 36px;
  margin-top: 4px;
  font-size: 15px;
  line-height: 18px;
  text-align: left;
  white-space: nowrap;
}

/* Кнопки промотки плейлиста */
.vp-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 38px;
}

.vp-arrow svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vp-arrow-left {
  left: 0;
  justify-content: flex-start;
  padding-left: 6px !important;
  background: linear-gradient(to right, rgba(25, 45, 53, 0.95), rgba(25, 45, 53, 0)) !important;
}

.vp-arrow-right {
  right: 0;
  justify-content: flex-end;
  padding-right: 6px !important;
  background: linear-gradient(to left, rgba(25, 45, 53, 0.95), rgba(25, 45, 53, 0)) !important;
}

@media (prefers-reduced-motion: reduce) {
  .vp-bigplay,
  .vp-item,
  .vp-controls {
    transition: none !important;
  }
  .vp-track {
    scroll-behavior: auto;
  }
}
