﻿
.chat-item {
    border-radius: 0.5rem;
    padding: var(--bs-dropdown-item-padding-y) var(--bs-dropdown-item-padding-x);
    transition: background-color 0.2s;
}

    .chat-item:hover {
        background-color: #f1f3f5;
    }

.chat-icon {
    font-size: 1.5rem;
    color: #0d6efd;
}

.chat-title {
    font-size: var(--fs-body-14);
}

.chat-message {
    font-size: 0.875rem;
}

.chat-time {
    font-size: 0.75rem;
}

#notification-loading {
    height: 40px; /* luôn chiếm chỗ cố định */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: #888;
}

    #notification-loading.d-none {
        visibility: hidden; /* ẩn nhưng vẫn giữ chỗ */
    }

.chat-box {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 340px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 460px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0d6efd;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 22px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.bubble-content {
    position: relative;
}

#chat-recipient-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 345px;
    padding: 10px;
    position: relative;
    height: 345px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    height: 100%;
}

.chat-msg {
    padding: 6px 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

    .chat-msg.you {
        align-self: flex-end;
        background: #d6e9ff;
        color: #084298;
    }

    .chat-msg.them {
        align-self: flex-start;
        background: #f1f1f1;
    }

    .chat-msg.system {
        align-self: center;
        background: beige;
        color: brown;
    }

    .chat-msg.border-info {
        border-left: 4px solid #17a2b8;
    }

/* ✅ Khung nhập được cập nhật giống ChatGPT */
.chat-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.chat-attach-btn {
    color: #555;
    cursor: pointer;
    font-size: 16px;
}

.chat-textarea,
#chat-input {
    flex-grow: 1;
    border: none;
    resize: none;
    outline: none;
    font-size: 14px;
    padding: 6px 8px;
    background: transparent;
    border-radius: 8px;
    min-height: 34px;
    max-height: 120px;
    line-height: 1.5;
    /* box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); */
}

.chat-send-btn {
    background-color: #0d6efd;
    border: none;
    color: white;
    border-radius: 50%;
    padding: 8px 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

    .chat-send-btn:hover {
        background-color: #0b5ed7;
    }

    .chat-send-btn:disabled {
        background-color: #6a717a;
    }

/* ✅ Quote hiển thị */
#chat-quote-pending {
    background-color: #e8f4ff;
    border: 1px solid #bee3f8;
    border-radius: 6px;
    font-size: 13px;
}

/* ✅ File preview */
#chat-file-preview {
    background-color: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    position: relative;
    padding-right: 28px;
}

.preview-body img {
    max-width: 120px;
    border-radius: 8px;
    margin-right: 8px;
}

/* ✅ Nút cuộn */
#scroll-to-bottom-btn {
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

/* ✅ Tải tin nhắn */
#chat-loading-indicator {
    transition: opacity 0.3s ease;
}

.chat-loading-blur {
    filter: blur(2px);
    pointer-events: none;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.chat-msg.bg-warning {
    animation: fadeHighlight 0.5s ease-in-out;
}

#scroll-to-bottom-btn:hover svg {
    color: #0d6efd;
    transition: color 0.2s ease-in-out;
}

@keyframes fadeHighlight {
    0% {
        background-color: #fff3cd;
    }

    100% {
        background-color: inherit;
    }
}

.call-popup {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #007bff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    width: 300px;
    padding: 20px;
    z-index: 9999;
    display: none;
    text-align: center;
    animation: popup-bounce 0.5s ease;
}

.popup-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-icon {
    font-size: 50px;
    animation: pulse 1s infinite;
}

.popup-info {
    margin-top: 10px;
    font-size: 14px;
    color: #555;
}

.popup-buttons {
    margin-top: 20px;
}

.btn.cancel {
    background-color: #ffc107;
    color: black;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

@keyframes popup-bounce {
    0% {
        transform: translate(-50%, -60%);
    }

    50% {
        transform: translate(-50%, -50%);
    }

    100% {
        transform: translate(-50%, -50%);
    }
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}