.o_mail_thread_loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.o_mail_thread_loading_icon {
    margin-right: 5px;
}

.o_mail_thread, .o_mail_activity {
    .o_thread_show_more {
        text-align: center;
    }

    .o_mail_thread_content {
        display: flex;
        flex-direction: column;
        min-height: 100%;
    }

    .o_thread_bottom_free_space {
        height: 15px;
    }

    .o_thread_tooltip_container {
        display: inline;
        position: relative;
    }

    .o_thread_date_separator {
        margin-top: 15px;
        margin-bottom: 30px;
        @include media-breakpoint-down(sm) {
            margin-top: 0px;
            margin-bottom: 15px;
        }
        border-bottom: 1px solid gray('400');
        text-align: center;

        .o_thread_date {
            position: relative;
            top: 10px;
            margin: 0 auto;
            padding: 0 10px;
            font-weight: bold;
            background: white;
        }
    }

    .o_thread_new_messages_separator {
        margin-bottom: 15px;
        border-bottom: solid lighten($o-brand-odoo, 15%) 1px;
        text-align: right;
        .o_thread_separator_label {
            position: relative;
            top: 8px;
            padding: 0 10px;
            background: white;
            color: lighten($o-brand-odoo, 15%);
            font-size: smaller;
        }
    }

    .o_thread_message {
        display: flex;
        padding: 4px $o-horizontal-padding;
        margin-bottom: 0px;

        &.o_mail_not_discussion {
            background-color: rgba(gray('300'), 0.5);
            border-bottom: 1px solid gray('400');
        }

        .o_thread_message_sidebar {
            flex: 0 0 $o-mail-thread-avatar-size;
            margin-right: 10px;
            margin-top: 2px;
            text-align: center;
            font-size: smaller;
            .o_thread_message_sidebar_image {
                position: relative;
                height: $o-mail-thread-avatar-size;

                .o_updatable_im_status {
                    width: $o-mail-thread-avatar-size;
                }
                .o_mail_user_status {
                    position: absolute;
                    bottom: 0;
                    right: 0;

                    &.fa-circle-o {
                        display: none;
                    }
                }
            }

            @include media-breakpoint-down(sm) {
                margin-top: 4px;
                font-size: x-small;
            }

            .o_thread_message_avatar {
                width: $o-mail-thread-avatar-size;
                height: $o-mail-thread-avatar-size;
                object-fit: cover;
            }
            .o_thread_message_side_date {
                display: none;
                margin-left: -5px;
            }
            .o_thread_message_star {
                display: none;
                margin-right: -5px;
            }

            .o_thread_message_side_date {
                opacity: 0;
            }

            .o_mail_thread_message_seen_icon:not(.o_all_seen) {
                opacity: $o-mail-thread-icon-opacity*0.5;
            }
        }
        .o_thread_icon {
            cursor: pointer;
            opacity: 0;
            &.fa-star {
                opacity: $o-mail-thread-icon-opacity;
                color: gold;
            }
        }

        &:hover, &.o_thread_selected_message {
            .o_thread_message_side_date {
                display: inline-block;
                opacity: $o-mail-thread-side-date-opacity;
            }
            .o_thread_icon {
                display: inline-block;
                opacity: $o-mail-thread-icon-opacity;
                &:hover {
                    opacity: 1;
                }
            }
            .o_thread_message_sidebar {
                .o_mail_thread_message_seen_icon {
                    display: none;
                }
            }
        }

        .o_mail_redirect {
            cursor: pointer;
        }

        .o_thread_message_core {
            flex: 1 1 auto;
            min-width: 0;
            max-width: 100%;
            word-wrap: break-word;
            > pre {
                white-space: pre-wrap;
                word-break: break-word;
                text-align: justify;
            }

            .o_mail_note_title {
                margin-top: 9px;
            }

            .o_mail_subject {
                font-style: italic;
            }

            .o_mail_notification {
                font-style: italic;
                color: gray;
            }

            [summary~=o_mail_notification] { // name conflicts with channel notifications, but is odoo notification buttons to hide in chatter if present
                display: none;
            }

            p {
                margin: 0 0 9px; // Required by the old design to override a general rule on p's
                &:last-child {
                    margin-bottom: 0;
                }
            }
            a {
                display: inline-block;
                word-break: break-all;
            }
            :not(.o_image_box) > img {
                max-width: 100%;
                height: auto;
            }

            .o_mail_body_long {
                display: none;
            }

            .o_mail_info {
                margin-bottom: 2px;

                strong {
                    color: $headings-color;
                }
            }

            .o_thread_message_star, .o_thread_message_needaction, .o_thread_message_reply, .o_thread_message_notification {
                padding: 4px;
            }

            .o_thread_message_notification {
                color: grey;
                &.o_thread_message_notification_error {
                    color: red;
                    opacity: 1;
                    cursor: pointer;
                }
            }

            .o_attachments_list, .o_attachments_previews {
                &:last-child {
                    margin-bottom: $grid-gutter-width;
                }
            }

            .o_thread_tooltip_container {
                display: inline;
                position: relative;
            }
        }
    }
    .o_thread_title {
        margin-top: 20px;
        margin-bottom: 20px;
        font-weight: bold;
        font-size: 125%;

        &.o_neutral_face_icon:before {
            @extend %o-nocontent-init-image;
            @include size(120px, 140px);
            background: transparent url(/web/static/src/img/neutral_face.svg) no-repeat center;
        }
    }

    .o_mail_no_content {
        @include o-position-absolute(30%, 0, 0, 0);
        text-align: center;
        font-size: 115%;
    }

    .o_thread_message .o_thread_message_core .o_mail_read_more {
        display: block;
    }
}

.o_web_client .popover .o_thread_tooltip_icon {
    min-width: 1rem;
}

.o_web_client.o_touch_device {
    .o_mail_thread .o_thread_icon {
        opacity: $o-mail-thread-icon-opacity;
    }
}

// ------------------------------------------------------------------
// Thread typing icon: shared between discuss and chat windows
// ------------------------------------------------------------------

.o_mail_thread_typing_icon {
    position: relative;
    text-align: center;
    margin-left: auto;
    margin-right: auto;

    .o_mail_thread_typing_icon_dot {
        display: inline-block;
        width: 3px;
        height: 3px;
        border-radius: 50%;
        background: gray('800');
        animation: o_mail_thread_typing_icon_dot 1.5s linear infinite;

        &:nth-child(2) {
            animation-delay: -1.35s;
        }

        &:nth-child(3) {
            animation-delay: -1.2s;
        }
    }
}

@keyframes o_mail_thread_typing_icon_dot {
    0%, 40%, 100% {
        transform: initial;
    }
    20% {
        transform: translateY(-5px);
    }
}

// ------------------------------------------------------------------
// Thread seen icon: shared between discuss and chat windows
// ------------------------------------------------------------------

.o_mail_thread_message_seen_icon {
    position: relative;
    opacity: 0.6;

    &.o_all_seen {
        color: $o-enterprise-color;
    }

    &:hover {
        cursor: pointer;
        opacity: 0.8;
    }

    .fa-check:nth-child(1) {
        padding-left: 3px;
    }

    .fa-check:nth-child(2) {
        position: absolute;
        top: -1px;
        left: 0px;
    }
}
