﻿html, body {
    height: 100%;
    margin: 0;
}

.chat-container {
    height: 100vh;
    overflow: hidden;
}

.conversation-list {
    overflow-y: auto;
    border-right: 1px solid #ddd;
}

.chat-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}
#chatMessages {
    background-color: #e3e9f1;
}
.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.message-content {
    padding: 2px 5px;
    border-radius: 6px;
    border: solid 0.5px #80808038;
    word-break: break-word;
}

.message-meta {
    font-size: 0.75rem;
    font-style: italic;
    color: gray;
    margin-top: 4px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.message-input {
    border-top: 1px solid #ddd;
    padding: 4px;
}

.message {
    max-width: 70%;
    margin-bottom: 10px;
    border-radius: 20px;
}

.sent {
    color: #282828;
    align-self: end;
}

.received {
    color: black;
    align-self: start;
}

.sent .message-content {
    background-color: #d8f0fe;
}

.received .message-content {
    text-align: start;
    background-color: white;
}

.sent .message-wrapper {
    text-align: end;
}

.received .message-wrapper {
    text-align: start;
}
/* Ẩn thanh cuộn ngang nếu cần */
::-webkit-scrollbar {
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 10px;
}

.username-ellipsis {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Đảm bảo ô nhập tin nhắn cố định dưới cùng */
.message-input {
    border-top: 1px solid #ddd;
    padding: 10px;
    position: relative;
}

/* Textarea tự động co giãn chiều cao */
.auto-resize {
    resize: none;
    overflow: hidden;
    min-height: 38px;
    max-height: 150px;
    line-height: 1.5;
    padding: 10px 12px;
}

#imagePreviewContainer {
    position: absolute;
    bottom: 50px;
}
#filePreviewContainer {
    position: absolute;
    bottom: 70px;
}

#filePreviewName {
    border-radius: 5px;
    padding: 4px;
    color: white !important;
    background-color: #0d6efd;
}
#imagePreview {
    max-width: 200px;
    border: solid 1px red;
    border-radius: 8px;
    margin-bottom: 1rem;
}

#removeImageBtn {
    position: absolute;
    padding: unset !important;
}

.chat-container {
    height: 100vh;
}

.conversation-list {
    height: 100%; /* dùng với .chat-container { height: 100vh } */
}

#conversationList {
    overflow-y: auto;
}

@media only screen and (max-width: 1200px) {
    .col-3 {
        width: 40% !important;
    }

    .col-9 {
        width: 60% !important;
    }
}

@media only screen and (max-width: 800px) {
    .col-3 {
        width: 100% !important;
    }

    .col-9 {
        width: 100% !important;
    }

    .conversation-list-hidden {
        display: none !important;
    }
}


.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

    .modal img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 8px;
        box-shadow: 0 0 15px #000;
    }

.file-download-link {
    display: inline-block;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
}
a {
    color: white;
    text-decoration: none;
}

#chatActions .optional-button {
    display: inline-block;
}

#chatActions.hide-optional .optional-button {
    display: none !important;
}
.badge {
    font-size: 10px;
    min-width: 24px;
    text-align: center;
}
