﻿:root {
    --Danger: #f44336;
    --Success: #8BC34A;
    --accent: #42A5F5;
}

.chatPanel {
    position: fixed;
    left: 0;
    bottom: 0;
    top: 0;
    z-index: 1010;
    width: calc(100% - 54px);
    max-width: 400px;
    background-color: #fafafa;
    overflow: hidden;
    box-shadow: -2px 0px 28px 0px #0006;
    transform: translate(-100%, 0);
    transition: all .7s;
}

    .chatPanel.active {
        transform: translate(0, 0);
    }

.chatHead {
    background-color: var(--accent);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    color: white;
    margin: 8px;
    box-shadow: 0px 18px 24px -18px var(--accent);
    align-items: center;
    position: relative;
    z-index: 1;
}

    .chatHead img {
        display: block;
        object-fit: cover;
        transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .7s;
        width: 36px;
        height: 36px;
        position: absolute;
        top: 50%;
        right: 6px;
        transform: translate(200%, -50%);
        border-radius: 50%;
        box-sizing: border-box;
    }

    .chatHead[state=contacts] img.contacts,
    .chatHead[state=room] img.room,
    .chatHead[state=settings] img.settings,
    .chatHead[state=list] img.list {
        transform: translate(0, -50%);
    }

    /*.chatHead[state=room] img.room {
        display: block;
        border-radius: 50%;
    }*/

    .chatHead > span {
        width: 18px;
        height: 18px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        position: absolute;
        top: 50%;
        left: 16px;
        cursor: pointer;
        display: block;
        transform: translate(-200%, -50%);
        transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .7s;
    }

    .chatHead[state="list"] > span.close {
        background-image: url(../Images/Close.png);
        transform: translate(0, -50%);
    }

    .chatHead:not([state="list"]) > span.back {
        background-image: url(../Images/BackArrow.png);
        transform: translate(0, -50%);
    }

    .chatHead[state="room"] > span.settings {
        transform: translate(calc(100% + 8px), -50%);
        background-color: white;
        -webkit-mask-image: url(../Images/settings.svg);
        -webkit-mask-position: center;
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-size: contain;
    }

.chatCat {
    display: flex;
    margin: 8px;
}

    .chatCat > a {
        font-size: 11pt;
        flex: 1;
        display: block;
        text-decoration: none;
        color: #212121;
        padding: 12px;
        text-align: center;
        background-color: rgba(0, 0, 0, 0);
        border-bottom: 2px solid rgba(0, 0, 0, 0.6);
        transition: all ease .3s;
    }

        .chatCat > a.active {
            border-bottom: 2px solid var(--warning);
            background-color: rgba(0, 0, 0, 0.05);
            color: var(--warning);
        }

.roomInfo {
    display: flex;
    align-items: center;
    height: 48px;
    flex: 1;
}

    .roomInfo h2 {
        font-weight: 100;
        margin: 0;
        font-size: 14pt;
        padding: 0 48px 4px 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 48px);
        box-sizing: border-box;
    }

.chatTab {
    position: absolute;
    background-color: transparent;
    height: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .9s;
}

    .chatTab.list {
        overflow-y: auto;
    }

    .chatTab.active {
        height: calc(100% - 68px);
        overflow: auto;
    }

    .chatTab > .Accordion {
        margin: 8px;
        border-radius: 6px;
        padding: 6px 12px;
        border: none;
        background-color: var(--warning);
        color: white;
    }

    .chatTab > .AccordionPanel {
        border: none;
        background-color: inherit;
    }

.btnRoom {
    display: flex;
    background-color: #EEEEEE;
    margin: 8px;
    border-radius: 6px;
    overflow: hidden;
    align-items: center;
    cursor: pointer;
    transition: all ease .3s;
    transform: translate(0, 0);
}

    .btnRoom img {
        display: block;
        margin: 8px;
        width: 48px;
        height: 48px;
        object-fit: cover;
        border-radius: 50%;
    }

    .btnRoom > div {
        display: block;
        flex: 1;
    }

        .btnRoom > div > label {
            display: block;
            font-size: 11pt;
            margin: 0;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            cursor: pointer;
            width: calc(100% - 124px);
            text-align: right;
        }

        .btnRoom > div > p {
            display: block;
            font-size: 8pt;
            margin: 2px 0 0;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            text-align: right;
        }

    .btnRoom .counter {
        min-width: 24px;
        font-size: 9pt;
        height: 24px;
        border-radius: 25px;
        background-color: #f44336;
        color: white;
        margin: 0 0 0 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 2px 2px 0;
    }

    .btnRoom .remove {
        min-width: 20px;
        font-size: 9pt;
        height: 20px;
        border-radius: 50%;
        background-color: #f44336;
        color: white;
        margin: 0 0 0 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        padding: 2px 2px 0;
        background-image: url(../Images/Close.png);
        background-size: 60%;
        background-repeat: no-repeat;
        background-position: center;
        transition: all ease .3s;
    }

.selectContact .btnRoom:hover {
    /*transform: translate(-8px, 0);*/
    background-color: #e7e7e7;
}

.selectContact .btnRoom.selectable {
    background-color: #5bbbff33;
}

.chatTab.room.spinner {
    box-sizing: border-box;
    padding-top: 68px;
    /*transition: all ease .3s;*/
}

.chatTab.room img.spinner {
    width: 0;
    height: 0;
    opacity: 0;
    transform: translate(-50%, 0) scale(0);
    background-color: transparent;
    position: absolute;
    left: 50%;
    top: 0;
    transition: all ease .3s;
}

.chatTab.room.spinner img.spinner {
    width: 48px;
    height: 48px;
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.roomContent {
    display: flow-root;
    height: calc(100% - 64px);
    overflow: auto;
    position: relative;
}

.wrapword {
    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
    white-space: -webkit-pre-wrap; /* Chrome & Safari */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    white-space: pre-wrap; /* CSS3 */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
    word-break: break-all;
    white-space: normal;
}

.messageBox {
    display: flow-root;
    padding: 16px 0 24px;
    transition: all ease .2s;
    cursor: pointer;
    overflow: hidden;
}

    .messageBox:hover {
        background-color: rgba(66, 165, 245, 0.1);
    }

    .messageBox > img {
        border-radius: 50%;
        width: 42px;
        height: 42px;
        margin: 8px 8px 0;
        display: block;
        float: right;
        object-fit: cover;
    }

    .messageBox.left > img {
        float: left;
    }

    .messageBox .message {
        display: block;
        float: right;
        margin: 16px 4px 0 8px;
        max-width: calc(100% - 84px);
        background-color: #DCEDC8;
        border-radius: 8px;
        position: relative;
        /*padding: 6px 0 0;*/
    }

    .messageBox.left .message {
        float: left;
        margin: 16px 8px 0 4px;
        background-color: #FFECB3;
    }

    .messageBox .message .replyMessageBox {
        padding: 2px 0 0;
        display: flow-root;
        background-color: #ffffff80;
        border-radius: 5px;
        margin: 6px 6px 0;
        width: calc(100% - 14px);
        position: relative;
        border-right: 2px solid var(--Success);
    }

    .messageBox.left .message .replyMessageBox {
        /*margin: 0 6px;*/
        border-left: 2px solid #bb8d00;
        border-right: none;
    }

    .messageBox .message .replyMessageBox h2 {
        margin: 2px 0 0;
        color: var(--Success);
        white-space: nowrap;
    }

    .messageBox.left .message .replyMessageBox h2 {
        color: #bb8d00;
    }

    .messageBox .message > span {
        position: absolute;
        font-size: 8pt;
        bottom: 0;
        right: 0;
        transform: translate(0, 120%);
        white-space: nowrap;
    }

    .messageBox.left .message > span {
        right: unset;
        left: 0;
    }

    .messageBox .message:before {
        content: '';
        position: absolute;
        display: block;
        width: 16px;
        height: 14px;
        background-color: inherit;
        top: 0;
        right: 0;
        transform: skew(-45deg) translate(30%, 0);
        z-index: 0;
    }

    .messageBox.left .message:before {
        transform: skew(45deg) translate(-30%, 0);
        right: unset;
        left: 0;
    }

    .messageBox .message h2 {
        margin: 0;
        box-sizing: border-box;
        font-size: 9pt;
        font-weight: bold;
        padding: 0px 8px;
        z-index: 1;
        position: relative;
    }

    .messageBox .message > h2 {
        display: none;
    }

    .messageBox.left .message > h2 {
        display: block;
        margin: 4px 0 0;
    }

    .messageBox .message p {
        margin: 0 8px 0;
        font-size: 9pt;
        line-height: 2em;
        position: relative;
    }

    .messageBox .message .replyMessageBox p {
        white-space: nowrap;
        max-width: 100%;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    .messageBox .actions {
        display: inline-block;
        transform: translate(0, -9px);
        position: absolute;
        right: 64px;
        transition: all ease .2s;
        opacity: 0;
    }

    .messageBox:hover .actions {
        opacity: 1;
    }

    .messageBox.left .actions {
        right: unset;
        left: 64px;
    }

    .messageBox .actions span {
        display: inline-block;
        width: 22px;
        height: 22px;
        background-color: #dadada;
        position: relative;
        border-radius: 3px;
        opacity: .2;
        transition: all ease .2s;
    }

        .messageBox .actions span:hover {
            opacity: 1;
        }

        .messageBox .actions span:before {
            display: block;
            width: 75%;
            height: 75%;
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: dimgray;
            -webkit-mask-position: center;
            -webkit-mask-size: contain;
            transition: all ease .2s;
        }

    .messageBox.left .actions span.edit,
    .messageBox.left .actions span.delete {
        display: none;
    }

    .messageBox .actions span.edit:before {
        -webkit-mask-image: url(../Images/ChatEdit.svg);
    }

    .messageBox .actions span.delete:before {
        -webkit-mask-image: url(../Images/ChatDelete.svg);
    }

    .messageBox .actions span.reply:before {
        -webkit-mask-image: url(../Images/ChatReply.svg);
    }

/*.messageBox .actions span.edit:hover:before {
            background-color: var(--Accent);
        }

        .messageBox .actions span.delete:hover:before {
            background-color: var(--Danger);
        }

        .messageBox .actions span.reply:hover:before {
            background-color: var(--Success);
        }*/

.roomFoot {
    display: flex;
    position: absolute;
    bottom: 0;
    padding: 12px 8px 16px;
    background-color: #fafafa;
    box-sizing: border-box;
    width: 100%;
    max-width: 400px;
    left: 0;
    transform: translate(-100%, 0);
    transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .7s;
}

    .roomFoot input {
        border: none;
        box-sizing: border-box;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 10pt;
        display: block;
        flex: 1;
        font-family: Vazir;
        box-shadow: 0px 9px 11px -14px #000;
    }

    .roomFoot .btnSend {
        border: none;
        border-radius: 6px;
        width: 36px;
        height: 36px;
        display: block;
        margin-right: 8px;
        background-color: var(--Success);
        box-shadow: 0px 10px 11px -9px var(--Success);
        background-image: url(../Images/Send.png);
        background-repeat: no-repeat;
        background-size: 20px;
        background-position: center;
        cursor: pointer;
    }

.chatTab.room.active .roomFoot {
    transform: translate(0, 0);
}

.btnFloat {
    border: none;
    background-color: var(--Success);
    box-shadow: 0px 10px 11px -9px var(--Success);
    background-image: url(../Images/ChatContact.png);
    background-repeat: no-repeat;
    background-size: 20px;
    background-position: center;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: block;
    position: fixed;
    bottom: 16px;
    right: 16px;
    transform: translate(200%, 0);
    transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .7s;
}

.chatTab.selectContact.active .btnFloat,
.chatTab.settings.active .btnFloat,
.chatTab.list.active .btnFloat {
    transform: translate(0, 0);
}


.chatTab.contacts .btnFloat {
    background-image: url(../Images/Add.png);
}
.chatHead[state=room] img,
.chatHead[state=room] h2 {
    cursor: pointer;
}

.replyBox {
    box-sizing: border-box;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    box-shadow: 0px 9px 18px -21px #000;
    position: absolute;
    bottom: 50px;
    background-color: #DCEDC8;
    margin: 8px;
    z-index: 7;
    width: calc(100% - 16px);
    transform: translate(200%, 0);
    transition: all cubic-bezier(0.42, 0, 0.04, 1.01) .7s;
}

    .replyBox.active {
        transform: translate(0, 0);
    }

    .replyBox > div {
        background-color: #0000000a;
        width: 100%;
        border-radius: 2px;
        border-top: 3px solid var(--Success);
        display: flex;
        position: relative;
        align-items: center;
    }

        .replyBox > div > span {
            width: 36px;
            height: 36px;
            display: block;
            -webkit-mask-image: url(../Images/Close.svg);
            -webkit-mask-size: contain;
            -webkit-mask-repeat: no-repeat;
            background-color: var(--Success);
            cursor: pointer;
        }

    .replyBox .replyContent {
        display: block;
        position: relative;
        max-width: calc(100% - 36px);
        overflow: hidden;
    }

        .replyBox .replyContent h2 {
            margin: 0;
            font-size: 9pt;
        }

        .replyBox .replyContent p {
            margin: 0;
            font-size: 9pt;
            white-space: nowrap;
            text-overflow: ellipsis;
            display: block;
            overflow: hidden;
            text-align: right;
        }

.imgGroup {
    display: block;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    cursor: pointer
}


    .imgGroup img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .imgGroup .fliImage {
        position: absolute;
        display: block;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

.txtGroupName {
    background-color: #F1F4F9;
    border: none;
    font-size: 12pt;
    padding: 6px 12px;
    border-radius: 4px;
    margin: 8px 16px;
    box-sizing: border-box;
    width: calc(100% - 32px);
    display: block;
    background-color: #fafafa;
    color: #212121;
    text-align: center;
}

    .txtGroupName:focus {
        background-color: #F1F4F9;
    }

.imgGroup > a {
    position: absolute;
    display: block;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 32px;
    background-color: #0000004a;
    transition: all ease .3s;
    transform: translate(0, 100%);
    background-image: url(../Images/trash.png);
    background-position: center center;
    background-size: 24px;
    background-repeat: no-repeat;
}

.imgGroup.fill:hover a {
    transform: translate(0, 0);
}

.chatTab.settings {
    display: flex;
    flex-direction: column;
}

.manageContacts {
    display: flow-root;
    padding: 0 8px;
    flex: 1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 14px;
    margin-left: 8px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .switch .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        -webkit-transition: .4s;
        transition: .4s;
        border-radius: 34px;
    }

        .switch .slider:before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 0;
            background-color: #fafafa;
            top: 50%;
            transition: all ease .3s;
            transform: translate(0, -50%);
            box-shadow: 0 0 4px -1px #000000b0;
            border-radius: 50%;
        }

    .switch input:checked + .slider {
        background-color: #ffc10747;
    }

    .switch input:focus + .slider {
        box-shadow: 0 0 1px #2196F3;
    }

    .switch input:checked + .slider:before {
        transform: translate(16px, -50%);
        background-color: #ffc107;
    }

.chanel .roomContent {
    height: 100%;
}

.chanel .roomFoot {
    display: none;
}

.roomContent:empty:before,
.chatTab.contacts > div:empty:before,
.chatTab.list > div:empty:before {
    content: 'مخاطب فعالی یافت نشد';
    text-align: center;
    display: flow-root;
    font-size: 12pt;
    margin: 16px;
    color: #b6b6b6;
}

.chatTab.list > div:empty:before {
    content: 'چت فعالی یافت نشد';
}

.roomContent:empty:before {
    content: 'پیامی یافت نشد';
}