    /* استایل اصلی چت بات */
    .chatbot-container {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 350px;
        height: 480px;
        border: none;
        border-radius: 16px;
        background-color: white;
        box-shadow: 0 5px 30px rgba(0,0,0,0.15);
        z-index: 1000;
        overflow: hidden;
        font-family: Tahoma, Arial, sans-serif;
        direction: rtl;
        transition: all 0.3s ease;
    }

    .chat-button {
        /* حذف position: fixed برای غیرشناور کردن دکمه */
        background-color: #4361ee;
        color: white;
        padding: 14px 24px;
        border: none;
        border-radius: 50px;
        cursor: pointer;
        font-size: 15px;
        font-weight: bold;
        box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
        transition: all 0.3s ease;
        display: inline-block; /* تغییر به inline-block برای قرارگیری در جریان صفحه */
        margin: 5px; /* افزودن مارجین برای فاصله مناسب */
    }

    .chat-button:hover {
        background-color: #3a56d4;
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(67, 97, 238, 0.5);
    }

    .chat-header {
        background: linear-gradient(135deg, #4361ee, #3f37c9);
        color: white;
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    .header-left, .header-right {
        display: flex;
        align-items: center;
    }

    .bot-name {
        font-weight: bold;
        font-size: 15px;
    }

    .close-chat {
        background: none;
        border: none;
        color: white;
        font-size: 18px;
        cursor: pointer;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 8px;
        border-radius: 50%;
        transition: background-color 0.2s;
    }

    .close-chat:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    .chat-messages {
        height: 355px;
        overflow-y: auto;
        padding: 16px;
        background-color: #f8f9fa;
    }

    .message {
        margin-bottom: 15px;
        padding: 12px 16px;
        border-radius: 18px;
        max-width: 85%;
        position: relative;
        animation: fadeIn 0.3s ease;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        line-height: 1.5;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .user-message {
        background-color: #4361ee;
        color: white;
        margin-left: auto;
        border-bottom-right-radius: 4px;
    }

    .bot-message {
        background-color: white;
        margin-right: auto;
        border-bottom-left-radius: 4px;
    }

    /* کلاس برای متن در حال تایپ */
    .typing-text {
        visibility: hidden;
        margin-bottom: 15px;
    }

    .typing-indicator {
        padding: 12px 16px;
        background-color: white;
        border-radius: 18px;
        border-bottom-left-radius: 4px;
        margin-bottom: 15px;
        width: fit-content;
        display: flex;
        align-items: center;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }

    .typing-indicator .dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #bbb;
        margin-right: 4px;
        animation: typing 1.4s infinite ease-in-out;
    }

    .typing-indicator .dot:nth-child(1) { animation-delay: 0s; }
    .typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
    .typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

    @keyframes typing {
        0%, 60%, 100% { transform: translateY(0); }
        30% { transform: translateY(-5px); }
    }

    .chat-input {
        display: flex;
        padding: 15px;
        position: absolute;
        bottom: 30px; /* تنظیم فاصله 30 پیکسل از پایین باکس */
        left: 0;
        right: 0;
        border-top: 1px solid #eee;
        background-color: white;
    }

    .chat-input input {
        flex: 1;
        padding: 12px 16px;
        border: 1px solid #e0e0e0;
        border-radius: 50px;
        transition: all 0.3s;
        font-size: 14px;
    }

    .chat-input input:focus {
        outline: none;
        border-color: #4361ee;
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    }

    .chat-input button {
        background: none;
        border: none;
        color: #4361ee;
        padding: 8px;
        margin-right: 8px;
        border-radius: 50%;
        cursor: pointer;
        transition: all 0.2s;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chat-input button:hover {
        background-color: rgba(67, 97, 238, 0.1);
    }

    .send-message {
        background-color: #4361ee !important;
        color: white !important;
    }

    .send-message:hover {
        background-color: #3a56d4 !important;
        transform: scale(1.05);
    }

    .session-cost {
        background-color: rgba(255, 255, 255, 0.2);
        padding: 4px 10px;
        border-radius: 50px;
        font-size: 12px;
        margin-left: 10px;
    }

    /* استایل اسکرول بار */
    .chat-messages::-webkit-scrollbar {
        width: 6px;
    }

    .chat-messages::-webkit-scrollbar-track {
        background: #f1f1f1;
    }

    .chat-messages::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 10px;
    }

    .chat-messages::-webkit-scrollbar-thumb:hover {
        background: #ccc;
    }

    /* افزودن تایم استمپ به پیام‌ها */
    .message::after {
        content: attr(data-time);
        position: absolute;
        font-size: 10px;
        bottom: -16px;
        opacity: 0.7;
    }

    .user-message::after {
        left: 5px;
        color: #666;
    }

    .bot-message::after {
        right: 5px;
        color: #666;
    }