#chat-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Minimized state */
#chat-container.minimized {
    height: 60px;
    width: 300px;
}

#chat-container.minimized #chat-messages,
#chat-container.minimized #chat-input-container,
#chat-container.minimized #suggestions-container {
    display: none;
}

#chat-container.minimized #chat-header {
    border-radius: 10px;
    justify-content: space-between;
    padding: 15px;
}

#chat-container {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#chat-container.fade-out {
    opacity: 0;
    transform: translateY(20px);
}


#chat-container.d-none {
    opacity: 0;
    transform: translateY(20px); /* trượt nhẹ xuống khi ẩn */
    pointer-events: none;        /* tránh click khi ẩn */
}

/* Header */
#chat-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#toggle-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

#toggle-deleteChat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#toggle-deleteChat:hover {
    transform: scale(1.1);
}

/* Messages area */
#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 85%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    margin-left: auto;
    align-self: flex-end;
    width: fit-content;
    min-width: 50px;
    max-width: 85%;
}

.bot-message {
    background-color: #e9ecef;
    color: #495057;
    margin-right: auto;
    align-self: flex-start;
    width: fit-content;
    min-width: 50px;
    max-width: 85%;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    background-color: #e9ecef;
    border-radius: 18px;
    max-width: 85%;
    color: #6c757d;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
    margin-left: 10px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #adb5bd;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Suggestions area */
#suggestions-container {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.suggestion {
    background-color: #e9ecef;
    color: #495057;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.suggestion:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-1px);
}

/* Input area */
#chat-input-container {
    display: flex;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    background-color: white;
    transition: all 0.3s ease;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#send-button {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 25px;
    margin-left: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

#send-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

#send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Main content placeholder */
.main-content {
    margin-bottom: 100px; /* Để tránh bị che bởi chat */
}

.main-content h1 {
    color: #333;
    font-weight: 300;
}

/*.tooltip {*/
/*    position: relative;*/
/*    cursor: pointer;*/
/*}*/

/*.tooltip .tooltip-text {*/
/*    visibility: hidden;*/
/*    background-color: #333;*/
/*    color: #fff;*/
/*    text-align: center;*/
/*    padding: 4px 8px;*/
/*    border-radius: 4px;*/
/*    position: absolute;*/
/*    bottom: 125%;*/
/*    left: 50%;*/
/*    transform: translateX(-50%);*/
/*    white-space: nowrap;*/
/*    z-index: 1;*/
/*    font-size: 12px;*/
/*}*/

/*.tooltip:hover .tooltip-text {*/
/*    visibility: visible;*/
/*}*/


#toggle-btn {
    cursor: pointer;
    text-align: center;
    font-size: 24px;
    user-select: none;
}

/* Thanh kéo ở cạnh trên */
#resize-top {
    height: 6px;
    cursor: ns-resize;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* Thanh kéo ở cạnh phải */
#resize-right {
    width: 6px;
    cursor: ew-resize;
    background: transparent;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
}
