@import '../../../css/variables/definition.scss';

.comm {
    display: flex;
    flex-direction: column;
    width: 320px;
    background-color: var(--dark-fore-color);
    border: 1px solid var(--title-bg-color);
    margin-left: 12px;

    & {
        --dark-fore-color: #fff;
        --dark-fore-opacity-color: rgba(255, 255, 255, .6);
        --strong-color: #333;
        --light-color: #ccc;
    }

    .roundbtn {
        width: 30px;
        height: 30px;
        display: inline-block;
        box-sizing: border-box;
        cursor: pointer;
        padding: 7px;
        margin-left: 10px;
        fill: var(--dark-fore-color);
        border-radius: 15px;
        border: none;
        outline: none;
        transition: background-color .2s;
        user-select: none;

        &:hover {
            background-color: var(--dark-fore-opacity-color);

            >svg {
                opacity: .6;
            }
        }

        &.disabled {
            fill: lightgray;
            background-color: transparent !important;

            &:hover {
                opacity: unset;
            }
        }

        >svg {
            width: 13px;
            height: 14px;
            display: block;
            transition: opacity .2s;
        }
    }

    .image-check-box {
        user-select: none;

        >input[type="checkbox"] {
            display: none;

            &:checked~.unchecked {
                display: none;
            }

            &:checked~.checked {
                display: unset;
            }
        }

        >.unchecked {
            opacity: .5;
        }

        >.checked {
            display: none;
        }
    }

    .title-bar {
        flex: 0 0 auto;
        padding: 5px 0 5px 10px;
        color: var(--title-color);
        background-color: var(--title-bg-color);
        line-height: 24px;
        display: flex;
        align-items: center;
        font-size: 1.2em;

        >div {
            flex: 1 1 auto;
        }

        >.title-functions {
            flex: 0 0 auto;
            display: flex;
            padding: 4px;

            >label {
                margin: 0 4px;
                box-sizing: border-box;
                cursor: pointer;
                width: 30px;
                height: 30px;
                background-color: var(--dark-fore-color);
                border-radius: 15px;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: background-color .2s;

                >svg {
                    fill: var(--strong-color);
                    width: 14px;
                    height: 14px;
                    transition: opacity .2s;
                }

                &:hover {
                    background-color: var(--dark-fore-opacity-color);

                    >svg {
                        opacity: .6;
                    }
                }

                &.disabled {
                    cursor: default;
                    opacity: .6;

                    &:hover {
                        background-color: var(--dark-fore-color);

                        >svg {
                            opacity: unset;
                        }
                    }
                }
            }
        }
    }

    .contact-bar {
        flex: 0 0 auto;
        padding: 4px 0;
        display: flex;
        border-bottom: 1px solid var(--title-bg-color);

        >.bar-icon {
            flex: 0 0 auto;

            >svg {
                width: 30px;
                height: 30px;
                margin: 0 8px;
            }
        }

        >.bar-list {
            flex: 1 1 auto;
            width: calc(100% - 46px);

            .contact-item {
                display: flex;
                align-items: center;
                line-height: 22px;

                >svg {
                    flex: 0 0 auto;
                    width: 16px;
                    height: 16px;
                    margin-right: 6px;
                    fill: var(--strong-color);
                }

                >span {
                    flex: 1 1 auto;
                    color: var(--strong-color);
                    font-size: var(--font-larger-size);
                    overflow: hidden;
                    text-overflow: ellipsis;
                    padding-right: 10px;
                }
            }
        }

        .roundbtn {
            float: right;
            margin: 4px 10px 10px;

            >svg {
                width: 16px;
            }
        }
    }

    .message-bar {
        flex: 0 0 auto;
        border-bottom: 1px solid var(--title-bg-color);
        display: flex;
        flex-direction: column;

        >textarea {
            padding: 10px 10px 0;
            border: none;
            height: 70px;
        }

        >div {
            padding: 0 10px 10px;

            >.prompt-count {
                display: inline-block;
                color: var(--light-color);
            }
        }
    }

    .list-bar {
        flex: 1 1 auto;
        overflow: auto;
        margin-top: 8px;

        .item-div {
            margin-top: 5px;
            border-bottom: solid 1px lightgray;
            padding: 3px 10px 5px;
            line-height: 1.5rem;
            white-space: normal;
            word-break: break-word;
            overflow: hidden;
            font-size: .8125rem;
            color: #333;
            display: flex;
            flex-direction: column;

            &:last-child {
                border-bottom: none;
            }

            .item-poster {
                font-weight: bold;
                align-self: flex-start;

                .tooltip-wrapper>.tooltip-content {
                    font-weight: normal;
                }
            }

            .item-content {
                line-height: 1.2rem;
                padding: 8px 20px;
                border-radius: 5px;
                white-space: pre-wrap;
                word-break: break-word;
                max-width: 240px;
                background-color: rgb(244, 244, 244);

                a>svg {
                    width: 13px;
                    height: 13px;
                    fill: #2140fb;

                    &:hover {
                        border-bottom: 1px solid;
                    }
                }

                >span::after {
                    content: '';
                    display: block;
                }

                .item-status {
                    text-align: right;
                    margin-top: 3px;
                    font-weight: bold;
                    margin-right: -12px;
                    font-size: 10px;
                    float: right;
                }
            }

            .item-time {
                align-self: flex-end;
                color: #aaa;
                font-size: .7rem;
            }

            &.item-other {
                .item-content {
                    margin-left: 10px;
                    align-self: flex-start;
                }
            }

            &.item-self {

                .item-poster,
                .item-content {
                    align-self: flex-end;
                }

                .item-content {
                    margin-right: 10px;
                    background-color: #9eea6a;
                }
            }

            &.item-sent .item-content {
                background-color: rgb(164, 226, 251);
            }
        }
    }

    .popup-mask .grid {
        height: 100%;
        min-height: 120px;
        overflow: hidden;

        >.grid-body .grid-body-content>.grid-row>td {
            vertical-align: top;

            .col-icon {
                padding: 10px 4px 10px 8px;
            }

            .icon-contact-type {
                cursor: unset;

                >svg {
                    fill: #333;
                }

                &:hover>svg {
                    opacity: unset;
                }
            }

            .contact-wrapper {
                width: 100px;
                padding: var(--spacing-cell);

                .contact-name {
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                .contact-note {
                    color: #999;
                }
            }
        }
    }
}