/* Floating Button */
.b2b-chat-container-4cf9af2f {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body.admin-bar .b2b-chat-container-4cf9af2f {
    bottom: calc(24px + var(--wp-admin--admin-bar--height, 32px));
}

.b2b-chat-trigger-4cf9af2f {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border: none;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.b2b-chat-trigger-4cf9af2f:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.chat-icon-4cf9af2f {
    font-size: 28px;
    color: #fff;
}

.chat-badge-4cf9af2f {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid #fff;
}

/* Chat Panel */
.b2b-chat-panel-4cf9af2f {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 550px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    direction: rtl; /* For Arabic user experience */
}

@media screen and (max-width: 480px) {
    .b2b-chat-panel-4cf9af2f {
        width: 320px;
        height: 480px;
    }
}

/* Header */
.b2b-chat-header-4cf9af2f {
    background-color: #1e3a8a;
    color: #ffffff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.factory-info-4cf9af2f {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-container-4cf9af2f {
    position: relative;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.status-dot-4cf9af2f {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid #1e3a8a;
}

.factory-info-4cf9af2f h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: right;
}

.factory-meta-4cf9af2f {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #93c5fd;
    text-align: right;
}

.close-chat-4cf9af2f {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

/* Translation Banner */
.translation-status-banner-4cf9af2f {
    background-color: #eff6ff;
    color: #1e40af;
    padding: 8px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #dbeafe;
}

/* Messages Area */
.b2b-chat-messages-4cf9af2f {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-4cf9af2f {
    display: flex;
    margin-bottom: 4px;
    max-width: 80%;
}

.message-4cf9af2f.sent {
    align-self: flex-start; /* sent by local user (Arabic) */
}

.message-4cf9af2f.received {
    align-self: flex-end; /* received from factory */
}

.message-content-4cf9af2f {
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-4cf9af2f.sent .message-content-4cf9af2f {
    background-color: #1e3a8a;
    color: #ffffff;
    border-top-left-radius: 0;
}

.message-4cf9af2f.received .message-content-4cf9af2f {
    background-color: #e5e7eb;
    color: #1f2937;
    border-top-right-radius: 0;
}

.original-text-4cf9af2f {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.4;
}

.translated-text-4cf9af2f {
    margin: 6px 0 0 0;
    font-size: 12px;
    color: #d1d5db;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 4px;
    font-style: italic;
}

.message-4cf9af2f.received .translated-text-4cf9af2f {
    color: #4b5563;
    border-top: 1px solid #d1d5db;
}

.translation-tag-4cf9af2f {
    font-weight: bold;
    color: #3b82f6;
    margin-left: 4px;
}

.message-time-4cf9af2f {
    display: block;
    font-size: 9px;
    margin-top: 4px;
    opacity: 0.7;
    text-align: left;
}

/* Quick Actions / RFQ Templates */
.rfq-quick-actions-4cf9af2f {
    padding: 8px 12px;
    background-color: #ffffff;
    border-top: 1px solid #f3f4f6;
}

.quick-title-4cf9af2f {
    margin: 0 0 6px 0;
    font-size: 11px;
    color: #6b7280;
    font-weight: bold;
}

.rfq-tags-4cf9af2f {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.rfq-template-btn-4cf9af2f {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.rfq-template-btn-4cf9af2f:hover {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

/* Footer / Input */
.b2b-chat-footer-4cf9af2f {
    padding: 12px;
    background-color: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.input-container-4cf9af2f {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f3f4f6;
    border-radius: 24px;
    padding: 4px 12px;
}

.chat-input-field-4cf9af2f {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    resize: none;
    padding: 8px 0;
    font-size: 13.5px;
    color: #1f2937;
    max-height: 80px;
}

.send-message-btn-4cf9af2f {
    background: #1e3a8a;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.send-message-btn-4cf9af2f:hover {
    background: #3b82f6;
}

.send-icon-4cf9af2f {
    width: 16px;
    height: 16px;
    fill: #ffffff;
    transform: scaleX(-1); /* Correct direct send arrow for RTL */
}

.translation-toggle-container-4cf9af2f {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #4b5563;
}

/* Switch Styles */
.switch-4cf9af2f {
    position: relative;
    display: inline-block;
    width: 28px;
    height: 16px;
}

.switch-4cf9af2f input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-4cf9af2f {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider-4cf9af2f:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider-4cf9af2f {
    background-color: #1e3a8a;
}

input:checked + .slider-4cf9af2f:before {
    transform: translateX(12px);
}

.slider-4cf9af2f.round {
    border-radius: 16px;
}

.slider-4cf9af2f.round:before {
    border-radius: 50%;
}
