/* Bale Live Chat Widget Styles */
#blc-widget {
    position: fixed;
    /* موقعیت از طریق inline styles تنظیم می‌شود */
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    direction: rtl;
}

#blc-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--blc-primary-color, #0088cc);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#blc-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#blc-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#blc-chat-window {
    display: none;
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 360px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    overflow: hidden;
}

#blc-chat-window.blc-open {
    display: flex;
}

#blc-chat-header {
    background: var(--blc-primary-color, #0088cc);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#blc-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#blc-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
}

#blc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
}

.blc-message {
    margin-bottom: 12px;
    display: flex;
    animation: blcSlideIn 0.3s ease;
}

@keyframes blcSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blc-message.blc-user {
    justify-content: flex-end;
}

.blc-message.blc-admin {
    justify-content: flex-start;
}

.blc-message-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
}

.blc-message.blc-user .blc-message-bubble {
    background: var(--blc-primary-color, #0088cc);
    color: white;
    border-bottom-right-radius: 4px;
}

.blc-message.blc-admin .blc-message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ✅ نمایش نام ادمین (پشتیبانی سایت) */
.blc-admin-name {
    font-size: 11px;
    color: var(--blc-primary-color, #0088cc);
    margin-bottom: 4px;
    font-weight: 600;
}

.blc-welcome-message {
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 12px;
}

#blc-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 8px;
}

#blc-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

#blc-message-input:focus {
    border-color: var(--blc-primary-color, #0088cc);
}

#blc-send-btn {
    background: var(--blc-primary-color, #0088cc);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#blc-send-btn:hover {
    opacity: 0.9;
}

#blc-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#blc-messages::-webkit-scrollbar {
    width: 6px;
}

#blc-messages::-webkit-scrollbar-track {
    background: transparent;
}

#blc-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Mobile - موقعیت از inline styles می‌آید */
@media (max-width: 480px) {
    #blc-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        max-height: 600px;
    }
}