/**
 * PWS Chat AI - RTL overrides for Arabic.
 *
 * Loaded only when Polylang language is 'ar'.
 * Depends on pws-chat-ai-widget stylesheet.
 *
 * NOTE: Do NOT set direction:rtl on .pws-chat-widget itself.
 * It is position:fixed and RTL direction breaks its placement.
 */

.pws-chat-panel {
    direction: rtl;
}

.pws-chat-header {
    flex-direction: row-reverse;
}

.pws-chat-header-info {
    flex-direction: row;
    text-align: right;
}

.pws-chat-close {
    order: -1;
}

.pws-message-user {
    align-self: flex-end;
}

.pws-message-bot {
    align-self: flex-start;
}

.pws-message-bot .pws-chat-ai-header,
.pws-message-bot .pws-chat-ai-text {
    margin-left: auto;
    margin-right: 0;
}

.pws-message-user .pws-message-content {
    border-bottom-right-radius: 14px;
    border-bottom-left-radius: 4px;
}

.pws-message-bot .pws-message-content {
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}

.pws-message-content {
    text-align: right;
}

.pws-chat-form {
    flex-direction: row;
    direction: rtl;
}

.pws-chat-input {
    text-align: right;
    direction: rtl;
}

.pws-chat-send svg {
    transform: scaleX(-1);
    transform-origin: center;
}

.pws-chat-footer-helper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    color: var(--pws-text-secondary);
    text-align: center;
    line-height: 1.4;
    padding: 6px 16px 10px;
    border-top: 1px solid var(--pws-border);
    background: var(--pws-bg-light);
    flex-shrink: 0;
    direction: rtl;
}

.pws-chat-footer-helper a,
.pws-chat-footer-helper a:hover,
.pws-chat-footer-helper a:focus,
.pws-chat-footer-helper a:visited {
    text-decoration: underline !important;
    text-underline-offset: 2px;
    font-weight: 500;
    color: inherit;
}

.pws-chat-footer,
.pws-chat-footer-helper {
    direction: rtl;
}
