/* * فایل استایل Smart WP Chat (نسخه ایزوله شده)
 * این نسخه جلوی تاثیرگذاری قالب سایت روی چت‌بات را می‌گیرد.
 */

/* ریست کردن کلی برای جلوگیری از ارث‌بری فونت و سایز */
#smart-wp-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999 !important; /* اولویت خیلی بالا */
    font-family: 'Vazirmatn', sans-serif !important;
    width: 60px;
    height: 60px;
    direction: rtl;
    line-height: normal;
}

#smart-wp-chat-container * {
    box-sizing: border-box;
}

/* --- پنجره چت --- */
#smart-wp-chat-container .swc-chat-window {
    width: 380px;
    height: 600px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    position: absolute;
    bottom: 0;
    right: 0;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    pointer-events: none;
    margin: 0 !important; /* حذف مارجین قالب */
}

#smart-wp-chat-container .swc-chat-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* --- هدر --- */
#smart-wp-chat-container .swc-header {
    background-color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    height: auto !important;
}

#smart-wp-chat-container .swc-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#smart-wp-chat-container .swc-bot-icon-header {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent !important;
    padding: 0 !important;
}

#smart-wp-chat-container .swc-bot-icon-header img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

#smart-wp-chat-container .swc-status-dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border: 2px solid #fff;
    border-radius: 50%;
    position: absolute;
    bottom: -2px;
    left: -2px;
    z-index: 2;
}

#smart-wp-chat-container .swc-header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#smart-wp-chat-container .swc-header-title {
    font-weight: 800 !important;
    font-size: 16px !important;
    color: #1f2937 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

#smart-wp-chat-container .swc-header-subtitle {
    font-size: 12px !important;
    color: #6b7280 !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

/* ریست کردن دکمه‌های هدر (برای جلوگیری از استایل قالب) */
#smart-wp-chat-container .swc-control-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    color: #9ca3af !important;
    padding: 4px !important;
    transition: color 0.2s;
    font-size: 16px !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    margin: 0 !important;
}

#smart-wp-chat-container .swc-control-btn:hover {
    color: #4b5563 !important;
    background: transparent !important;
}

/* --- بدنه پیام‌ها --- */
#smart-wp-chat-container .swc-messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scrollbar-width: thin;
}

#smart-wp-chat-container .swc-date-divider {
    text-align: center;
    margin: 10px 0;
}

#smart-wp-chat-container .swc-date-pill {
    background-color: rgba(0,0,0,0.05);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    color: #6b7280;
    display: inline-block;
}

#smart-wp-chat-container .swc-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    width: 100%;
    margin: 0 !important;
}

#smart-wp-chat-container .swc-msg-row.bot {
    flex-direction: row;
}

#smart-wp-chat-container .swc-msg-row.user {
    flex-direction: row-reverse;
}

#smart-wp-chat-container .swc-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    background-color: #fff;
    margin: 0 !important;
    padding: 0 !important;
}

#smart-wp-chat-container .swc-msg-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    margin: 0 !important;
}

#smart-wp-chat-container .swc-msg-content {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}

#smart-wp-chat-container .swc-msg-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
    display: block;
}

#smart-wp-chat-container .swc-msg-row.user .swc-msg-label {
    align-self: flex-end;
}

#smart-wp-chat-container .swc-bubble {
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.6;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

#smart-wp-chat-container .swc-msg-row.bot .swc-bubble {
    background-color: #ffffff;
    color: #374151;
    border-top-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    border: 1px solid #e5e7eb;
    text-align: right;
}

#smart-wp-chat-container .swc-msg-row.user .swc-bubble {
    background-color: #ea1d2c;
    color: white;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 10px rgba(234, 29, 44, 0.2);
    text-align: right;
}

/* --- چیپ‌ها --- */
#smart-wp-chat-container .swc-suggestions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 20px 10px 20px;
    background-color: #f8f9fa;
    scrollbar-width: none;
}

#smart-wp-chat-container .swc-suggestions::-webkit-scrollbar {
    display: none;
}

/* ریست کردن دکمه چیپ */
#smart-wp-chat-container .swc-chip {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    color: #4b5563 !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none !important;
    margin: 0 !important;
    line-height: normal !important;
}

#smart-wp-chat-container .swc-chip:hover {
    border-color: #ea1d2c !important;
    color: #ea1d2c !important;
    background-color: #fff1f2 !important;
}

/* --- فوتر و ورودی --- */
#smart-wp-chat-container .swc-footer {
    background-color: #ffffff;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
}

#smart-wp-chat-container .swc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* ریست کامل ورودی متن */
#smart-wp-chat-container textarea.swc-input-new {
    width: 100% !important;
    background-color: #f3f4f6 !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    padding: 14px 14px 14px 50px !important;
    font-family: 'Vazirmatn', sans-serif !important;
    font-size: 14px !important;
    color: #333 !important;
    outline: none !important;
    transition: border 0.2s;
    resize: none !important;
    height: 52px !important;
    min-height: 52px !important;
    line-height: 1.5 !important;
    overflow-y: hidden;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
}

#smart-wp-chat-container textarea.swc-input-new:focus {
    border-color: #e5e7eb !important;
    background-color: #fff !important;
}

/* ریست دکمه ارسال */
#smart-wp-chat-container .swc-send-btn-new {
    position: absolute;
    left: 8px;
    top: 50% !important;
    transform: translateY(-50%);
    width: 36px !important;
    height: 36px !important;
    background-color: #ea1d2c !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    padding: 0 !important;
    margin: 0 !important;
    min-width: unset !important;
    box-shadow: none !important;
}

#smart-wp-chat-container .swc-send-btn-new:hover {
    transform: translateY(-50%) scale(1.05);
    background-color: #d01926 !important;
}

#smart-wp-chat-container .swc-footer-text {
    text-align: center;
    font-size: 10px;
    color: #9ca3af;
    margin-top: 8px;
    display: block;
}

/* --- دکمه شناور --- */
#smart-wp-chat-container .swc-launcher-btn {
    width: 60px !important;
    height: 60px !important;
    background-color: #ea1d2c !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 15px rgba(234, 29, 44, 0.4) !important;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none !important;
    outline: none !important;
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
    padding: 0 !important;
    margin: 0 !important;
}

#smart-wp-chat-container .swc-launcher-btn.hidden {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

#smart-wp-chat-container .swc-launcher-icon {
    width: 30px;
    height: 30px;
    fill: white;
}

/* --- تولتیپ --- */
#smart-wp-chat-container .swc-tooltip {
    position: absolute;
    bottom: 10px;
    right: 70px;
    background-color: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s;
    pointer-events: none;
    line-height: normal;
}

#smart-wp-chat-container .swc-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px 0 6px 6px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

#smart-wp-chat-container .swc-launcher-btn.hidden + .swc-tooltip,
#smart-wp-chat-container .swc-tooltip.hide {
    opacity: 0;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    #smart-wp-chat-container .swc-chat-window {
        width: calc(100vw - 40px);
        bottom: 0;
        right: 0;
        height: 70vh;
    }
}