//@import "../../../abstracts/abstracts";
$chat-max-width: 768px;

$chat-item-self-background-color: $color-subtle;
$chat-item-self-text-color: $text-color-default;
$chat-item-self-create-time-text-color: $color-primary;
$chat-item-other-background-color: $color-layer-3;
$chat-item-other-text-color: $text-color-default;

$chat-item-margin: $margin-default;
$chat-item-padding: $padding-default;
$chat-item-border-radius: $border-radius-default;

$chatbox-background-color: $background-item-color-default;

.dbq-chat-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    width: 100%;
    // height: calc(100% - #{$toolbar-height}); // Turned off the toolbar since it had no options anyway
    height: 100%;
    clear: both;
    margin: 0;
    padding: 0;
    background-color: unset;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    box-shadow: none;
    border-radius: $border-radius-default;
    background-color: $classlist-background;

    &[data-is-loading="true"] {
        min-height: (100 + ($padding-default * 2));

        .dbqdclc-loading-view {
            display: block;
        }
    }

    &[data-is-empty="true"] {
        justify-content: center;
    }

    .dbqdclc-loading-view {
        display: none;
    }
}

.dbqdclc-chat-host {
    height: 100%;
    min-height: 0;
}

.dbq-chat-container.dbqchat {
    min-height: 0;
    height: 100%;
    overflow: hidden;

    .dbqdclc-chat-window {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .dbqdclc-items {
        width: 100%;
        flex: 1 0 auto;
    }

    .dbqdclc-chat-message-container {
        flex: 0 0 auto;
        width: 100%;
    }

    .dbqchat-item-meta,
    .dbqchat-item-author {
        display: none !important;
    }

    .dbqchat-item-time {
        display: block;
    }

    .dbqdclc-item-content {
        min-width: 0;
    }

    .dbqdclc-item-image,
    .dbqchat-item-avatar,
    .dbqchat-item-initials {
        width: 64px;
        height: 64px;
        flex: 0 0 auto;
    }

    .dbqdclc-item-image img {
        max-width: none;
    }

    .dbqdclc-divider-container {
        width: 100%;
    }

    .dbqdclc-chat-message-textarea {
        min-height: 32px;
        max-height: 160px;
        overflow-y: auto;
    }

    .dbqdclc-processing-indicator {
        margin-bottom: $margin-default;
    }
}

// Activity logs in a bottom class list may not use the full height, but must have a max height instead.
// This is due to the load-more mechanic. If there is no end to the list, it will load more infinitely.
.document-class-list-control-container {
    .document-class-list-control-content-container {
        &[data-class-list-display-mode="2"],
        &[data-class-list-display-mode="3"],
        &[data-class-list-display-mode="4"] {
            .classlist-window[data-window-index="1"] {
                .dbq-chat-container {
                    max-height: 500px;
                }
            }
        }
    }
}

// When the screen is too small, a left/right list will be displayed like a top/bottom list instead.
// In this case we must ensure the max-height is also used even though this is a left/right configured list.
@media only screen and (max-width: 1024px) {
	.document-class-list-control-container {
		.document-class-list-control-content-container {
			&[data-class-list-display-mode="1"],
			&[data-class-list-display-mode="5"] {
                .classlist-window[data-window-index="1"] {
                    .dbq-chat-container {
                        max-height: 500px;
                    }
                }
			}
		}
	}
}