/* =========================================================
   DESKTOP
========================================================= */

.course-material-table .lp-material-file-link .custom-video-wrapper {
    width: 100%;
    max-width: 700px;
    position: relative;
}

.course-material-table .lp-material-file-link .custom-video-wrapper video {
    width: 100%;
    height: auto;
    max-height: 420px;
    display: block;
    background: #000;
    border-radius: 8px;
}


/* =========================================================
   MOBILE BUTTON
========================================================= */

.custom-mobile-video-button {
    display: none;
}


@media (max-width: 767px) {

    /* -----------------------------------------------------
       Hide desktop inline player on mobile
    ----------------------------------------------------- */

    .course-material-table
    .lp-material-file-link
    .custom-video-wrapper > video {
        display: none;
    }


    /* -----------------------------------------------------
       Mobile Play Button
    ----------------------------------------------------- */

    .custom-mobile-video-button {
        display: flex;
        width: 100%;
        min-height: 52px;

        align-items: center;
        justify-content: center;
        gap: 10px;

        padding: 10px 15px;

        border: 0;
        border-radius: 8px;

        background: #000;
        color: #fff;

        font-size: 15px;
        font-weight: 600;

        cursor: pointer;

        -webkit-appearance: none;
        appearance: none;
    }

    .custom-mobile-video-button span {
        font-size: 23px;
        line-height: 1;
    }


    /* =====================================================
       MOBILE VIDEO POPUP
    ===================================================== */

    .custom-mobile-video-popup {
        position: fixed;

        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        width: 100%;
        height: 100%;

        background: rgba(0, 0, 0, 0.96);

        z-index: 999999;

        display: none;

        align-items: center;
        justify-content: center;

        padding: 15px;

        box-sizing: border-box;

        /*
         * Prevent browser touch gestures from
         * interfering with the popup.
         */
        touch-action: manipulation;
    }


    .custom-mobile-video-popup.active {
        display: flex;
    }


    /* -----------------------------------------------------
       Popup Inner
    ----------------------------------------------------- */

    .custom-mobile-video-popup .custom-popup-inner {
        width: 100%;
        max-width: 100%;

        position: relative;

        display: flex;
        align-items: center;
        justify-content: center;
    }


    /* -----------------------------------------------------
       Popup Video
    ----------------------------------------------------- */

    .custom-mobile-video-popup video {
        display: block;

        width: 100%;
        height: auto;

        max-width: 100%;
        max-height: 75vh;

        background: #000;

        border-radius: 6px;
    }


    /* -----------------------------------------------------
       Close Button
    ----------------------------------------------------- */

    .custom-video-close {
        position: absolute;

        top: -52px;
        right: 0;

        width: 40px;
        height: 40px;

        padding: 0;
        margin: 0;

        border: 0;
        border-radius: 50%;

        background: #fff;
        color: #000;

        font-size: 28px;
        line-height: 40px;

        text-align: center;

        cursor: pointer;

        z-index: 100;
    }


    /* -----------------------------------------------------
       Prevent page scrolling while popup is open
    ----------------------------------------------------- */

    body.custom-video-popup-open {
        overflow: hidden !important;
        height: 100% !important;
    }

}


/* =========================================================
   SMALL MOBILE DEVICES
========================================================= */

@media (max-width: 480px) {

    .custom-mobile-video-popup {
        padding: 12px;
    }

    .custom-mobile-video-popup video {
        max-height: 70vh;
    }

    .custom-video-close {
        top: -48px;
        width: 38px;
        height: 38px;
        line-height: 38px;
        font-size: 26px;
    }

}
