#jsxc_windowList {
    position: fixed;
    bottom: 0;
    right: 210px;
    left: 0;
    z-index: 50;
    transition: right 0.5s;

    &.jsxc_roster_hidden {
        right: 10px;
    }

    @media (min-width: 768px) {
        clip: rect(-10000px, 10000px, 30px, 30px);
    }

    > ul {
        list-style: none;
        padding: 0;
        margin: 0;
        position: absolute;
        bottom: 0;
        right: 0;
        height: 44px;
        overflow: visible;
        white-space: nowrap;
        transition: right 0.5s;

        > li {
            padding: 0;
            margin: 0;
            display: inline-block;
            height: 44px;
            width: 46px;
            position: relative;
            overflow: visible;
            margin-right: 5px;
            cursor: pointer;
            white-space: normal;

            &.jsxc_normal {
                transition: width 0.2s;
                width: 250px;
            }

            &.jsxc_min {
                transition: width 0.2s;
                width: 46px !important;

                //  overwrite resizeable width

                @media (min-width: 768px) {
                    width: 200px !important;
                }

                .jsxc_emoticons {
                    display: none;
                }

                .jsxc_tools {
                    display: none;
                }
            }
        }
    }
}

#jsxc_windowListSB {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 30px;

    @media (max-width: 768px) {
        display: none;
    }

    > {
        div {
            box-sizing: border-box;
            width: 14px;
            height: 30px;
            background-color: $windowListSB_bg;
            color: $windowListSB_color;
            text-align: center;
            line-height: 30px;
            float: left;
            cursor: pointer;
            user-select: none;

            &:hover {
                background-color: $windowListSB_bg_hover;
            }
        }

        .jsxc_disabled {
            background-color: $windowListSB_bg_disabled !important;
            color: $windowListSB_color_disabled;
            cursor: default !important;
            display: none;
        }
    }
}

.jsxc_bar {
    background-color: $window_bar_bg;
    cursor: pointer;
    height: 44px;
    line-height: 26px;
    padding: 2px;
    color: $window_bar_color;
    width: 100%;
    box-sizing: border-box;
    position: relative;

    &:hover {
        .jsxc_normal & {
            color: $window_bar_color_hover;
        }
    }

    .jsxc_tools {
        &:hover {
            .jsxc_normal & {
                color: #000;
            }
        }
    }

    .jsxc_min & {
        background-color: $window_min_bar_bg;
        color: $window_min_bar_color;
    }
}

.jsxc_window {
    position: absolute;
    bottom: -284px;
    top: auto;
    left: 0;
    right: 0;
    height: auto;
    background-color: $window_bg;
    z-index: 80;
    cursor: default;
    border: 1px solid $window_border;
    border-bottom: 0;

    .jsxc_min & {
        transition: bottom 0.2s;
    }

    .jsxc_normal & {
        transition: bottom 0.2s;
    }

    .jsxc_showOverlay & {
        .jsxc_overlay {
            display: block !important;
        }
    }

    .jsxc_emoticons {
        height: 44px;
        width: 44px;
        position: absolute;
        bottom: 0;
        left: 0;
        cursor: pointer;

        &:after {
            content: " ";
            background-image: image-url("smiley.svg");
            background-position: center center;
            background-repeat: no-repeat;
            background-size: 30px 30px;
            opacity: 0.3;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        .jsxc_inner {
            left: 5px;
        }

        ul {
            width: 210px;
            margin-bottom: 8px;
            background-color: $emoticon_selection_bg;
            border-radius: 3px;
            z-index: 200;
            list-style-type: none;
            padding: 3px;
            position: relative;

            &:after {
                content: " ";
                position: absolute;
                border-left: 8px solid transparent;
                border-right: 8px solid transparent;
                border-top: 8px solid $emoticon_selection_bg;
                display: block;
                width: 0;
                z-index: 1;
                left: 7px;
                top: 100%;
            }
        }

        li {
            span {
                float: left;
                cursor: pointer;
                border-radius: 3px;
                background-size: 30px 30px;
                width: 30px;
                height: 30px;

                &:hover {
                    background-color: $emoticon_selection_hover;
                }
            }
        }

        &:hover:after {
            opacity: 0.5;
        }
    }

    .jsxc_fade {
        position: relative;
        overflow: hidden;

        .jsxc_overlay {
            display: none;
            background-color: rgba(0, 0, 0, 0.5);
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            z-index: 100;
            overflow-y: scroll;

            > div {
                background-color: #fff;
                margin: 30px 10px;
                padding: 5px;
                border-radius: 3px;
                text-align: center;
                position: relative;

                .jsxc_close {
                    position: absolute;
                    top: 0;
                    right: 0;
                    height: 44px;
                    width: 44px;

                    &:after {
                        content: "×";
                        position: absolute;
                        top: 4px;
                        right: 4px;
                        font-size: 20px;
                        font-family: Arial, sans-serif;
                        cursor: pointer;
                        color: #000;
                        opacity: 0.4;
                    }

                    &:hover {
                        &:after {
                            opacity: 1;
                        }
                    }

                    @media (min-width: 768px) {
                        width: 30px;
                        height: 30px;
                    }
                }

                .jsxc_body {
                    margin-top: 20px;
                }

                p {
                    margin-bottom: 10px;
                }

                li {
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                a:hover {
                    text-decoration: underline;
                }
            }
        }

        .jsxc_mam-load-more {
            display: none;
            text-align: center;
            font-size: 0.8em;
            font-style: italic;
            position: absolute;
            top: -42px;
            left: 0;
            right: 0;
            height: 42px;
            cursor: pointer;
            z-index: 80;
            line-height: 42px;
            opacity: 0;
            transition: opacity 0.5s, top 0.5s;
            background-image: linear-gradient(#c1c1c1, transparent);

            &.jsxc_show {
                top: 0;
                opacity: 0.7;

                &:hover {
                    opacity: 1;
                }
            }
        }

        &.jsxc_mam-enable {
            .jsxc_mam-load-more {
                display: block;
            }
        }
    }

    .jsxc_avatar {
        margin-top: 1px;
    }

    .jsxc_textarea {
        width: 100%;
        overflow: hidden;
        padding: 3px;
    }

    .slimScrollDiv {
        margin: 0 0 6px;
        left: auto !important;
        top: auto !important;
    }

    textarea {
        &.jsxc_textinput {
            width: 100%;
            height: 44px;
            margin: 0;
            padding: 14px 40px 12px;
            outline: none;
            border-radius: 0;
            box-sizing: border-box;
            border: 0;
            display: block;
            resize: none;
            transition: height 0.5s;
            font-size: 13px;
        }

        &::placeholder {
            color: $window_placeholder;
            opacity: 0.3;
        }
    }

    .jsxc_tools {
        float: right;

        > .jsxc_disabled {
            opacity: 0.3;
            cursor: default !important;
        }

        > div {
            width: 25px;
            height: 40px;
            display: block;
            float: left;
            color: $tools_color;
            opacity: 0.4;
            font-family: $font_sans;
            line-height: 40px;
            cursor: pointer;
            text-align: center;

            &.jsxc_settings {
                opacity: 1;
            }
        }
    }

    .jsxc_close {
        font-size: 20px;

        &:hover {
            color: $window_close_hover;
            opacity: 1;
        }
    }

    .jsxc_more {
        background-image: image-url("more_white.svg");
        opacity: 0.4;
    }

    .ui-resizable-w {
        left: 0;
    }

    .ui-resizable-nw {
        top: 0;
        left: 0;
        width: 15px;
        height: 15px;
        z-index: 95 !important;
        background-image: image-url("resize_gray.svg");
    }

    .ui-resizable-n {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 15px;
        z-index: 100;
    }
}

.jsxc_chatmessage {
    margin: 3px;
    padding: 4px;
    word-wrap: break-word;
    background-color: $chatmessage_bg;
    position: relative;
    outline: none;
    clear: both;

    &.jsxc_error {
        &:before {
            content: attr(data-error-msg);
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-color: rgba(255, 255, 255, 0.7);
            text-align: center;
            padding: 10px 5px;
        }
    }

    a {
        color: $chatmessage_a;
        text-decoration: underline;
        display: inline-block;
        max-width: 100%;
        position: relative;

        &[download]:before {
            content: " ";
            position: absolute;
            top: 0;
            right: 0;
            bottom: 5px;
            left: 0;
            border-radius: 3px;
            background-color: rgba(255, 255, 255, 0.7);
            background-image: url("../img/download_icon_black.svg");
            background-size: contain;
            background-position: center center;
            background-repeat: no-repeat;
            opacity: 0;
            transition: opacity 0.5s;
        }

        &[download]:hover {
            &:before {
                opacity: 0.6;
            }
        }
    }

    img {
        max-width: 100%;
    }

    .jsxc_avatar {
        display: none;
    }

    .jsxc_location {
        border-radius: 3px;
        display: block;
        background-color: #fff;
        padding: 3px;
        padding-left: 30px;
        margin-bottom: 5px;
        background-position: 3px center;
        background-size: 25px 25px;
        background-repeat: no-repeat;
        background-image: image-url("location_icon.svg");
    }

    .jsxc_attachment {
        border-radius: 3px;
        background-color: #fff;
        padding: 3px;
        padding-left: 30px;
        min-height: 30px;
        margin-bottom: 5px;
        background-position: 3px center;
        background-size: 25px 25px;
        background-repeat: no-repeat;
        background-image: image-url("filetypes/file.svg");

        img {
            border-radius: 3px;
        }

        &.jsxc_image {
            line-height: 0;
            padding: 0;
            background-image: url("");
            display: inline-block;
        }

        &.jsxc_application {
            background-image: image-url("filetypes/application.svg");
        }

        &.jsxc_application-pdf {
            background-image: image-url("filetypes/application-pdf.svg");
        }

        &.jsxc_audio {
            background-image: image-url("filetypes/audio.svg");
        }

        &.jsxc_video {
            background-image: image-url("filetypes/video.svg");
            opacity: 1;
        }

        &.jsxc_text {
            background-image: image-url("filetypes/text.svg");
        }
    }

    .jsxc_emoticon.jsxc_large {
        width: 40px;
        height: 40px;
        margin-bottom: 7px;
    }
}

.jsxc_timestamp {
    font-size: 8px;
    color: $chatmessage_timestamp;
    line-height: 8px;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
    text-overflow: ellipsis;
    clear: both;
}

.jsxc_encrypted {
    &.jsxc_received.jsxc_out .jsxc_timestamp {
        margin-right: 1px;
    }

    .jsxc_timestamp:after {
        content: " ";
        display: inline-block;
        width: 10px;
        height: 8px;
        margin-left: 2px;
        background-image: image-url("padlock_close_grey.svg");
        background-size: contain;
        background-repeat: no-repeat;
    }
}

.jsxc_in {
    float: left;
    position: relative;
    max-width: 76%;
    margin-left: 10px;
    border-radius: 3px;
    background-color: $chatmessage_in_bg;

    &:after {
        content: " ";
        position: absolute;
        border-style: solid;
        border-width: 5px 6px 5px 0;
        border-color: transparent $chatmessage_in_bg;
        display: block;
        width: 0;
        z-index: 1;
        left: -6px;
        bottom: 10px;
    }

    .jsxc_timestamp {
        float: left;
    }
}

.jsxc_out, .jsxc_probably_out {
    float: right;
    position: relative;
    max-width: 76%;
    margin-right: 10px;
    padding-right: 10px;
    border-radius: 3px;

    &:after {
        content: " ";
        position: absolute;
        border-style: solid;
        border-width: 5px 0 5px 6px;
        border-color: transparent $chatmessage_out_bg;
        display: block;
        width: 0;
        z-index: 1;
        right: -6px;
        bottom: 10px;
    }

    &.jsxc_received {
        &:before {
            content: "✓";
            position: absolute;
            bottom: 2px;
            right: 2px;
            font-size: 12px;
            line-height: 12px;
            color: $chatmessage_received;
        }

        .jsxc_timestamp {
            margin-right: 4px;
        }
    }

    .jsxc_timestamp {
        float: right;
    }
}

.jsxc_out {
    background-color: $chatmessage_out_bg;
}

.jsxc_sys {
    width: auto;
    max-width: none;
    padding-right: 4px;
    box-sizing: border-box;
    margin-right: 3px;
    border-radius: 3px;
    background-color: transparent;
    font-size: 0.8em;
    font-style: italic;

    .jsxc_emoticon {
        width: 1.2em;
        height: 1.2em;
        vertical-align: middle;
    }
}

div.jsxc_settings {
    position: relative;

    .jsxc_inner {
        left: auto;
        top: 100%;
        right: -6px;
    }
}

div.jsxc_transfer {
    background-image: image-url("padlock_open_black.svg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 14px 14px;
    opacity: 0.3;
    height: 44px;
    width: 44px;
    position: absolute;
    bottom: 0;
    right: 0;
    cursor: pointer;

    &:hover {
        opacity: 1;
    }

    &.jsxc_disabled {
        background-image: image-url("padlock_open_disabled_black.svg");
        cursor: default;

        &:hover {
            opacity: 0.3;
        }
    }

    &.jsxc_fin {
        opacity: 1;
        background-image: image-url("padlock_close_grey.svg");
    }

    &.jsxc_enc {
        opacity: 1;
        background-image: image-url("padlock_close_orange.svg");

        &.jsxc_trust {
            background-image: image-url("padlock_close_green.svg");
        }
    }
}

.jsxc_status-msg {
    font-size: 12px;
    display: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    height: 50%;
    line-height: 17.5px;
    opacity: 0.7;

    &.jsxc_composing {
        &:before {
            content: " ";
            width: 1em;
            height: 1em;
            display: inline-block;
            background-size: cover;
            vertical-align: middle;
            background-repeat: no-repeat;
            background-image: image-url("composing.png");
        }
    }
}

.jsxc_status-msg-show {
    .jsxc_name {
        height: 50%;
        line-height: 20px;
    }

    .jsxc_status-msg {
        display: block;
    }

    .jsxc_lastmsg {
        display: none !important;
    }
}
