﻿body {
    font-family: Arial !important;
}

/* Main Content Styles */
.main-content {
    padding: 80px 15px;
    text-align: center;
}

    .main-content h1 {
        font-size: 48px;
        font-weight: 700;
        color: #212529;
    }

    .main-content p {
        font-size: 20px;
        font-weight: 300;
        margin-top: 24px;
        color: #6c757d;
    }

/* Chat Window Styles */
.chat-window {
    top: 0;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid #dddddde0;
}

/* Chat Header Styles */
.chat-header {
    background-color: #ffffff;
    color: #000000;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.chat-header-left {
    display: flex;
    align-items: center;
    position: relative; /* For dropdown positioning */
}

.avatar-group {
    position: relative;
    width: 70px;
    height: 40px;
    display: flex;
    align-items: center;
}

    .avatar-group .avatar {
        position: absolute;
        top: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid #2196F3;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: #fff4d2;
        transition: all 0.3s ease;
    }

        .avatar-group .avatar.ai {
            z-index: 2;
            right: 0;
            opacity: 1;
            filter: grayscale(0%);
        }

        .avatar-group .avatar.cskh {
            z-index: 1;
            right: 30px;
            opacity: 0.6;
            filter: grayscale(100%);
        }

    .avatar-group.active-cskh .avatar.ai {
        z-index: 1;
        right: 30px;
        opacity: 0.6;
        filter: grayscale(100%);
    }

    .avatar-group.active-cskh .avatar.cskh {
        z-index: 2;
        right: 0;
        opacity: 1;
        filter: grayscale(0%);
    }

.avatar i, .avatar img {
    font-size: 24px;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar.ai i {
    color: #007bff;
}

.chat-title-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    font-weight: bold;
    color: #696969;
    display: flex;
    align-items: center;
}

    .chat-title-btn:hover {
        color: #007bff;
    }

    .chat-title-btn::after {
        display: inline-block;
        margin-left: 4px;
        vertical-align: 2px;
        content: "";
        border-top: 5px solid;
        border-right: 5px solid transparent;
        border-bottom: 0;
        border-left: 5px solid transparent;
    }

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    list-style: none;
    padding: 8px 0;
    margin: 8px 0 0 0;
    z-index: 1001;
}

    .dropdown-menu.show {
        display: block;
    }

    .dropdown-menu a {
        display: block;
        padding: 8px 16px;
        color: #212529;
        text-decoration: none;
        white-space: nowrap;
    }

        .dropdown-menu a:hover {
            background-color: #f3f4f6;
        }

        .dropdown-menu a i {
            margin-right: 8px;
        }


/* Chat Content & Messages */
.chat-content {
    flex-grow: 1;
/*    padding: 4px 16px 16px 16px;
*/    overflow-y: hidden; /* Hide scrollbar for the container */
    display: flex;
    flex-direction: column;
}

.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-right: 8px; /* Space for scrollbar */
}

.message-container {
    position:relative;
    margin-bottom: 8px;
    display: flex;
    max-width: 90%;
    font-size: 14px;
}
    .message-container .datecreated {
        display: block;
        padding-top: 2px;
        color: #9ca3af;
        font-size: 11px;
    }
.message-role{
    position:relative;
}
.message-container.bot {
    position: relative;
}
        .message-container.bot.gallery {
            padding-bottom: 8px;
        }
        .message-container.user-message {
        margin-left: auto;
        justify-content: flex-end;
    }
            .message-container.user-message .avatar{
                display:none;
            }
            .message-container .message-role {
                background-color: #e5f1ff;
                color: #081b3a;
                border: 1px solid #00000000;
                border-radius: 12px;
                box-shadow: 0px 0px 1px 0px #15274740, 0px 1px 1px 0px #15274724;
            }
.response-message .message-role {
    background-color: #fff !important;
}
.gallery-item .sender-name {
    color: #000000c2 !important;
}
.gallery-item{
    margin-bottom:16px;
}
.gallery-item.end {
    margin-bottom: 0px !important;
}
.file .gallery-item {
    position: relative;
    display: flex;
    gap: 8px;
    text-decoration: unset !important;
}
    .file .gallery-item .file-type {
        color: #696969;
    }
    .message-container.user-message + .message-container.user-message {
        margin-top: -12px;
        margin-bottom: 12px;
    }

    .message-container.response-message + .message-container.response-message {
        margin-top: -12px;
        margin-bottom: 12px;
    }
.message-container.error .message-role {
    border: 2px solid #ff00004d;
}

.user-message-bubble, .response-message-bubble, .file-message-bubble, .article-message-bubble {
    padding: 8px 16px;
    border-radius: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.user-message-bubble {
    background-color: #e6f2ff;
    color: #000000;
    padding: 8px 12px;
}

.response-message-bubble {
    background-color: #fff;
    color: #000000;
    max-width: calc(100% - 44px);
}
    .response-message-bubble.link {
        border: 1px solid #0067ffd4;
    }
    .response-message-bubble .chat-image-item .sender-name {
        color: #5f5f5f !important;
    }
    .response-message-bubble .chat-image-item {
        display: flex;
        gap: 16px;
    }

    .message-role .sender-name {
        font-weight: 700;
        color: #696969;
        margin-bottom: 4px;
    }

.bot .response-message-bubble .sender-name {
    color: #2196F3;
}

.system-message-container {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    padding: 0px 16px 16px 16px;
}
.liner {
    padding: 16px;
    margin: 0px 16px;
    -webkit-box-align: center;
    align-items: center;
    position: relative;
    -webkit-box-pack: center;
    justify-content: center;
    display: flex
}
    .liner::after {
        content: "-";
        display: block;
        position: absolute;
        top: 30px;
        right: 0px;
        width: 100%;
        background: #d8d8d8;
        height: .5px;
        color: transparent;
        z-index: 0;
    }
.system-message {
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    text-align: center;
    color: rgb(128, 128, 137);
    border: 1px solid rgb(235, 235, 240);
    background-color: #ffff;
    padding: 4px 8px;
    border-radius: 12px;
    word-break: break-word;
    width: fit-content;
    z-index: 11;
    /*    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    padding: 1.5rem 1rem;*/
}
/* Message Bubbles (Article, File, Pro) */
.article-message-bubble {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    padding: 12px;
    border-radius: 12px;
    display: block;
    text-decoration: none;
    color: #1f2937;
}

    .article-message-bubble .article-title {
        font-weight: 700;
        color: #3F51B5;
    }

    .article-message-bubble .article-source {
        font-size: 12px;
        color: #9E9E9E;
        margin-top: 4px;
    }

.file-message-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

    .file-message-bubble .file-icon {
        font-size: 32px;
    }

    .file-message-bubble .file-details {
        display: flex;
        flex-direction: column;
    }

    .file-message-bubble .file-name {
        font-weight: 700;
    }

    .file-message-bubble .file-size {
        font-size: 12px;
        color: #6c757d;
    }

.pro-package-container {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
}

.pro-package-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-shrink: 0;
    width: 150px;
    text-align: center;
}

    .pro-package-card .package-title {
        font-weight: 700;
        font-size: 14px;
        color: #2196F3;
    }

    .pro-package-card .package-price {
        font-size: 20px;
        font-weight: 700;
        color: #000000;
        margin: 4px 0;
    }

    .pro-package-card .pro-package-button {
        font-size: 12px;
        background-color: #007bff;
        color: #ffffff;
        border: none;
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        margin-top: 8px;
    }

        .pro-package-card .pro-package-button:hover {
            background-color: #0056b3;
        }

/* Response Actions (Like/Dislike) */
.response-message .response-actions {
    display: flex;
    gap: 12px;
    color: #6b7280;
    margin: 8px 10px;
    align-self: flex-start;
    position: absolute;
    bottom: -6px;
    right: 0px;
}
.bi-copy::before {
    font-size: 11px;
}
.response-actions button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
}
.message-container .avatar {
    margin: -2px 0px 0px 0px;
    width: 35px;
    height: 35px;
    font-size: 14px;
}

.avatar {
    border: 2px solid #fff;
    box-shadow: 0px 0px 1px 0px #15274740, 0px 1px 1px 0px #15274724;
    background-color: #f4b624e3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    flex-shrink: 0;
    line-height: 35px;
    font-size: 20px;
}
    .avatar.admin {
        background-color: #5E81F4;
    }
    .response-actions button:hover {
        color: #000000;
    }

        .response-actions button.active i.bi-hand-thumbs-up,
        .response-actions button.active i.bi-hand-thumbs-down {
            color: #007bff;
            transform: scale(1.1);
        }

.bi {
    position: relative;
}


.bi-hand-thumbs-up:hover::before {
    filter: invert(0%) sepia(4%) saturate(0%) hue-rotate(309deg) brightness(100%) contrast(107%) !important;
}




.bi-hand-thumbs-down:hover::before {
    filter: invert(0%) sepia(4%) saturate(0%) hue-rotate(309deg) brightness(100%) contrast(107%) !important;
}
/* Audio Player */
.audio-player-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .audio-player-container audio {
        width: 150px;
        height: 30px;
    }

.audio-download-btn {
    background: none;
    border: 1px solid #0000001A;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
}

/* Chat Footer & Input */
.chat-footer {
    border-top: 1px solid #e5e7eb;
    padding: 0px;
    padding: 16px;
}

.mss-cnt {
    display: flex;
    border: 1px solid #0000001A;
    border-radius: 20px;
    overflow: hidden;
    gap:16px;
}

.chat-input-wrapper {
    position: relative;
}
#send-btn {
    filter: invert(65%) sepia(97%) saturate(0%) hue-rotate(108deg) brightness(109%) contrast(88%);
}
#message-input {
    width: 100%;
    height: 24px;
    min-height: 24px;
    max-height: 150px;
    resize: none;
    overflow-y: auto;
    border-radius: unset;
    border: unset;
    padding: 0px 4px !important;
    box-sizing: border-box;
    font-size: 14px;
    margin: 8px 0px 8px 8px;
}

    #message-input:focus {
        outline: none;
        border-color: unset;
        box-shadow: unset;                                          
    }
.mss-cnt:focus {
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.send-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

    .send-btn i {
        font-size: 20px;
        color: #cccccc;
    }

.ai-disclaimer {
    margin-top: 8px;
    text-align: center;
    color: #6c757d;
    font-size: 12px;
}

/* Toast Notification */
.toast-container {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    width: 80%;
}

    .toast-container.show {
        opacity: 1;
    }

.chat-toast {
    background-color: rgba(173, 216, 230, 0.9);
    color: #000000;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: inline-block;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1002;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

    .modal.show {
        display: flex;
    }

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-align: center;
}

    .modal-content h5 {
        margin: 0;
        font-size: 18px;
    }

    .modal-content textarea {
        width: 100%;
        margin-top: 16px;
        padding: 8px;
        border: 1px solid #0000001A;
        border-radius: 8px;
        box-sizing: border-box;
    }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

    .modal-footer button {
        padding: 8px 16px;
        border-radius: 8px;
        border: none;
        cursor: pointer;
    }

.modal-btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.modal-btn-primary {
    background-color: #007bff;
    color: #ffffff;
}




#chat-title-text {
    color: #696969 !important;
    font-weight: bold;
}

.dropdown-toggle::after {
    display: inline-block;
    margin-left: 8px;
    margin-top: 2px;
    content: "";
    border-top: 5px solid #696969;
    border-right: 5px solid #00000000;
    border-bottom: 0;
    border-left: 5px solid transparent;
}

.dropdown-toggle.chat-toggle:hover {
    background-color: transparent !important;
    color: #007bff !important;
}

#chat-title-btn:hover #chat-title-text {
    color: #1c88ff !important;
}

#chat-title-btn:hover::after {
    border-top: 5px solid #1c88ff !important;
}

#ai-disclaimer {
    font-size: 12px;
}



.btn:focus {
    border: unset !important;
    box-shadow: unset !important;
}

.dragover::before {
    content:"";
    position:absolute;
    width:100%;
    height:100%;
    border: 2px dashed #3b82f6;
    border-radius: 8px;
    background: #f0f8ff;
    transition: all 0.2s ease-in-out;
    z-index: 999;
}
/* Preview container */
#preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Mỗi file item */
.file-preview {
    display: flex;
    align-items: center;
    background: #f7f7f8;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    color: #333;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    /* Nút xóa file */
    .file-preview button {
        border: none;
        background: transparent;
        color: #999;
        font-size: 14px;
        margin-left: auto;
        cursor: pointer;
        border-radius: 50%;
        transition: background 0.2s, color 0.2s;
    }

        .file-preview button:hover {
            background: #e5e5e5;
            color: #e63946; /* đỏ khi hover */
        }

/* Ảnh preview */
#preview img {
    border-radius: 6px;
    border: 1px solid #e5e5e5;
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
}
#messages-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 32px 0px 32px 8px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    background-color: #EBECF0;
}
    #messages-container::-webkit-scrollbar {
        width: 12px;
    }

    #messages-container::-webkit-scrollbar-thumb {
        background-color: #aaa;
        border-radius: 10px;
        border: 3px solid transparent; /* tạo khoảng cách giả */
        background-clip: content-box;
    }

.dropdown-item:hover {
    cursor: pointer;
}
.gallery-item a {
    text-decoration: unset !important;
}
.loader, .loader:before, .loader:after {
    border-radius: 50%;
    width: 8px;
    height: 8px;
    animation-fill-mode: both;
    animation: bblFadInOut 1.8s infinite ease-in-out;
}
.loading .response-message-bubble {
    min-width: 70px;
    min-height: 40px;
    display: flex;
    justify-content: center;
    padding: 0px;
}
.loader {
    color: #696969bd;
    font-size: 7px;
    position: relative;
    text-indent: -9999em;
    transform: translateZ(0);
    animation-delay: -0.16s;
}

    .loader:before,
    .loader:after {
        content: '';
        position: absolute;
        top: 0;
    }

    .loader:before {
        left: -14px;
        animation-delay: -0.32s;
    }

    .loader:after {
        left: 14px;
    }

@keyframes bblFadInOut {
    0%, 80%, 100% {
        box-shadow: 0 2.5em 0 -1.3em
    }

    40% {
        box-shadow: 0 2.5em 0 0
    }
}
.btn-loader {
    padding: .375rem 1.25rem;
    position: relative;
    height: 40px;
}
    .btn-loader::before {
        content: "";
        width: 24px;
        height: 24px;
        left: 10px;
        top: 8px;
        border-radius: 50%;
        display: inline-block;
        position: absolute;
        border: 3px solid;
        background-color: #ecb9b90d;
        border-color: rgba(255, 255, 255, 0.15) rgb(139 139 139 / 68%) rgba(255, 255, 255, 0.35) rgb(102 95 95 / 50%);
        box-sizing: border-box;
        animation: rotation 1.5s linear infinite;
    }
    .btn-loader.nextpage {
        padding: 40px 1.25rem .375rem 1.25rem !important;
        left: 50%;
    }
.nextpage.btn-loader::before {
    border-color: rgba(255, 255, 255, 0.15) rgb(139 139 139 / 22%) rgba(255, 255, 255, 0.35) rgb(102 95 95 / 25%) !important;
}
.icon-chatbox-mess {
    box-shadow: 0px 0px 1px 0px #15274740, 0px 1px 1px 0px #15274724;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #2196F3;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff4d2;
    color: #007bff;
    box-shadow: 0px 0px 1px 0px #15274740, 0px 1px 1px 0px #15274724;
}


@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


.n-bl {
    display: block;
    min-width: 34px;
    min-height: 30px;
}

#messages-container div:first-child .message-container {
    margin-top: 8px !important;
}

.datetimerender {
    color: #808089;
    background-color: #ddd;
    max-width: 200px;
    padding: 2px 16px;
    margin: 16px 60px 16px;
    border-radius: 20px;
    text-align: center;
    display: grid;
    font-size: 12px;
    font-weight: 400;
    justify-content: center;
    position: relative;
    opacity: .8;
}
