:root {
  --primary-color: #6315ff;
  --font-color: white;
}

html {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: #e3e3e3;
  background-image: url("data:image/svg+xml,%3Csvg width='48' height='64' viewBox='0 0 48 64' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M48 28v-4L36 12 24 24 12 12 0 24v4l4 4-4 4v4l12 12 12-12 12 12 12-12v-4l-4-4 4-4zM8 32l-6-6 10-10 10 10-6 6 6 6-10 10L2 38l6-6zm12 0l4-4 4 4-4 4-4-4zm12 0l-6-6 10-10 10 10-6 6 6 6-10 10-10-10 6-6zM0 16L10 6 4 0h4l4 4 4-4h4l-6 6 10 10L34 6l-6-6h4l4 4 4-4h4l-6 6 10 10v4L36 8 24 20 12 8 0 20v-4zm0 32l10 10-6 6h4l4-4 4 4h4l-6-6 10-10 10 10-6 6h4l4-4 4 4h4l-6-6 10-10v-4L36 56 24 44 12 56 0 44v4z' fill='%236415ff' fill-opacity='0.21' fill-rule='evenodd'/%3E%3C/svg%3E");
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Helvetica, sans-serif;
}

.fas {
  color: var(--font-color);
  font-size: 35px;
}

.player {
  max-width: 80vw;
  min-width: 800px;
  border: 5px solid black;
  border-radius: 10px;
  background: black;
  position: relative;
  cursor: pointer;
}

video {
  border-radius: 5px;
  width: 100%;
  height: auto;
}

/* Containers */
.show-controls {
  width: 100%;
  height: 30%;
  z-index: 2;
  position: absolute;
  bottom: 0;
  cursor: default;
}

.controls-container {
  position: absolute;
  bottom: -5px;
  width: 100%;
  height: 95px;
  margin-top: -95px;
  background: rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  opacity: 0;
  transition: all 0.5s ease-out 2s;
}

.show-controls:hover .controls-container {
  opacity: 1;
  transition: all 0.2s ease-out;
}



.control-group {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: space-between;
}

.controls-left,
.controls-right {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
  top: 40px;
}

/* Progress Bar */
.progress-range {
  height: 8px;
  width: calc(100% - 30px);
  background: rgba(212, 212, 212, 0.5);
  margin: auto;
  border-radius: 10px;
  position: absolute;
  left: 15px;
  top: 15px;
  cursor: pointer;
  transition: height 0.1s ease-in-out;
  z-index: 10;
}

.progress-range:hover {
  height: 10px;
}

.progress-bar {
  background: var(--primary-color);
  width: 20%;
  height: 100%;
  border-radius: 10px;
  transition: all 0.5s ease;
}

/* Left Controls -------------------------- */

.controls-left {
  justify-content: flex-start;
  margin-left: 15px;
}

/* Play & Pause */
.play-controls {
  margin-right: 15px;
}

.fa-play:hover,
.fa-pause:hover {
  color: var(--primary-color);
  cursor: pointer;
}

/* Volume */
.volume-icon {
  cursor: pointer;
}

.volume-range {
  height: 8px;
  width: 100px;
  background: rgba(70, 70, 70, 0.5);
  border-radius: 10px;
  position: relative;
  top: -21px;
  left: 50px;
  cursor: pointer;
}

.volume-bar {
  background: var(--font-color);
  width: 100%;
  height: 100%;
  border-radius: 10px;
  transition: width 0.2s ease-in;
}

.volume-bar:hover {
  background: var(--primary-color);
}

/* Right Controls ---------------------------- */
.controls-right {
  justify-content: flex-end;
  margin-right: 15px;
}

.speed,
.time {
  position: relative;
  top: 10px;
}

/* Playback Speed */
.speed {
  margin-right: 15px;
}

select,
option {
  cursor: pointer;
}

select {
  background: transparent;
  color: var(--font-color);
  border: none;
  font-size: 18px;
  position: relative;
  top: -2.5px;
  border-radius: 5px;
}

select:focus {
  outline: none;
}

select > option {
  background: rgba(0, 0, 0, 0.9);
  border: none;
  font-size: 14px;
}

/* Elapsed Time & Duration */
.time {
  margin-right: 15px;
  color: var(--font-color);
  font-weight: bold;
  user-select: none;
}

/* Fullscreen */
.fullscreen {
  cursor: pointer;
}

.video-fullscreen {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
}

/* Media Query: Large Smartphone (Vertical) */
@media screen and (max-width: 900px) {
  .player {
    min-width: 0;
    max-width: 95vw;
  }

  .fas {
    font-size: 20px;
  }

  .controls-container {
    height: 50px;
  }

  .control-group {
    position: relative;
    top: -25px;
  }

  .progress-range {
    width: 100%;
    top: 0;
    left: 0;
    border-radius: 0;
  }

  .progress-bar {
    border-radius: 0;
  }

  .volume-range {
    width: 50px;
    left: 30px;
    top: -15px;
  }

  .speed,
  .time {
    top: 3px;
  }

  select {
    font-size: 12px;
  }

  .time {
    font-size: 12px;
  }
}

/* Media Query: Large Smartphone (Horizontal) */
@media screen and (max-width: 900px) and (max-height: 500px) {
  .player {
    max-height: 95vh;
    max-width: auto;
  }

  video {
    height: 95vh;
    object-fit: cover;
  }

  .video-fullscreen {
    height: 97.5vh;
    border-radius: 0;
  }
}

