.hcp-chat-wrapper {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
    font-family: Arial, sans-serif;
}

/* موقعیت بر اساس جهت */
.hcp-chat-wrapper.rtl {
    right: 20px;
    direction: rtl;
    text-align: right;
}

.hcp-chat-wrapper.ltr {
    left: 20px;
    direction: ltr;
    text-align: left;
}

/* ===== دکمه باز کردن ===== */
.hcp-open-chat {
    width: 65px;
    height: 65px;
    border-radius: 50% !important;
    overflow: hidden;
    border: none;
    background: var(--hcp-color, #f35260);
    padding: 0;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    margin-bottom: 10px;
}

.hcp-open-chat:hover {
    transform: scale(1.05);
}

.hcp-open-chat img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* ===== جعبه چت ===== */
.hcp-chat {
    display: none;
    /* مخفی پیش‌فرض */
    width: 350px;
    max-width: calc(100% - 30px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, .18);
    overflow: hidden;
    animation: hcpShow .3s ease;
}

/* انیمیشن نمایش */
@keyframes hcpShow {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== هدر ===== */
.hcp-header {
    background: var(--hcp-color, #f35260);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hcp-header span {
    font-weight: bold;
    font-size: 16px;
}

#hcp-close-chat {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .25);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
}

/* ===== پیام‌ها ===== */
.hcp-messages {
    height: 320px;
    overflow-y: auto;
    padding: 15px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.hcp-bot,
.hcp-user {
    max-width: 80%;
    padding: 12px;
    border-radius: 15px;
    margin-bottom: 10px;
    word-wrap: break-word;
}

.hcp-bot {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 15px 15px 15px 3px;
    align-self: flex-start;
}

.hcp-user {
    background: var(--hcp-color, #f35260);
    color: white;
    border-radius: 15px 15px 3px 15px;
    align-self: flex-end;
}

/* حالت تایپ */
.hcp-typing {
    opacity: 0.7;
    font-style: italic;
}

/* ===== ورودی ===== */
.hcp-input {
    display: flex;
    padding: 12px;
    background: #fff;
    border-top: 1px solid #eee;
}

.hcp-input input {
    flex: 1;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
}

.hcp-input input:focus {
    border-color: var(--hcp-color, #f35260);
}

.hcp-input button {
    margin-right: 8px;
    background: var(--hcp-color, #f35260);
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
}

.hcp-input button:hover {
    opacity: 0.9;
}

/* تنظیمات جهت برای ltr (برعکس) */
.hcp-chat-wrapper.ltr .hcp-input button {
    margin-right: 0;
    margin-left: 8px;
}

.hcp-chat-wrapper.ltr .hcp-user {
    border-radius: 15px 15px 15px 3px;
}

.hcp-chat-wrapper.ltr .hcp-bot {
    border-radius: 15px 15px 3px 15px;
}

/* ===== ریسپانسیو ===== */
@media(max-width:600px) {
    .hcp-chat-wrapper.rtl {
        right: 10px;
    }

    .hcp-chat-wrapper.ltr {
        left: 10px;
    }

    .hcp-chat {
        width: calc(100% - 20px);
        max-width: 100%;
    }

    .hcp-open-chat {
        width: 60px;
        height: 60px;
    }
}