﻿/* Container chính cho widget */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050; /* Cao hơn hầu hết các element khác */
}

/* Nút bong bóng chat */
#chat-bubble {
    width: auto;
    height: 120px;
    aspect-ratio: 1;
    max-width: min-content;
    /* border-radius: 50%;
        background-color: var(--primary-color, #007bff);  Dùng biến màu chính nếu có */
    color: white;
    border: none;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    /*box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);*/
    transition: transform 0.2s ease-in-out;
    right: 20px;
    bottom: 3px;
    position: absolute;
}

    #chat-bubble:hover {
        transform: scale(1.1);
    }

/* Hộp chat */
#chat-box {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none; /* Không cho tương tác khi đang ẩn */
    /*---Bo sung --*/
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
}

    #chat-box.visible {
        pointer-events: auto;
        opacity: 1;
        visibility: visible; /* <-- QUAN TRỌNG: Làm cho element có thể tương tác */
        transform: scale(1) translateY(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* Ẩn/hiện (dùng class thay vì display:none để có transition) */
    #chat-box.hidden {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        display:none !important;
    }


/* Header của hộp chat */
#chat-header {
    background-color: var(--primary-color, #007bff);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    #chat-header h5 {
        margin: 0;
    }

#close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
}

    #close-chat-btn:hover {
        opacity: 1;
    }

/* Body của hộp chat */
#chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f4f7f9;
}

/* Footer của hộp chat */
#chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    display: flex;
}

#chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
}

    #chat-input:disabled {
        background-color: #f1f1f1;
    }

#send-chat-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: var(--primary-color, #007bff);
    color: white;
    flex-shrink: 0;
}

    #send-chat-btn:disabled {
        background-color: #a0c3e8;
        cursor: not-allowed;
    }


/* Trong wwwroot/css/chat-widget.css */
.chat-message {
    padding: 8px 12px;
    border-radius: 18px;
    margin-bottom: 10px;
    max-width: 80%;
    line-height: 1.4;
}

    .chat-message.system {
        background-color: #e9ecef;
        color: #333;
        align-self: flex-start;
    }

    .chat-message.user {
        background-color: var(--primary-color, #007bff);
        color: white;
        align-self: flex-end;
    }

#conversation-area {
    display: flex;
    flex-direction: column;
}