/* ===========================
   Video.js Custom Player Setup 01 Style
   =========================== */

/* Wrapper */
.oniric-video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  /* Keep a nice ratio even while loading */
  aspect-ratio: 16/9;
}

/* Make Video.js player fill wrapper */
.oniric-video-wrapper .vjs-oniric {
  width: 100%;
  height: 100%;
  position: relative; /* allow absolutely positioned overlays within player root */
}
.oniric-video-wrapper .vjs-tech {
  object-fit: cover;
}
/* Ensure poster fully covers */
.oniric-video-wrapper .vjs-poster {
  background-size: cover !important;
  background-position: center center !important;
}

/* In fullscreen, fit the entire video inside the screen (no cropping) */
.oniric-video-wrapper.is-fullscreen .vjs-tech,
.oniric-video-wrapper:fullscreen .vjs-tech,
.oniric-video-wrapper .vjs-fullscreen .vjs-tech,
.vjs-fullscreen .vjs-tech {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
  background-color: #000; /* avoid borders showing page bg */
}

/* Hide default Video.js UI – we use custom controls */
.oniric-video-wrapper .vjs-control-bar,
.oniric-video-wrapper .vjs-big-play-button {
  display: none !important;
}

/* Controls bar */
.oniric-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  /* Subtle gradient like the screenshot */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.65) 45%, rgba(0,0,0,0.8) 100%);
  user-select: none;
  z-index: 4;
  opacity: 1;
  transition: opacity .25s ease;
}

.oniric-controls .spacer {
  flex: 1 1 auto;
}

/* Time label */
.oniric-time {
  font-size: 14px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
  min-width: 48px;
  text-align: left;
  margin: 0 6px 0 2px;
}

/* Non-interactive progress bar */
.oniric-progress {
  position: relative;
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  overflow: hidden;
  pointer-events: none; /* show only, do not allow scrubbing */
}
.oniric-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255,255,255,0.35);
}

/* Buttons */
.oniric-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .06s ease-in-out;
}
.oniric-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.oniric-btn:active {
  transform: scale(0.98);
}
.oniric-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  margin: auto;
  flex-shrink: 0;
}

/* Play/Pause icon toggle */
.oniric-video-wrapper:not(.is-playing) .icon-pause { display: none; }
.oniric-video-wrapper.is-playing .icon-play { display: none; }

/* Mute icon toggle */
.oniric-video-wrapper.is-muted .icon-volume { display: none; }
.oniric-video-wrapper:not(.is-muted) .icon-volume-off { display: none; }

/* Fullscreen icon toggle */
.oniric-video-wrapper.is-fullscreen .icon-enterfs { display: none; }
.oniric-video-wrapper:not(.is-fullscreen) .icon-exitfs { display: none; }

/* Settings menu */
.oniric-settings-pop {
  position: absolute;
  bottom: 54px;
  right: 14px;
  min-width: 220px;
  color: #fff;
  z-index: 5;
  padding: 0;
  background: transparent;
  border: 0;
}
.oniric-settings-pop[hidden] { display: none; }

.oniric-settings-panel {
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  min-width: 280px;
  width: 360px;
  max-width: calc(100vw - 28px);
  overflow: hidden;
}
.oniric-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.oniric-settings-header .js-settings-close { margin-left: auto; }
.settings-nav-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
}
.settings-nav-btn[hidden] { display: none !important; }
.oniric-settings-titlebar {
  letter-spacing: .02em;
  font-size: 16px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.oniric-settings-view {
  padding: 10px;
}
.oniric-settings-row {
  width: 100%;
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.row-left {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.row-left svg { opacity: .9; width: 28px; height: 28px; }
.row-label { font-size: 16px; line-height: 1; display: inline-flex; align-items: center; margin-right: auto; flex: 1 1 auto; }
.row-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: .9;
  font-size: 14px;
  margin-left: 12px;
  flex-shrink: 0;
  text-align: right;
}
.row-chevron { opacity: .7; }

/* Mobile/tablet modal style */
@media (max-width: 768px) {
  .oniric-settings-pop {
    position: absolute;
    inset: 0; /* cover only the video wrapper */
    display: grid;
    place-items: center;
    padding: 16px;
    z-index: 6;
  }
  .oniric-settings-pop::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10,16,24,0.45);
    backdrop-filter: blur(8px);
    z-index: 0;
    border-radius: inherit;
  }
  .oniric-settings-panel {
    width: min(92%, 420px);
    max-height: 80%;
    overflow: auto;
    position: relative;
    z-index: 1;
  }
}

.oniric-settings-group + .oniric-settings-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.15);
}
.oniric-settings-title {
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 6px;
}
.oniric-list {
  display: grid;
  grid-auto-rows: 34px;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.oniric-list button {
  width: 100%;
  height: 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.oniric-list button:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
}
.oniric-list button.is-active {
  background: rgba(0, 160, 255, 0.22);
  border-color: rgba(0, 160, 255, 0.5);
}
.oniric-list button.is-active::after {
  content: "✓";
  margin-left: auto;
  opacity: 0.95;
}

/* Make sure controls stay visible on fullscreen */
.oniric-video-wrapper:fullscreen .oniric-controls {
  padding-bottom: 16px;
}

/* Accessibility focus style */
.oniric-btn:focus-visible,
.oniric-list button:focus-visible {
  outline: 2px solid rgba(0,160,255,0.9);
  outline-offset: 2px;
}

/* Fade out / hide controls and cursor when idle or not hovered */
.oniric-video-wrapper.controls-hidden .oniric-controls {
  opacity: 0;
  pointer-events: none;
}
.oniric-video-wrapper.cursor-hidden {
  cursor: none;
}

/* Volume popover */
.oniric-volume { position: relative; }
.oniric-volume-pop {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,16,24,0.9);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  z-index: 6;
}
.oniric-volume-pop[hidden] { display: none; }
.oniric-volume-rail {
  position: relative;
  width: 6px;
  height: 110px;
  border-radius: 999px;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
}
.oniric-volume-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: #ffffff;
  border-radius: 999px;
}
.oniric-volume-thumb {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  bottom: 0;
}

/* Disabled mute button if no audio present */
.oniric-video-wrapper.is-audio-absent .js-mute {
  opacity: 0.4;
  pointer-events: none;
}
.oniric-video-wrapper.is-audio-absent .oniric-volume {
  opacity: 0.4;
  pointer-events: none;
}

/* Default: audio controls disabled until audio confirmed */
.oniric-volume,
.oniric-btn.js-mute {
  opacity: 0.4;
  pointer-events: none;
}
.oniric-video-wrapper.has-audio .oniric-volume,
.oniric-video-wrapper.has-audio .js-mute {
  opacity: 1;
  pointer-events: auto;
}