
.ai-chat-panel {
    position: fixed;
    bottom: 80px;
    right: 16px;
    width: 340px;
    height: 480px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.ai-chat-panel.open { display: flex; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ai-chat-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}
.ai-chat-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: #f8f9fa;
}
.ai-chat-messages::-webkit-scrollbar { width: 4px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.ai-msg {
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
}
.ai-msg.bot { align-items: flex-start; }
.ai-msg.user { flex-direction: row-reverse; }

.ai-msg .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.ai-msg.bot .avatar { background: #667eea; color: #fff; }
.ai-msg.user .avatar { background: #ff6b6b; color: #fff; }

.ai-msg .bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}
.ai-msg.bot .bubble {
    background: #fff;
    border: 1px solid #e9ecef;
    border-top-left-radius: 4px;
    color: #333;
}
.ai-msg.user .bubble {
    background: #667eea;
    color: #fff;
    border-top-right-radius: 4px;
}
.ai-msg .bubble .typing {
    display: inline-flex;
    gap: 3px;
}
.ai-msg .bubble .typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: typing 1s infinite;
}
.ai-msg .bubble .typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-msg .bubble .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

.ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.ai-chat-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.ai-chat-input input:focus { border-color: #667eea; }
.ai-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.ai-chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-chat-input button:active:not(:disabled) { transform: scale(0.95); }

.ai-chat-welcome {
    text-align: center;
    padding: 40px 20px 20px;
    color: #999;
}
.ai-chat-welcome .icon { font-size: 48px; margin-bottom: 12px; }
.ai-chat-welcome p { font-size: 13px; margin: 4px 0; line-height: 1.6; }

.ai-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 0 16px 12px;
}
.ai-chat-suggestions button {
    background: #f0f0ff;
    border: 1px solid #e0e0ff;
    border-radius: 14px;
    padding: 6px 12px;
    font-size: 12px;
    color: #667eea;
    cursor: pointer;
    transition: background 0.2s;
}
.ai-chat-suggestions button:hover { background: #e0e0ff; }
