video {
    background-color: rgb(0, 0, 0);
}


/* =========================================
   VIDEO PLAYER
   ========================================= */

.video-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    font-size: 0;
    box-sizing: border-box;
}


/* =========================================
   VIDEO
   ========================================= */

.video-player video {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    background: rgb(0, 0, 0);
    box-sizing: border-box;
}


/* =========================================
   CONTROLS OVERLAY
   ========================================= */

.video-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    box-sizing: border-box;
}


/* =========================================
   PLAY BUTTON
   ========================================= */

.video-play-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;

    /* relative values */
    font-size: 30px;

}


/* remove browser focus styling */

.video-play-button:focus {
    outline: none;
    box-shadow: none;
}


.video-play-button svg {
    width: 45px;
    height: 45px;
    display: block;
    pointer-events: none;
}


/* =========================================
   TIMESTAMP
   ========================================= */

.video-timestamp {
    position: absolute;
    z-index: 20;
    color: rgb(255, 255, 255);
    line-height: 1;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    box-sizing: border-box;

    /*relative values */
    left: 13px;
    bottom: 20px;

    font-size: 14px;
    font-weight: 500;
}



/* =========================================
   PROGRESS BAR
   ========================================= */

.video-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background-color: transparent;
    z-index: 15;
    cursor: pointer;
    pointer-events: auto;
    box-sizing: border-box;

    /* Expand clickable height to 20px, visual bar remains 8px via ::before and .video-progress-filled */
    height: 20px;
}

.video-progress::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    background-color: rgba(75, 75, 75, 0.47);
    pointer-events: none;
}


/* =========================================
   FILLED PROGRESS
   ========================================= */

.video-progress-filled {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    background: rgb(255, 255, 255);
    box-sizing: border-box;
    border-radius: 0 3px 3px 0;
    pointer-events: none;
    transition: width 0.05s linear;

    /* visual height remains 8px */
    height: 8px;
}


/* =========================================
   AUDIO / VOLUME BUTTON
   ========================================= */

.video-audio-button {
    position: absolute;
    z-index: 20;
    border: none;
    background: none;
    padding: 0;
    color: rgb(255, 255, 255);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;

    font-size: 17px;

    /* 36px x 36px invisible click box positioned to left of fullscreen button */
    right: 43px;
    bottom: 9px;
    width: 36px;
    height: 36px;
}

.video-audio-button:focus {
    outline: none;
    box-shadow: none;
}

.video-audio-button svg {
    width: 16px;
    height: 16px;
    display: block;
    pointer-events: none;
}


/* =========================================
   FULLSCREEN BUTTON
   ========================================= */

.video-fullscreen-button {
    position: absolute;
    z-index: 20;
    border: none;
    background: none;
    padding: 0;
    color: rgb(255, 255, 255);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    outline: none;
    box-shadow: none;
    box-sizing: border-box;

    font-size: 17px;

    /* 36px x 36px invisible click box with centered visual icon */
    right: 3px;
    bottom: 9px;
    width: 36px;
    height: 36px;
}

.video-fullscreen-button svg {
    width: 14px;
    height: 14px;
    display: block;
    pointer-events: none;
}


.video-fullscreen-button:focus {
    outline: none;
    box-shadow: none;
}

.video-controls {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}


/* =========================================
   FULLSCREEN & ROTATION ON MOBILE
   ========================================= */

.video-player:fullscreen,
.video-player:-webkit-full-screen,
.video-player.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    background: rgb(0, 0, 0) !important;
    overflow: hidden;
}

.video-player:fullscreen video,
.video-player:-webkit-full-screen video,
.video-player.fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-player:fullscreen video.rotated,
.video-player:-webkit-full-screen video.rotated,
.video-player.fullscreen video.rotated {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vh !important;
    height: 100vw !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain;
    transform: translate(-50%, -50%) rotate(90deg);
}



/*------- scaling -------- */
@media screen and (min-width: 355px){

    .video-audio-button {
        font-size: 17px;
        right: 43px;
        bottom: 9px;
        width: 36px;
        height: 36px;
    }

    .video-fullscreen-button {
        font-size: 17px;
        right: 3px;
        bottom: 9px;
        width: 36px;
        height: 36px;
    }
}

/* Hide audio button if width < 500px or height < 500px (e.g. mobile phones) */
@media screen and (max-width: 499.98px), screen and (max-height: 499.98px) {
    .video-audio-button {
        display: none !important;
    }
}