.video-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-inline: auto;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.05);
}
.top-panel {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  padding: 1rem;
  z-index: 100;
  color: #fff;
  line-height: 1;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95), transparent);
  width: 100%;
  aspect-ratio: 6 / 1;
  z-index: -1;
  pointer-events: none;
}
.subscribe {
  background-color: red;
  color: #fff;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.subscribe svg {
  height: 24px;
  width: auto;
  margin-right: 0.5rem;
}

.video-container.theater,
.video-container.full-screen {
  max-width: initial;
  width: 100%;
}

.video-container.theater {
  max-height: 90vh;
}

.video-container.full-screen {
  max-height: 100vh;
}

video {
  max-width: 100%;
  max-height: 100%;
  border: none;
  outline: none;
  z-index: 0;
}

.video-controls-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: white;
  z-index: 100;
  opacity: 0;
  transition: opacity 150ms ease-in-out;
}

.video-controls-container::before {
  content: '';
  position: absolute;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95), transparent);
  width: 100%;
  aspect-ratio: 6 / 1;
  z-index: -1;
  pointer-events: none;
}

.video-container:hover .video-controls-container,
.video-container:focus-within .video-controls-container,
.video-container.paused .video-controls-container {
  opacity: 1;
}
.video-container.full-screen:hover .top-panel {
  opacity: 1;
}

.video-container.hide {
  cursor: none !important;
}
.video-container.hide .video-controls-container,
.video-container.hide .top-panel {
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

.video-controls-container .controls {
  display: flex;
  gap: 1rem;
  padding: 0.5rem;
  align-items: center;
}

.video-controls-container .controls button {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  height: 30px;
  width: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 150ms ease-in-out;
}

.video-controls-container .controls button:hover {
  opacity: 1;
}

.video-container.paused .pause-icon {
  display: none;
}

.video-container:not(.paused) .play-icon {
  display: none;
}

.video-container.theater .tall {
  display: none;
}

.video-container:not(.theater) .wide {
  display: none;
}

.video-container.full-screen .open {
  display: none;
}

.video-container:not(.full-screen) .close {
  display: none;
}

.volume-high-icon,
.volume-low-icon,
.volume-muted-icon {
  display: none;
}

.video-container[data-volume-level='high'] .volume-high-icon {
  display: block;
}

.video-container[data-volume-level='low'] .volume-low-icon {
  display: block;
}

.video-container[data-volume-level='muted'] .volume-muted-icon {
  display: block;
}

.volume-container {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 0;
  transform-origin: left;
  transform: scaleX(0);
  transition: width 150ms ease-in-out, transform 150ms ease-in-out,
    opacity 150ms ease-in-out;
  margin-left: 0.25rem;
}

.volume-container:hover .volume-slider,
.volume-slider:focus-within {
  width: 100px;
  transform: scaleX(1);
}

.duration-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
  font-size: 0.8rem;
}

.timeline-container {
  height: 7px;
  margin-inline: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.timeline {
  background-color: rgba(100, 100, 100, 0.5);
  height: 3px;
  width: 100%;
  position: relative;
  transition: height 150ms ease-in-out;
  border-radius: 100vw;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: calc(100% - var(--preview-position) * 100%);
  background-color: rgb(150, 150, 150);
  display: none;
  border-radius: 100vw;
}

.timeline::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: calc(100% - var(--progress-position) * 100%);
  background-color: red;
  border-radius: 100vw;
}

.timeline .thumb-indicator {
  --scale: 0;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--scale));
  top: 50%;
  left: calc(var(--progress-position) * 100%);
  background-color: red;
  border-radius: 50%;
  transition: transform 150ms ease-in-out;
  height: 200%;
  aspect-ratio: 1 / 1;
}
.timeline .time-indicator {
  --scale: 0;
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--scale));
  bottom: 100%;
  left: calc(var(--preview-position) * 100%);
  background-color: #111;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  transition: transform 150ms ease-in-out;
  padding: 0.25rem 0.35rem;
  font-size: 0.7rem;
}

.video-container.scrubbing .timeline::before,
.timeline-container:hover .timeline::before {
  display: block;
}

.video-container.scrubbing .thumb-indicator,
.timeline-container:hover .thumb-indicator,
.video-container.scrubbing .time-indicator,
.timeline-container:hover .time-indicator {
  --scale: 1;
}

.video-container.scrubbing .timeline,
.timeline-container:hover .timeline {
  height: 100%;
}
@media only screen and (max-width: 1024px) {
  .video-container .timeline::before {
    display: block;
  }

  .video-container .thumb-indicator {
    --scale: 1;
  }

  .video-container .timeline {
    height: 100%;
  }
}
