/* استایل‌های اصلی چت‌بات */
.ai-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.ai-chatbot-widget.ai-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-chatbot-widget.ai-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* دکمه باز کردن چت */
.ai-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ai-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.ai-chatbot-toggle svg {
    transition: all 0.3s ease;
}

.ai-chatbot-close-icon {
    position: absolute;
    font-size: 28px;
    font-weight: 300;
    opacity: 0;
    transform: rotate(90deg);
    transition: all 0.3s ease;
}

.ai-chatbot-widget.ai-chatbot-open .ai-chatbot-toggle svg {
    opacity: 0;
    transform: rotate(-90deg);
}

.ai-chatbot-widget.ai-chatbot-open .ai-chatbot-close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* پنل چت */
.ai-chatbot-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.ai-chatbot-widget.ai-chatbot-open .ai-chatbot-panel {
    display: flex;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* هدر چت */
.ai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-chatbot-minimize {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ai-chatbot-minimize:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* منطقه پیام‌ها */
.ai-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

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

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

.ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* پیام‌ها */
.ai-chatbot-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-end;
    animation: messageSlide 0.3s ease;
}

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

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

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

.ai-chatbot-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-message .ai-chatbot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.bot-message .ai-chatbot-message-content {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 6px;
}

/* کارت‌های محصول */
.ai-chatbot-products {
    margin-top: 12px;
}

.ai-chatbot-product-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.ai-chatbot-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ai-chatbot-product-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.ai-chatbot-product-price {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.ai-chatbot-product-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.ai-chatbot-product-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* منطقه ورودی */
.ai-chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chatbot-input-area input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.ai-chatbot-input-area input:focus {
    border-color: #667eea;
}

.ai-chatbot-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chatbot-input-area button:hover {
    transform: scale(1.05);
}

.ai-chatbot-input-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* انیمیشن تایپ */
.ai-chatbot-typing {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: typing 1.4s infinite;
}

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

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

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

/* طراحی واکنش‌گرا */
@media (max-width: 480px) {
    .ai-chatbot-panel {
        width: 90vw;
        height: 70vh;
        right: 50%;
        transform: translateX(50%);
        max-width: 350px;
    }
    
    .ai-chatbot-widget.ai-chatbot-bottom-right {
        right: 50%;
        transform: translateX(50%);
    }
    
    .ai-chatbot-widget.ai-chatbot-bottom-left {
        left: 50%;
        transform: translateX(-50%);
    }
}

/* تم تیره */
.ai-chatbot-theme-dark .ai-chatbot-panel {
    background: #2d3748;
    border-color: #4a5568;
}

.ai-chatbot-theme-dark .ai-chatbot-messages {
    background: #1a202c;
}

.ai-chatbot-theme-dark .bot-message .ai-chatbot-message-content {
    background: #4a5568;
    color: #e2e8f0;
    border-color: #718096;
}

.ai-chatbot-theme-dark .ai-chatbot-input-area {
    background: #2d3748;
    border-color: #4a5568;
}

.ai-chatbot-theme-dark .ai-chatbot-input-area input {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
}

.ai-chatbot-theme-dark .ai-chatbot-typing {
    background: #2d3748;
    border-color: #4a5568;
}