/**
 * استایل باکس چت شناور ریچارج 24
 * راست‌چین و ریسپانسیو
 */

/* استایل اصلی باکس چت */
.recharge24-chat-widget-container {
    position: fixed !important;
    z-index: 9998 !important;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', 'Segoe UI', sans-serif;
    pointer-events: none;
}

/* موقعیت‌های مختلف */
.recharge24-chat-widget-container[data-position="bottom-left"] {
    bottom: 30px !important;
    left: 20px !important;
}

.recharge24-chat-widget-container[data-position="bottom-right"] {
    bottom: 30px !important;
    right: 20px !important;
}

.recharge24-chat-widget-container .recharge24-chat-widget {
    animation: slideInFromLeft 0.6s ease-out;
    pointer-events: auto;
}

/* انیمیشن ورود از گوشه */
@keyframes slideInFromLeft {
    0% {
        transform: translateX(-150%) translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(150%) translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0) translateY(0);
        opacity: 1;
    }
}

/* انیمیشن تکان خوردن ربات */
@keyframes robotBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* استایل کانتینر اصلی */
.recharge24-chat-widget {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.recharge24-chat-widget:hover {
    transform: scale(1.05);
}

/* کانتینر چت */
.chat-container {
    display: flex;
    align-items: flex-end;
    gap: 2px; /* کاهش فاصله بین ربات و باکس چت */
    direction: ltr; /* تغییر به ltr برای ربات راست و متن چپ */
    flex-direction: row-reverse; /* معکوس کردن ترتیب */
}

/* باکس پیام */
.chat-bubble {
    background: linear-gradient(135deg, #F93D3D 0%, #FF9B21 100%);
    border-radius: 20px 20px 5px 20px;
    padding: 12px 18px;
    box-shadow: 0 4px 15px rgba(249, 61, 61, 0.3);
    max-width: 220px;
    position: relative;
    animation: bubblePulse 2s ease-in-out infinite;
    margin-bottom: 8px;
}

@keyframes bubblePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(249, 61, 61, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(249, 61, 61, 0.6);
    }
}

/* متن پیام */
.chat-message {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    text-align: right;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

/* دکمه کلیک کن */
.chat-message .click-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: 12px;
    margin-right: 5px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.chat-message .click-button:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

/* مکان‌نما تایپ */
.typing-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #ffffff;
    font-weight: bold;
    margin-right: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* تصویر ربات */
.chat-robot {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    animation: robotBounce 2s ease-in-out infinite;
}

.robot-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.recharge24-chat-widget:hover .robot-image {
    transform: rotate(5deg) scale(1.1);
}

/* ریسپانسیو برای موبایل */
@media (max-width: 768px) {
    .recharge24-chat-widget-container[data-position="bottom-left"] {
        bottom: 90px !important; /* فاصله از منوی پایینی */
        left: 10px !important;
    }
    
    .recharge24-chat-widget-container[data-position="bottom-right"] {
        bottom: 90px !important; /* فاصله از منوی پایینی */
        right: 10px !important;
    }
    
    .chat-bubble {
        max-width: 180px;
        padding: 10px 15px;
    }
    
    .chat-message {
        font-size: 12px;
    }
    
    .chat-robot {
        width: 50px;
        height: 50px;
    }
    
    .chat-container {
        gap: 8px;
    }
}

/* برای صفحات خیلی کوچک */
@media (max-width: 480px) {
    .chat-bubble {
        max-width: 150px;
        padding: 8px 12px;
    }
    
    .chat-message {
        font-size: 11px;
    }
    
    .chat-robot {
        width: 45px;
        height: 45px;
    }
}

/* استایل برای حالت minimized (اختیاری) */
.recharge24-chat-widget.minimized {
    transform: scale(0.8);
    opacity: 0.8;
}

.recharge24-chat-widget.minimized .chat-bubble {
    display: none;
}

/* انیمیشن برای نمایش */
.recharge24-chat-widget.show {
    animation: slideInFromLeft 0.6s ease-out;
}

