/* 💎 AI Chatbot Design System */
:root {
    --chat-primary: #6366f1;
    --chat-bg: rgba(255, 255, 255, 0.8);
    --chat-dark-bg: rgba(15, 23, 42, 0.85);
    --chat-text: #1e293b;
    --chat-text-light: #f8fafc;
    --chat-accent: #818cf8;
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
    --chat-radius: 20px;
}

#bt-ai-chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* 🎈 Chat Bubble */
#bt-ai-chatbot-bubble {
	position: fixed;
	bottom: 12px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--chat-primary), var(--chat-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#bt-ai-chatbot-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* 🪟 Chat Window */
#bt-ai-chatter-window {
    height: 85vh;
    background: var(--chat-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8) translateY(20px);
}
.bt-ai-chatbot-open{
    width: 50%;
}

.bt-ai-chatbot-open #bt-ai-chatter-window {
    opacity: 1;
    pointer-events: all;
    transform: scale(1) translateY(0);
}

.bt-ai-chatbot-open #bt-ai-chatbot-bubble {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* 🎨 Header */
#bt-ai-chatter-header {
    background: var(--chat-primary);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.header-info .dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
}

#bt-ai-chatter-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* 💬 Messages */
#bt-ai-chatter-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideUp 0.3s ease-out;
    word-wrap: break-word;
}

.message-content {
    white-space: pre-wrap;
    word-break: break-word;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.bot-message {
    background: white;
    color: var(--chat-text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.user-message {
    background: var(--chat-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* 🛠️ Loading Skeleton */
.loading-message {
    display: flex;
    gap: 5px;
    padding: 15px;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* 🛒 Product Cards */
.products-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.product-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    animation: slideIn 0.3s ease-out;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--chat-primary);
}

.product-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-img.no-img {
    background: linear-gradient(135deg, #f5f5f5, #e5e5e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8rem;
}

.product-info {
    flex: 1;
}

.product-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    color: var(--chat-text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-info .price {
    font-weight: 700;
    color: var(--chat-primary);
    font-size: 0.85rem;
}

/* ⌨️ Input Area */
#bt-ai-chatter-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 10px;
}

#bt-ai-chatter-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 25px;
    padding: 10px 15px;
    outline: none;
    font-size: 0.95rem;
    transition: border 0.2s;
}

#bt-ai-chatter-input:focus {
    border-color: var(--chat-primary);
}

#bt-ai-chatter-send {
    background: var(--chat-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#bt-ai-chatter-send:hover {
    background: var(--chat-accent);
}
