/* ==========================================================================
   WC Simple Support Chat - Frontend Styles (Clean, Lightweight & RTL Native)
   ========================================================================== */

.wc-simple-chat-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
}

.wc-simple-chat-container * {
    box-sizing: border-box;
}

/* هدر چت */
.wc-simple-chat-header {
    background: #0f172a;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wc-chat-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.wc-chat-header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
}

.wc-chat-btn-refresh {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wc-chat-btn-refresh:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(45deg);
}

/* تاریخچه پیام‌ها */
.wc-simple-chat-messages {
    padding: 20px;
    background: #f8fafc;
    overflow-y: auto;
    min-height: 400px;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.wc-chat-empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #64748b;
    margin: auto 0;
}

.wc-chat-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.wc-chat-bubble-wrap {
    display: flex;
    width: 100%;
}

.wc-chat-bubble-wrap.message-user {
    justify-content: flex-start; /* در RTL سمت راست قرار می‌گیرد */
}

.wc-chat-bubble-wrap.message-admin {
    justify-content: flex-end; /* در RTL سمت چپ قرار می‌گیرد */
}

.wc-chat-bubble {
    max-width: 78%;
    padding: 12px 16px;
    font-size: 14.5px;
    line-height: 1.6;
    position: relative;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* حباب پیام کاربر */
.message-user .wc-chat-bubble {
    background-color: #2563eb;
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
}

.message-user .wc-chat-bubble-sender {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
}

.message-user .wc-chat-bubble-time {
    display: block;
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 6px;
    text-align: left;
}

/* حباب پیام ادمین */
.message-admin .wc-chat-bubble {
    background-color: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 16px 16px 16px 4px;
}

.message-admin .wc-chat-bubble-sender {
    font-size: 11px;
    font-weight: 700;
    color: #059669;
    margin-bottom: 4px;
}

.message-admin .wc-chat-bubble-time {
    display: block;
    font-size: 10.5px;
    color: #94a3b8;
    margin-top: 6px;
    text-align: left;
}

/* پیوست تصویر در حباب */
.wc-chat-bubble-attachment {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    max-width: 280px;
}

.wc-chat-bubble-attachment img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wc-chat-bubble-attachment img:hover {
    transform: scale(1.02);
}

/* نوار پیش‌نمایش تصویر قبل ارسال */
.wc-chat-file-preview {
    padding: 8px 18px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: #334155;
}

.wc-chat-file-preview .preview-filename {
    font-weight: 600;
    direction: ltr;
}

.wc-chat-file-preview .preview-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #ef4444;
    line-height: 1;
    margin-right: auto;
}

/* فرم ارسال */
.wc-simple-chat-form {
    padding: 14px 18px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.wc-chat-input-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wc-chat-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.wc-chat-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.wc-chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wc-chat-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-chat-upload-label:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.wc-chat-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background-color: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wc-chat-submit-btn:hover {
    background-color: #059669;
}

.wc-chat-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-chat-login-notice {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 10px;
    color: #991b1b;
    text-align: center;
    font-size: 14px;
}
