/*
 * DT240 static video player.
 *
 * The browser's native mobile controls often hide the timeline when the video
 * is narrow. This player keeps the compact DT240 video size, but adds a custom
 * responsive control bar with a permanent scrubber at the bottom.
 */

.dt240-video-player {
  --dt240-video-accent: #2980b9;
  position: relative;
  display: inline-block;
  width: min(100%, var(--dt240-video-width, 240px));
  max-width: 100%;
  line-height: 0;
  touch-action: manipulation;
}

.dt240-video-player__video {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
}

.dt240-video-player__controls {
  display: none;
}

.dt240-video-player.is-enhanced .dt240-video-player__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 52px;
  padding: 0 6px 3px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.72),
    rgba(0, 0, 0, 0.54) 65%,
    rgba(0, 0, 0, 0.16)
  );
  box-sizing: border-box;
  line-height: 1;
}

.dt240-video-player__control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
}

.dt240-video-player__button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: transparent;
  font-family: Arial, "Segoe UI Symbol", sans-serif;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.dt240-video-player__button:hover,
.dt240-video-player__button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.dt240-video-player__play {
  font-size: 1.75rem;
}

.dt240-video-player__fullscreen {
  font-size: 1.6rem;
}

.dt240-video-player__time {
  flex: 0 0 auto;
  min-width: 3.1em;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  font-variant-numeric: tabular-nums;
}

.dt240-video-player__spacer {
  flex: 1 1 auto;
  min-width: 4px;
}

.dt240-video-player__timeline {
  --dt240-video-progress: 0%;
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  touch-action: pan-x;
}

.dt240-video-player__timeline:focus {
  outline: none;
}

.dt240-video-player__timeline:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 3px;
}

.dt240-video-player__timeline::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--dt240-video-accent) 0%,
    var(--dt240-video-accent) var(--dt240-video-progress),
    rgba(255, 255, 255, 0.7) var(--dt240-video-progress),
    rgba(255, 255, 255, 0.7) 100%
  );
}

.dt240-video-player__timeline::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 3px solid var(--dt240-video-accent);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.dt240-video-player__timeline::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.dt240-video-player__timeline::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--dt240-video-accent);
}

.dt240-video-player__timeline::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 3px solid var(--dt240-video-accent);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.dt240-video-player:fullscreen,
.dt240-video-player:-webkit-full-screen,
.dt240-video-player.is-fullscreen {
  --dt240-video-fullscreen-controls-height: 76px;
  --dt240-video-fullscreen-width: min(
    100vw,
    calc((100vh - var(--dt240-video-fullscreen-controls-height) - env(safe-area-inset-top)) * 0.666667)
  );
  width: 100vw;
  height: 100vh;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  box-sizing: border-box;
  background: rgba(245, 247, 250, 0.38);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

.dt240-video-player:fullscreen::backdrop {
  background: rgba(245, 247, 250, 0.56);
  backdrop-filter: blur(14px) saturate(1.15);
}

.dt240-video-player:-webkit-full-screen::backdrop {
  background: rgba(245, 247, 250, 0.56);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

@supports (height: 100dvh) {
  .dt240-video-player:fullscreen,
  .dt240-video-player:-webkit-full-screen,
  .dt240-video-player.is-fullscreen {
    --dt240-video-fullscreen-width: min(
      100dvw,
      calc((100dvh - var(--dt240-video-fullscreen-controls-height) - env(safe-area-inset-top)) * 0.666667)
    );
    width: 100dvw;
    height: 100dvh;
  }
}

.dt240-video-player:fullscreen .dt240-video-player__video,
.dt240-video-player:-webkit-full-screen .dt240-video-player__video,
.dt240-video-player.is-fullscreen .dt240-video-player__video {
  flex: 0 1 auto;
  width: var(--dt240-video-fullscreen-width);
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - var(--dt240-video-fullscreen-controls-height) - env(safe-area-inset-top));
  object-fit: contain;
  object-position: center top;
}

@supports (height: 100dvh) {
  .dt240-video-player:fullscreen .dt240-video-player__video,
  .dt240-video-player:-webkit-full-screen .dt240-video-player__video,
  .dt240-video-player.is-fullscreen .dt240-video-player__video {
    max-width: 100dvw;
    max-height: calc(100dvh - var(--dt240-video-fullscreen-controls-height) - env(safe-area-inset-top));
  }
}

.dt240-video-player:fullscreen .dt240-video-player__controls,
.dt240-video-player:-webkit-full-screen .dt240-video-player__controls,
.dt240-video-player.is-fullscreen .dt240-video-player__controls {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: var(--dt240-video-fullscreen-width);
  max-width: 100vw;
  min-height: 64px;
  padding: 0 max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82),
    rgba(0, 0, 0, 0.58) 68%,
    rgba(0, 0, 0, 0)
  );
}

.dt240-video-player:fullscreen .dt240-video-player__control-row,
.dt240-video-player:-webkit-full-screen .dt240-video-player__control-row,
.dt240-video-player.is-fullscreen .dt240-video-player__control-row {
  min-height: 44px;
}

.dt240-video-player:fullscreen .dt240-video-player__button,
.dt240-video-player:-webkit-full-screen .dt240-video-player__button,
.dt240-video-player.is-fullscreen .dt240-video-player__button {
  width: 42px;
  height: 42px;
}

.dt240-video-player:fullscreen .dt240-video-player__timeline,
.dt240-video-player:-webkit-full-screen .dt240-video-player__timeline,
.dt240-video-player.is-fullscreen .dt240-video-player__timeline {
  height: 18px;
}

@media (max-width: 480px) {
  .dt240-video-player {
    width: min(100%, var(--dt240-video-width, 240px));
  }

  .dt240-video-player.is-enhanced .dt240-video-player__controls {
    min-height: 54px;
    padding-inline: 5px;
  }

  .dt240-video-player__control-row {
    gap: 6px;
  }

  .dt240-video-player__button {
    width: 32px;
    height: 32px;
  }

  .dt240-video-player__time {
    min-width: 2.8em;
    font-size: 0.95rem;
  }
}
