/* Nút icon chat ở góc */
#dsc-chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #87fa56;
    color: #333;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9998;
    transition: transform 0.2s;
}
#dsc-chat-icon:hover {
    transform: scale(1.1);
}

/* Cửa sổ chat */
#dsc-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transition: opacity 0.3s, transform 0.3s;
}

#dsc-chat-window.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header của cửa sổ chat */
#dsc-chat-header {
    background-color: #87fa56;
    color: #333;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#dsc-close-chat {
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

/* Phần hiển thị tin nhắn */
#dsc-chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Định dạng các tin nhắn */
.dsc-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.dsc-message.bot {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.dsc-message.user {
    background-color: #87fa56;
    color: #333;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* NÂNG CẤP v2.0: Hiệu ứng tải bên trong tin nhắn bot */
.dsc-message .dsc-loading {
    display: flex;
    align-items: center;
    height: 17px; /* Cùng chiều cao với text */
}
.dsc-message .dsc-loading span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}
.dsc-message .dsc-loading span:nth-child(1) { animation-delay: -0.32s; }
.dsc-message .dsc-loading span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Footer của cửa sổ chat */
#dsc-chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #fff;
}
#dsc-chat-form {
    display: flex;
}
#dsc-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

#dsc-chat-form button {
    background-color: #87fa56;
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s;
}

#dsc-chat-form button:hover {
    background-color: #76e145;
}

#dsc-chat-form button svg {
    width: 20px;
    height: 20px;
    stroke: #333;
}

/* Định dạng cho các link trong tin nhắn */
.dsc-message a {
    color: #005fcc;
    text-decoration: underline;
}

.dsc-message a:hover {
    text-decoration: none;
}