.rahkar_component_ai_support {
    --rahkar-component-ai_support-primary-color: #007bff;
    --rahkar-component-ai_support-primary-hover: #0056b3;
    --rahkar-component-ai_support-gradient: linear-gradient(45deg, #007bff, #0056b3);

    --rahkar-component-ai_support-bg: #ffffff;
    --rahkar-component-ai_support-bg-light: #f9f9f9;
    --rahkar-component-ai_support-header-bg: #f8f9fa;

    --rahkar-component-ai_support-border: #e9ecef;
    --rahkar-component-ai_support-input-border: #ddd;
    --rahkar-component-ai_support-input-border-focus: #007bff;

    --rahkar-component-ai_support-text: #191919;
    --rahkar-component-ai_support-text-dark: #000;
    --rahkar-component-ai_support-text-light: #fff;
    --rahkar-component-ai_support-muted: #888;

    --rahkar-component-ai_support-received-bg: #e9e9eb;
    --rahkar-component-ai_support-sent-bg: var(--rahkar-component-ai_support-primary-color);

    --rahkar-component-ai_support-shadow: rgba(0, 0, 0, 0.3);
    --rahkar-component-ai_support-shadow-light: rgba(0, 0, 0, 0.15);
    
    --rahkar-component-ai_support-success: #28a745;
    --rahkar-component-ai_support-warning: #ffc107;
    --rahkar-component-ai_support-danger: #dc3545;
    --rahkar-component-ai_support-info: #17a2b8;
}

/* 🎯 دکمه باز کردن چت */
.rahkar_component_ai_support #rahkar_component_ai_support_button {
    position: fixed;
    bottom: 10%;
    left: -130px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rahkar-component-ai_support-gradient);
    color: var(--rahkar-component-ai_support-text-light);
    padding: 1rem;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px var(--rahkar-component-ai_support-shadow);
    z-index: 9999;
    transition: all .3s;
    animation: rahkar_pulse 2s infinite;
    font-size:1rem;
}

.rahkar_component_ai_support #rahkar_component_ai_support_button svg {
    margin: 0 .5rem 0 1rem;
    width: 24px;
    height: 24px;
    color: var(--rahkar-component-ai_support-text-light);
    fill: var(--rahkar-component-ai_support-text-light);
}

.rahkar_component_ai_support #rahkar_component_ai_support_button:hover {
    transform: scale(1.1);
    animation-play-state: paused;
    left: 0;
}

/* ✨ افکت پالس */
@keyframes rahkar_pulse {
    0% {
        box-shadow: 0 0 0 0 var(--rahkar-component-ai_support-primary-color);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* 💬 کانتینر اصلی چت */
.rahkar_component_ai_support #rahkar_support_widget_container {
    position: fixed;
    bottom: 100px;
    left: 25px;
    width: 360px;
    background: var(--rahkar-component-ai_support-bg);
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--rahkar-component-ai_support-shadow-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    transform-origin: bottom left;
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* 🪄 انیمیشن باز و بسته شدن */
@keyframes rahkar_chatPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    60% {
        opacity: 1;
        transform: scale(1.05) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes rahkar_chatPopOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
}

.rahkar_component_ai_support #rahkar_support_widget_container.rahkar_show {
    animation: rahkar_chatPopIn 0.4s ease-out forwards;
    pointer-events: all;
}

.rahkar_component_ai_support #rahkar_support_widget_container.rahkar_hide {
    animation: rahkar_chatPopOut 0.4s ease-in forwards;
    pointer-events: none;
}

/* 🧠 هدر ویجت */
.rahkar_component_ai_support .rahkar_widget_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--rahkar-component-ai_support-header-bg);
    border-bottom: 1px solid var(--rahkar-component-ai_support-border);
}

.rahkar_component_ai_support .rahkar_widget_header h3 {
    margin: 0;
    font-size: 0.8rem;
    color: var(--rahkar-component-ai_support-text-dark);
}

.rahkar_component_ai_support #rahkar_close_widget_button {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--rahkar-component-ai_support-muted);
}

/* 💬 صفحه چت */
.rahkar_component_ai_support #rahkar_chat_screen {
    display: flex;
    flex-direction: column;
    height: 90%;
}

.rahkar_component_ai_support #rahkar_chat_messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: var(--rahkar-component-ai_support-bg-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 350px;
    min-height: 350px;
}

/* 💬 پیام‌ها */
.rahkar_component_ai_support .rahkar_message {
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 85%;
    line-height: 1.5;
    word-wrap: break-word;
}

.rahkar_component_ai_support .rahkar_message.rahkar_received {
    background: var(--rahkar-component-ai_support-received-bg);
    color: var(--rahkar-component-ai_support-text-dark);
    align-self: flex-end;
    border-radius: 20px 20px 20px 0;
    font-size: 0.8rem;
}

.rahkar_component_ai_support .rahkar_message.rahkar_sent {
    background: var(--rahkar-component-ai_support-sent-bg);
    color: var(--rahkar-component-ai_support-text-light);
    align-self: flex-start;
    border-radius: 20px 20px 0 20px;
    font-size: 0.8rem;
}

/* 🔄 انیمیشن لودینگ سه نقطه */
.rahkar_component_ai_support .rahkar_loading_dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
}

.rahkar_component_ai_support .rahkar_loading_dots span {
    width: 8px;
    height: 8px;
    background: var(--rahkar-component-ai_support-muted);
    border-radius: 50%;
    animation: rahkar_dotPulse 1.4s infinite ease-in-out;
}

.rahkar_component_ai_support .rahkar_loading_dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.rahkar_component_ai_support .rahkar_loading_dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes rahkar_dotPulse {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 📦 کارت‌های محصول */
.rahkar_component_ai_support .rahkar_product_card {
    background: var(--rahkar-component-ai_support-bg);
    border: 1px solid var(--rahkar-component-ai_support-border);
    border-radius: 12px;
    padding: 10px;
    margin: 5px 0;
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: var(--rahkar-component-ai_support-text-dark);
    transition: all 0.2s;
}

.rahkar_component_ai_support .rahkar_product_card:hover {
    box-shadow: 0 4px 12px var(--rahkar-component-ai_support-shadow-light);
    transform: translateY(-2px);
}

.rahkar_component_ai_support .rahkar_product_card img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.rahkar_component_ai_support .rahkar_product_info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rahkar_component_ai_support .rahkar_product_name {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--rahkar-component-ai_support-text-dark);
}

.rahkar_component_ai_support .rahkar_product_price {
    font-size: 0.7rem;
    color: var(--rahkar-component-ai_support-primary-color);
    font-weight: 600;
}

.rahkar_component_ai_support .rahkar_product_badge {
    display: inline-block;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 2px;
}

.rahkar_component_ai_support .rahkar_badge_sale {
    background: var(--rahkar-component-ai_support-danger);
    color: white;
}

.rahkar_component_ai_support .rahkar_badge_stock {
    background: var(--rahkar-component-ai_support-success);
    color: white;
}

.rahkar_component_ai_support .rahkar_badge_out {
    background: var(--rahkar-component-ai_support-muted);
    color: white;
}

/* 📋 کارت‌های سفارش */
.rahkar_component_ai_support .rahkar_order_card {
    background: var(--rahkar-component-ai_support-bg);
    border: 1px solid var(--rahkar-component-ai_support-border);
    border-radius: 12px;
    padding: 12px;
    margin: 5px 0;
}

.rahkar_component_ai_support .rahkar_order_header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.rahkar_component_ai_support .rahkar_order_id {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--rahkar-component-ai_support-text-dark);
}

.rahkar_component_ai_support .rahkar_order_status {
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.rahkar_component_ai_support .rahkar_status_completed {
    background: #d4edda;
    color: #155724;
}

.rahkar_component_ai_support .rahkar_status_processing {
    background: #fff3cd;
    color: #856404;
}

.rahkar_component_ai_support .rahkar_status_pending {
    background: #f8d7da;
    color: #721c24;
}

.rahkar_component_ai_support .rahkar_order_items {
    font-size: 0.7rem;
    color: var(--rahkar-component-ai_support-muted);
    margin: 5px 0;
}

.rahkar_component_ai_support .rahkar_order_total {
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--rahkar-component-ai_support-primary-color);
    margin-top: 5px;
}

/* 🛒 آیتم‌های سبد خرید */
.rahkar_component_ai_support .rahkar_cart_item {
    background: var(--rahkar-component-ai_support-bg);
    border: 1px solid var(--rahkar-component-ai_support-border);
    border-radius: 10px;
    padding: 10px;
    margin: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rahkar_component_ai_support .rahkar_cart_item_name {
    font-size: 0.75rem;
    font-weight: 600;
}

.rahkar_component_ai_support .rahkar_cart_item_qty {
    font-size: 0.7rem;
    color: var(--rahkar-component-ai_support-muted);
}

.rahkar_component_ai_support .rahkar_cart_item_price {
    font-size: 0.75rem;
    color: var(--rahkar-component-ai_support-primary-color);
    font-weight: bold;
}

.rahkar_component_ai_support .rahkar_cart_total {
    background: var(--rahkar-component-ai_support-primary-color);
    color: white;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
    font-size: 0.8rem;
}

/* 🔗 پیشنهادات و دکمه‌ها */
.rahkar_component_ai_support .rahkar_suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: end;
}

.rahkar_component_ai_support .rahkar_suggestion_btn {
    background: var(--rahkar-component-ai_support-bg);
    border: 1px solid var(--rahkar-component-ai_support-primary-color);
    color: var(--rahkar-component-ai_support-primary-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.rahkar_component_ai_support .rahkar_suggestion_btn:hover {
    background: var(--rahkar-component-ai_support-primary-color);
    color: white;
}

/* ✏️ نوار ورودی پیام */
.rahkar_component_ai_support #rahkar_chat_input_container {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid var(--rahkar-component-ai_support-border);
    background: var(--rahkar-component-ai_support-bg);
    align-items: center;
}

.rahkar_component_ai_support #rahkar_chat_input {
    flex-grow: 1;
    border: 1px solid var(--rahkar-component-ai_support-input-border);
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.8rem;
    outline: none;
}

.rahkar_component_ai_support #rahkar_chat_input:focus {
    border-color: var(--rahkar-component-ai_support-input-border-focus);
}

.rahkar_component_ai_support #rahkar_send_message_button {
    background: var(--rahkar-component-ai_support-primary-color);
    color: var(--rahkar-component-ai_support-text-light);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 10px;
    transition: background 0.2s ease;
}

.rahkar_component_ai_support #rahkar_send_message_button:hover {
    background: var(--rahkar-component-ai_support-primary-hover);
}

.rahkar_component_ai_support #rahkar_send_message_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 🎯 دکمه‌های آماده */
.rahkar_component_ai_support .default_chat_btn_box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 1rem 0 2rem;
}

.rahkar_component_ai_support .default_chat_btn_items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

.rahkar_prompt_btn {
    align-items: center;
    gap: .5rem;
    display: flex;
    background: #eee;
    font-size: .6rem !important;
    border: 1px solid transparent;
    color: var(--rahkar-component-ai_support-text);
    border-radius: 50px;
    padding: .5rem 1rem;
    margin: .25rem;
    cursor: pointer;
    transition: all .3s;
    text-decoration: none;
}

.rahkar_prompt_btn:hover {
    border-color: var(--rahkar-component-ai_support-text);
}

.rahkar_component_ai_support .default_chat_btn_items_whatsapp {
    width: 25px;
    height: 25px;
}

.rahkar_component_ai_support .default_chat_btn_items_instagram,
.rahkar_component_ai_support .default_chat_btn_items_telegram {
    width: 20px;
    height: 20px;
}

.rahkar_component_ai_support .default_chat_btn_items_telegram {
    border-radius: 20px;
}

/* 📱 واکنش‌گرا */
@media (max-width: 600px) {
    .rahkar_component_ai_support #rahkar_support_widget_container {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        border-radius: 0;
    }

    .rahkar_component_ai_support #rahkar_chat_messages {
        max-height: none;
    }
}