/**
 * MAC Chatbot Styles
 */

/* Container */
.mac-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Language Selector (hiển thị trong messages) */
.mac-chatbot-language-content {
    text-align: center;
    padding: 20px;
}

.mac-chatbot-language-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.mac-chatbot-language-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
}

.mac-chatbot-lang-btn {
    padding: 12px 20px;
    background-color: #ffffff !important;
    border: 2px solid var(--mac-chatbot-accent,#0073aa) !important;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--mac-chatbot-accent,#0073aa) !important;
    transition: all 0.3s ease;
    width: 100%;
}

.mac-chatbot-lang-btn:hover {
    background-color: var(--mac-chatbot-accent,#0073aa) !important;
    color: var(--mac-chatbot-accent-text,#ffffff) !important;
    border-color: var(--mac-chatbot-accent,#0073aa) !important;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--mac-chatbot-accent,#0073aa) !important;
}

.mac-chatbot-lang-btn:active {
    transform: translateY(0);
}

/* Chat Window */
.mac-chatbot-chat-window {
    width: 380px;
    height: 600px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mac-chatbot-chat-window.mac-chatbot-minimized {
    height: 60px;
    cursor: pointer;
}

.mac-chatbot-chat-window.mac-chatbot-minimized .mac-chatbot-header {
    cursor: pointer;
}

/* Header */
.mac-chatbot-header {
    background-color: var(--mac-chatbot-accent,#0073aa);
    color: var(--mac-chatbot-accent-text,#ffffff);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mac-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.mac-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mac-chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mac-chatbot-info {
    flex: 1;
}

.mac-chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.mac-chatbot-status {
    font-size: 12px;
    opacity: 0.9;
}

.mac-chatbot-header-actions {
    display: flex;
    gap: 8px;
}

.mac-chatbot-minimize,
.mac-chatbot-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mac-chatbot-minimize:hover,
.mac-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Icons */
.mac-chatbot-icon-minus::before {
    content: "−";
    font-size: 20px;
    line-height: 1;
}

.mac-chatbot-icon-close::before {
    content: "×";
    font-size: 24px;
    line-height: 1;
}

.mac-chatbot-icon-send::before {
    content: "→";
    font-size: 18px;
}

.mac-chatbot-icon-chat {
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages Area */
.mac-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mac-chatbot-message {
    display: flex;
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

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

.mac-chatbot-message.mac-chatbot-user {
    justify-content: flex-end;
}

.mac-chatbot-message.mac-chatbot-bot {
    justify-content: flex-start;
}

.mac-chatbot-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.mac-chatbot-message.mac-chatbot-user .mac-chatbot-message-content {
    background-color: var(--mac-chatbot-accent,#0073aa);
    color: var(--mac-chatbot-accent-text,#ffffff);
    border-bottom-right-radius: 4px;
}

.mac-chatbot-message.mac-chatbot-bot .mac-chatbot-message-content {
    background-color: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.mac-chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.mac-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: typing 1.4s infinite;
}

.mac-chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.mac-chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Suggestions */
.mac-chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.mac-chatbot-suggestion-btn {
    padding: 10px 16px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
}

.mac-chatbot-suggestion-btn:hover {
    background-color: var(--mac-chatbot-accent-text,#f0f0f0);
    border-color: var(--mac-chatbot-accent,#0073aa);
}

/* Menu Options (quick-reply cho danh mục dịch vụ) */
.mac-chatbot-menu-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px 4px;
}

.mac-chatbot-menu-btn {
    padding: 8px 14px;
    background-color: var(--mac-chatbot-accent-text,#f7f9fc);
    border: 1px solid var(--mac-chatbot-accent,#0073aa);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mac-chatbot-accent,#0073aa);
    transition: all 0.2s;
    white-space: nowrap;
}
.mac-chatbot-menu-btn {
    padding: 8px 14px;
    background-color: var(--mac-chatbot-accent,#0073aa);
    border: 1px solid var(--mac-chatbot-accent-text,#f7f9fc);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mac-chatbot-accent-text,#f7f9fc);
    transition: all 0.2s;
    white-space: nowrap;
}

.mac-chatbot-menu-btn:hover {
    background-color: var(--mac-chatbot-accent-hover,#0073aa);
    color: var(--mac-chatbot-accent-text-hover,#ffffff);
}

/* Menu options bên trong related — bỏ padding ngang */
.mac-chatbot-related .mac-chatbot-menu-options {
    padding: 0;
}

/* Related Questions */
.mac-chatbot-related {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.mac-chatbot-related-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.mac-chatbot-related-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mac-chatbot-related-item {
    padding: 8px 12px;
    background-color: var(--mac-chatbot-accent,#0073aa);
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--mac-chatbot-accent-text,#f9f9f9);
    transition: background-color 0.2s;
}

.mac-chatbot-related-item:hover {
    background-color: var(--mac-chatbot-accent-hover,#f0f0f0);
    color: var(--mac-chatbot-accent-text-hover,#0073aa);
}

/* Input Area */
.mac-chatbot-input-area {
    padding: 15px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mac-chatbot-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.mac-chatbot-input:focus {
    border-color: var(--mac-chatbot-accent,#0073aa);
}

.mac-chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--mac-chatbot-accent,#0073aa) !important;
    color: var(--mac-chatbot-accent-text,#ffffff) !important;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.mac-chatbot-send-btn:hover {
    background-color: var(--mac-chatbot-accent-hover,#005a87) !important;
    color: var(--mac-chatbot-accent-text-hover,#ffffff) !important;
}

.mac-chatbot-send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Floating Button */
.mac-chatbot-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--mac-chatbot-accent,#0073aa);
    color: var(--mac-chatbot-accent-text,#ffffff);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--mac-chatbot-accent,#0073aa);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mac-chatbot-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--mac-chatbot-accent-hover, var(--mac-chatbot-accent,#0073aa));
}

.mac-chatbot-toggle-btn.mac-chatbot-hidden {
    display: none !important;
}

/* Đảm bảo chat window ẩn khi đóng */
.mac-chatbot-chat-window[style*="display: none"] {
    display: none !important;
}

/* Đảm bảo toggle button luôn hiển thị khi chat đóng */
.mac-chatbot-toggle-btn:not(.mac-chatbot-hidden) {
    display: flex !important;
}

/* Welcome Message */
.mac-chatbot-welcome {
    text-align: center;
    padding: 20px;
    color: #666;
}

.mac-chatbot-welcome-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.mac-chatbot-welcome-text {
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
    .mac-chatbot-chat-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .mac-chatbot-container {
        bottom: 0;
        right: 0;
    }
}

