/* ===== MC SHOP CHATBOT WIDGET ===== */

/* Floating Toggle Button */
.chatbot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatbot-pulse 2s infinite;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(102, 126, 234, 0.6);
}

.chatbot-toggle i {
    font-size: 26px;
    color: #fff;
    transition: transform 0.3s ease;
}

.chatbot-toggle.active i {
    transform: rotate(90deg);
}

@keyframes chatbot-pulse {
    0% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.45); }
    50% { box-shadow: 0 4px 30px rgba(102, 126, 234, 0.7); }
    100% { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.45); }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 540px;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-window.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    backdrop-filter: blur(10px);
}

.chatbot-header-info h6 {
    margin: 0;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.chatbot-header-info span {
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
}

.chatbot-header-info .status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    margin-right: 4px;
    animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: msg-fadeIn 0.3s ease;
}

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

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.bot {
    align-self: flex-start;
}

.msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-message.bot .msg-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.chat-message.user .msg-avatar {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.bot .msg-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-message.user .msg-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-bubble a {
    color: #93c5fd;
    text-decoration: underline;
    font-weight: 500;
}

.msg-bubble a:hover {
    color: #bfdbfe;
}

.msg-bubble strong {
    font-weight: 600;
}

.msg-bubble p {
    margin: 0 0 6px 0;
}

.msg-bubble p:last-child {
    margin-bottom: 0;
}

.msg-bubble ul, .msg-bubble ol {
    margin: 4px 0;
    padding-left: 18px;
}

.msg-bubble li {
    margin-bottom: 2px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    max-width: 88%;
}

.typing-indicator .msg-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.typing-dots {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 12px 18px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}

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

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

/* Quick Actions */
.chatbot-quick-actions {
    padding: 8px 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.quick-action-btn {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #a5b4fc;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.quick-action-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    color: #c7d2fe;
    border-color: rgba(102, 126, 234, 0.5);
}

/* Input Area */
.chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.chatbot-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 10px 16px;
    color: #e2e8f0;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input-area input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.chatbot-input-area input:focus {
    border-color: rgba(102, 126, 234, 0.5);
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 10px 0;
}

.welcome-message .welcome-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.welcome-message h5 {
    color: #e2e8f0;
    font-size: 16px;
    margin-bottom: 4px;
}

.welcome-message p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 8px;
        border-radius: 16px;
    }

    .chatbot-toggle {
        width: 54px;
        height: 54px;
        bottom: 16px;
        right: 16px;
    }

    .chatbot-toggle i {
        font-size: 22px;
    }
}
