@import "colors";

%fullscreen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9000;
    background-color: $fullscreen_bg;
}

#jsxc_webrtc {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 9999;
    background-color: black;

    .jsxc_status {
        z-index: 9999;
        border-radius: 20px;
        display: none;
        position: absolute;
        top: 30px;
        left: 50%;
        background-color: $video_status_bg;
        color: $video_status_color;
        padding: 15px;
        font-weight: bold;
        text-align: center;
    }

    .slimScrollDiv {
        opacity: 1 !important;
    }

    li .jsxc_name {
        cursor: auto;

        &:hover {
            color: $window_bar_color;
        }
    }
}

.jsxc_establishing, .jsxc_ringing {
    &:after {
        content: " ";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: rgba(0, 0, 0, 0.4);
        z-index: 10;
    }
}

$establishingColor1: #a1a1a1;
$establishingColor2: #f1f1f1;

.jsxc_establishing:before {
    content: " ";
    display: block;
    width: 40px;
    height: 10px;
    box-sizing: border-box;
    background-color: $establishingColor1;
    animation-name: jsxc_establishing;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    margin-left: -20px;
    margin-top: -5px;
}

@keyframes jsxc_establishing {
    0% {
        border-width: 0;
        background-color: $establishingColor1;
        width: 40px;
        margin-left: -20px;
    }

    50% {
        background-color: $establishingColor2;
        width: 80px;
        margin-left: -40px;
    }

    100% {
        border-width: 0;
        background-color: $establishingColor1;
        width: 40px;
        margin-left: -20px;
    }
}

$ringingColor1: #98d48f;
$ringingColor2: #76ba6c;

.jsxc_ringing:before {
    content: " ";
    display: block;
    width: 20px;
    height: 20px;
    box-sizing: border-box;
    background-color: $ringingColor1;
    border-radius: 50%;
    animation-name: jsxc_ringing;
    animation-duration: 2s;
    animation-iteration-count: infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    margin-left: -10px;
    margin-top: -10px;
}

@keyframes jsxc_ringing {
    0% {
        background-color: $ringingColor1;
        width: 20px;
        height: 20px;
        margin-left: -10px;
        margin-top: -10px;
    }

    50% {
        background-color: $ringingColor2;
        width: 80px;
        height: 80px;
        margin-left: -40px;
        margin-top: -40px;
    }

    100% {
        background-color: $ringingColor1;
        width: 20px;
        height: 20px;
        margin-left: -10px;
        margin-top: -10px;
    }
}

.jsxc_bell:before {
    content: " ";
    display: block;
    width: 80px;
    height: 80px;
    box-sizing: border-box;
    background-image: image-url("bell.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    animation-name: jsxc_ringing;
    animation-duration: 1.5s;
    animation-iteration-count: infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    margin-left: -40px;
    margin-top: -40px;
}

@keyframes jsxc_bell {
    0% {
        margin-left: -50px;
    }

    5% {
        margin-left: -30px;
    }

    10% {
        margin-left: -50px;
    }

    15% {
        margin-left: -30px;
    }

    20% {
        margin-left: -50px;
    }

    25% {
        margin-left: -30px;
    }

    30% {
        margin-left: -50px;
    }

    35% {
        margin-left: -40px;
    }
}

.jsxc_videoContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: $video_bg;

    &.jsxc_minimized {
        position: fixed;
        top: 10px;
        left: 10px;
        right: auto;
        bottom: auto;
        z-index: 99;
        background-color: transparent;
        box-shadow: 0 0 10px #a1a1a1;

        .jsxc_localvideo {
            position: static;
            display: block;
        }
    }

    video {
        display: none;
    }

    .jsxc_noRemoteVideo {
        display: none;
    }

    @media (min-width: 768px) {
        right: 250px;

        .jsxc_controlbar {
            opacity: 0;
        }

        &:hover {
            .jsxc_controlbar {
                opacity: 1;
            }
        }
    }
}

.jsxc_remotevideo {
    @extend %fullscreen;
}

.jsxc_noRemoteVideo {
    @extend %fullscreen;

    p {
        position: absolute;
        bottom: 0;
        left: 0;
        text-align: center;
        color: $novideo_color;
        width: 100%;
        z-index: 100;
    }

    > div {
        width: 200px;
        height: 200px;
        overflow: hidden;
        position: absolute;
        top: 50%;
        margin-top: -100px;
        left: 50%;
        margin-left: -100px;

        > div {
            background-color: $novideo_bg;

            &:first-child {
                width: 50%;
                height: 50%;
                border-radius: 50%;
                position: absolute;
                left: 50%;
                margin-left: -25%;
                top: 10%;
            }

            &:last-child {
                position: absolute;
                bottom: -50%;
                width: 100%;
                height: 100%;
                border-radius: 50%;
            }
        }
    }
}

.jsxc_localvideo {
    width: 160px;
    height: 120px;
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 9990;
    background-color: $black;
}

div {
    &:full-screen {
        width: 100%;
        height: 100%;
        background-color: $black;

        &.jsxc_localvideo {
            border: 1px solid $white;
        }
    }

    &:fullscreen {
        width: 100%;
        height: 100%;
        background-color: $black;

        &.jsxc_localvideo {
            border: 1px solid $white;
        }
    }

    &.jsxc_video {
        background-image: image-url("camera_icon_white.svg");
        background-repeat: no-repeat;
        background-position: center center;
        background-size: 15px 15px;
        opacity: 0.4;

        &.jsxc_disabled {
            background-image: image-url("camera_disabled_icon_white.svg");
        }

        &:not(.jsxc_disabled) {
            &:hover {
                opacity: 1;
            }
        }
    }
}

.jsxc_controlbar {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 9090;
    transition: 1s opacity;
    opacity: 0;

    @media (min-width: 768px) {
        bottom: 5%;
        top: initial;
    }

    &.jsxc_visible {
        opacity: 1;
    }

    > div {
        background-color: rgba(0, 0, 0, 0.5);
        height: 44px;
        border-radius: 22px;
        padding: 0 5px;
        display: inline-block;
    }

    .jsxc_videoControl {
        height: 44px;
        width: 44px;
        margin: 0 5px;
        background-position: center;
        background-repeat: no-repeat;
        background-size: 90%;
        cursor: pointer;
        display: inline-block;
        opacity: 0.8;

        &:hover {
            opacity: 1;
        }
    }

    .jsxc_hangUp {
        background-image: image-url("hang_up_red.svg");
    }

    .jsxc_fullscreen {
        background-image: image-url("fullscreen_white.svg");
    }

    .jsxc_showchat {
        float: right;
    }
}

.jsxc_multi > div {
    display: none;
}

.jsxc_snapshotbar {
    width: 100%;
    display: none;

    img {
        height: 50px;
    }
}

.jsxc_buttongroup {
    display: inline;

    button {
        &:first-child {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
            margin-right: 0;
        }

        &:last-child {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
            margin-left: 0;
        }
    }
}

.jsxc_chatarea {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 250px;
    background-color: $window_bg;
    display: none;

    @media (min-width: 768px) {
        display: block;
    }

    .jsxc_settings {
        display: none !important;
    }

    .jsxc_close {
        display: none !important;
    }

    .jsxc_video {
        display: none !important;
    }

    .jsxc_bar {}

    .jsxc_window {
        bottom: 0;
        box-shadow: none;
    }

    > ul {
        width: 100%;
        height: 100%;
        list-style: none;
        padding: 0;
    }
}

.jsxc_fullscreen.jsxc_localvideo {
    border: 1px solid $white;
}

.jsxc_videoSuitable .jsxc_name {
    font-style: italic;
}
