/**
 * KafiChat Pro - My Account (Support Tab)
 * Optimized & Responsive for Front-end
 */

/* ═══════════════════════════════════════════════════════
   فونت عمومی و استایل پایه
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap,
.kafichat-myaccount-wrap * {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    box-sizing: border-box;
}

.kafichat-myaccount-wrap {
    direction: rtl;
    color: #2d3748;
    line-height: 1.6;
}

/* عناوین و وضعیت خالی */
.kafichat-myaccount-wrap .kafichat-myaccount-title {
    display: flex; align-items: center; gap: 12px;
    font-size: 20px; font-weight: 700; color: #2d3748;
    margin: 0 0 20px 0; padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0; flex-wrap: wrap;
}
.kafichat-myaccount-wrap .kafichat-title-icon { font-size: 26px; }

.kafichat-myaccount-wrap .kafichat-myaccount-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 60px 20px; text-align: center; color: #718096;
    background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: kafichatFadeInUp 0.5s ease;
}
.kafichat-myaccount-wrap .kafichat-empty-icon {
    font-size: 56px; margin-bottom: 16px; opacity: 0.5; animation: kafichatFloat 3s ease-in-out infinite;
}
.kafichat-myaccount-wrap .kafichat-myaccount-empty h3 { font-size: 16px; font-weight: 700; color: #4a5568; margin: 0 0 8px 0; }
.kafichat-myaccount-wrap .kafichat-myaccount-empty p { font-size: 13px; color: #a0aec0; margin: 0; }

/* دکمه‌های پایه (بازگشت، صفحه‌بندی، رفرش) */
.kafichat-myaccount-wrap .kafichat-btn-back,
.kafichat-myaccount-wrap .kafichat-page-btn,
.kafichat-myaccount-wrap .kafichat-ma-btn-refresh {
    display: inline-flex;padding: 10px; align-items: center; justify-content: center;
    gap: 6px; background: white; color: #4a5568;
    border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: all 0.2s ease; text-decoration: none !important;
}
.kafichat-myaccount-wrap .kafichat-btn-back { padding: 8px 16px; background: #f7fafc; }
.kafichat-myaccount-wrap .kafichat-btn-back:hover,
.kafichat-myaccount-wrap .kafichat-page-btn:hover,
.kafichat-myaccount-wrap .kafichat-ma-btn-refresh:hover {
    background: #f0fdf4; border-color: #00B894; color: #00B894 !important;
    transform: translateX(-4px); box-shadow: 0 2px 8px rgba(0, 184, 148, 0.15);
}
.kafichat-myaccount-wrap .kafichat-btn-back .btn-icon { font-size: 16px; transition: transform 0.2s; }
.kafichat-myaccount-wrap .kafichat-btn-back:hover .btn-icon { transform: translateX(-4px); }

/* ═══════════════════════════════════════════════════════
   پنل لیست و آیتم‌های مکالمه
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap .kafichat-conv-list-panel,
.kafichat-myaccount-wrap .kafichat-conv-detail-panel {
    background: white; border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); overflow: hidden;
}
.kafichat-myaccount-wrap .kafichat-conv-detail-panel { margin-top: 20px; }
.kafichat-myaccount-wrap .kafichat-conv-detail-container { display: flex; flex-direction: column; background: white; border-radius: 12px; overflow: hidden; }

.kafichat-myaccount-wrap .kafichat-conv-list-header {
    padding: 14px 18px; background: #f7fafc; border-bottom: 1px solid #e2e8f0;
    font-weight: 600; color: #4a5568; font-size: 13px;
}
.kafichat-myaccount-wrap .kafichat-conv-count { color: #00B894; font-weight: 700; }

.kafichat-myaccount-wrap .kafichat-conv-item {
    position: relative; display: block; padding: 14px 16px; border-radius: 8px;
    cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); margin-bottom: 4px;
    border: 2px solid transparent; border-right: 3px solid transparent; text-decoration: none !important; color: inherit !important;
}
.kafichat-myaccount-wrap .kafichat-conv-item:hover {
    background: linear-gradient(90deg, #f0fff4 0%, #ffffff 100%);
    border-right-color: #00B894; transform: translateX(-4px); box-shadow: 0 4px 12px rgba(0, 184, 148, 0.15);
}
.kafichat-myaccount-wrap .kafichat-conv-item:active { border-right-color: #00B894 !important; }

.kafichat-myaccount-wrap .kafichat-conv-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.kafichat-myaccount-wrap .kafichat-conv-item-name { font-weight: 700; color: #2d3748; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.kafichat-myaccount-wrap .kafichat-conv-item-time { font-size: 11px; color: #a0aec0; direction: ltr; font-family: 'Courier New', monospace !important; }
.kafichat-myaccount-wrap .kafichat-conv-item-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: #718096; flex-wrap: wrap; }

/* Badge ها */
.kafichat-myaccount-wrap .kafichat-conv-platform-badge,
.kafichat-myaccount-wrap .kafichat-conv-status-badge,
.kafichat-myaccount-wrap .kafichat-conv-rating {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; transition: all 0.2s ease;
}
.kafichat-myaccount-wrap .kafichat-conv-platform-badge:hover,
.kafichat-myaccount-wrap .kafichat-conv-status-badge:hover,
.kafichat-myaccount-wrap .kafichat-conv-rating:hover { transform: scale(1.05); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }

.kafichat-myaccount-wrap .kafichat-conv-platform-bale { background: #e0f2fe; color: #0284c7; }
.kafichat-myaccount-wrap .kafichat-conv-platform-telegram { background: #e0e7ff; color: #4f46e5; }
.kafichat-myaccount-wrap .kafichat-conv-platform-website { background: #fef3c7; color: #d97706; }
.kafichat-myaccount-wrap .kafichat-conv-status-open { background: #d1fae5; color: #065f46; }
.kafichat-myaccount-wrap .kafichat-conv-status-closed { background: #f3f4f6; color: #6b7280; }
.kafichat-myaccount-wrap .kafichat-conv-rating { background: rgba(255, 193, 7, 0.1); border: 1px solid rgba(255, 193, 7, 0.3); }
.kafichat-myaccount-wrap .kafichat-conv-rating:hover { background: rgba(255, 193, 7, 0.2); }

.kafichat-myaccount-wrap .kafichat-new-reply-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px;
    background: linear-gradient(135deg, #00B894 0%, #009975 100%); color: white;
    border-radius: 12px; font-size: 11px; font-weight: 600; animation: kafichatPulse 2s infinite;
}

/* ═══════════════════════════════════════════════════════
   هدر و ناحیه پیام‌ها
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap .kafichat-header-triple {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px; background: linear-gradient(135deg, #f7fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0; gap: 16px; flex-wrap: wrap;
}
.kafichat-myaccount-wrap .kafichat-header-right { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.kafichat-myaccount-wrap .kafichat-conv-detail-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #00B894 0%, #009975 100%);
    color: white; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.kafichat-myaccount-wrap .kafichat-conv-detail-meta { flex: 1; min-width: 0; }
.kafichat-myaccount-wrap .kafichat-conv-detail-name { margin: 0 0 4px 0; font-size: 15px; font-weight: 700; color: #2d3748; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kafichat-myaccount-wrap .kafichat-conv-detail-phone { font-size: 12px; color: #718096; direction: ltr; display: inline-block; }
.kafichat-myaccount-wrap .kafichat-header-center { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.kafichat-myaccount-wrap .kafichat-header-left { display: flex; align-items: center; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-conv-detail-time { font-size: 12px; color: #718096; }
.kafichat-myaccount-wrap .kafichat-conv-detail-time small { font-size: 12px; color: #a0aec0; }

.kafichat-myaccount-wrap .kafichat-conv-messages-container {
    padding: 20px; background: #f7fafc; display: flex; flex-direction: column;
    gap: 12px; min-height: 300px; max-height: 500px; overflow-y: auto; overflow-x: hidden;
}
.kafichat-myaccount-wrap .kafichat-conv-messages-container::-webkit-scrollbar { width: 8px; }
.kafichat-myaccount-wrap .kafichat-conv-messages-container::-webkit-scrollbar-track { background: #f7fafc; border-radius: 4px; }
.kafichat-myaccount-wrap .kafichat-conv-messages-container::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #00B894 0%, #009975 100%); border-radius: 4px; }
.kafichat-myaccount-wrap .kafichat-conv-messages-container { scrollbar-width: thin; scrollbar-color: #00B894 #f7fafc; }

.kafichat-myaccount-wrap .kafichat-conv-no-messages { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: #a0aec0; text-align: center; }
.kafichat-myaccount-wrap .kafichat-conv-no-messages-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; animation: kafichatFloat 3s ease-in-out infinite; }

/* حباب‌های پیام */
.kafichat-myaccount-wrap .kafichat-msg-wrapper { display: flex; flex-direction: column; max-width: 70%; animation: kafichatFadeIn 0.3s ease; transition: transform 0.2s ease; }
.kafichat-myaccount-wrap .kafichat-msg-wrapper:hover { transform: translateY(-2px); }
.kafichat-myaccount-wrap .kafichat-msg-user { align-self: flex-start; }
.kafichat-myaccount-wrap .kafichat-msg-admin { align-self: flex-end; }
.kafichat-myaccount-wrap .kafichat-msg-system { align-self: center; max-width: 80%; }
.kafichat-myaccount-wrap .kafichat-msg-sender { font-size: 11px; font-weight: 600; margin-bottom: 4px; padding: 0 8px; }
.kafichat-myaccount-wrap .kafichat-msg-user .kafichat-msg-sender { color: #0284c7; }
.kafichat-myaccount-wrap .kafichat-msg-admin .kafichat-msg-sender { color: #00B894; text-align: left; }
.kafichat-myaccount-wrap .kafichat-msg-system .kafichat-msg-sender { color: #718096; text-align: center; }

.kafichat-myaccount-wrap .kafichat-msg-content {
    padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.6;
    word-wrap: break-word; word-break: break-word; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); transition: box-shadow 0.2s ease;
}
.kafichat-myaccount-wrap .kafichat-msg-content:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
.kafichat-myaccount-wrap .kafichat-msg-user .kafichat-msg-content { background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); color: #2d3748; border-bottom-left-radius: 4px; border: 1px solid #bae6fd; }
.kafichat-myaccount-wrap .kafichat-msg-admin .kafichat-msg-content { background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%); color: #2d3748; border-bottom-right-radius: 4px; border: 1px solid #bbf7d0; }
.kafichat-myaccount-wrap .kafichat-msg-system .kafichat-msg-content { background: #edf2f7; color: #718096; font-size: 12px; text-align: center; border-radius: 12px; }

.kafichat-myaccount-wrap .kafichat-msg-time { font-size: 10px; color: #a0aec0; margin-top: 4px; padding: 0 8px; }
.kafichat-myaccount-wrap .kafichat-msg-user .kafichat-msg-time { text-align: left; }
.kafichat-myaccount-wrap .kafichat-msg-admin .kafichat-msg-time { text-align: right; }
.kafichat-myaccount-wrap .kafichat-msg-system .kafichat-msg-time { text-align: center; }

/* پیام فایل */
.kafichat-myaccount-wrap .kafichat-msg-file {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    background: white; border: 1px solid #e2e8f0; border-radius: 12px;
    max-width: 300px; text-decoration: none; color: inherit; transition: all 0.2s;
}
.kafichat-myaccount-wrap .kafichat-msg-file:hover { background: #f7fafc; border-color: #00B894; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 184, 148, 0.2); }
.kafichat-myaccount-wrap .kafichat-msg-file-icon { font-size: 28px; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-msg-file-info { flex: 1; min-width: 0; overflow: hidden; }
.kafichat-myaccount-wrap .kafichat-msg-file-name { font-size: 13px; font-weight: 600; color: #2d3748; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.kafichat-myaccount-wrap .kafichat-msg-file-size { font-size: 11px; color: #718096; }
.kafichat-myaccount-wrap .kafichat-msg-file-download { font-size: 20px; color: #00B894; flex-shrink: 0; text-decoration: none; padding: 4px 8px; border-radius: 6px; background: rgba(0, 184, 148, 0.1); transition: all 0.2s; }
.kafichat-myaccount-wrap .kafichat-msg-file-download:hover { background: rgba(0, 184, 148, 0.2); transform: scale(1.1); }

/* ═══════════════════════════════════════════════════════
   امتیازدهی و نوارهای عملیاتی
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap .kafichat-rating-box {
    margin: 0 16px 16px 16px; padding: 16px;
    background: linear-gradient(135deg, #94e2d1 0%, #00A480 100%);
    border: 1px solid #00A480; border-radius: 12px; box-shadow: 0 2px 8px rgba(11, 245, 175, 0.15);
}
.kafichat-myaccount-wrap .kafichat-rating-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.kafichat-myaccount-wrap .kafichat-rating-title { font-size: 14px; font-weight: 700; color: #fffefe; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-rating-stars { font-size: 18px; letter-spacing: 1px; direction: ltr; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-rating-label { font-size: 13px; font-weight: 600; color: #fffdfb; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-rating-label::before { content: '('; }
.kafichat-myaccount-wrap .kafichat-rating-label::after { content: ')'; }
.kafichat-myaccount-wrap .kafichat-rating-comment { background: rgba(255, 255, 255, 0.6); border-radius: 8px; padding: 10px 12px; margin-top: 8px; border-right: 3px solid #016953; }
.kafichat-myaccount-wrap .kafichat-rating-comment-label { font-size: 12px; font-weight: 600; color: #016953; margin-bottom: 4px; }
.kafichat-myaccount-wrap .kafichat-rating-comment-text { font-size: 13px; color: #451a03; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; }
.kafichat-myaccount-wrap .kafichat-rating-date { font-size: 11px; color: #fffdf9; margin-top: 8px; text-align: left; direction: ltr; }

.kafichat-myaccount-wrap .kafichat-reopen-bar, .kafichat-myaccount-wrap .kafichat-refresh-bar, .kafichat-myaccount-wrap .kafichat-pagination {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap; border-top: 1px solid #e2e8f0;
}
.kafichat-myaccount-wrap .kafichat-reopen-bar { background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%); justify-content: space-between; border-top-color: #fde68a; }
.kafichat-myaccount-wrap .kafichat-refresh-bar { background: #f0fdf4; justify-content: space-between; border-bottom: 1px solid #bbf7d0; border-top: none; }
.kafichat-myaccount-wrap .kafichat-pagination { background: #f7fafc; justify-content: center; }
.kafichat-myaccount-wrap .kafichat-reopen-text { margin: 0; font-size: 13px; font-weight: 600; color: #92400e; }
.kafichat-myaccount-wrap .kafichat-ma-refresh-status { font-size: 12px; color: #065f46; font-weight: 600; display: none; }

.kafichat-myaccount-wrap .kafichat-btn-reopen {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px;
    background: linear-gradient(135deg, #00B894 0%, #009975 100%); color: white !important;
    border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
    text-decoration: none !important; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 6px rgba(0, 184, 148, 0.3);
}
.kafichat-myaccount-wrap .kafichat-btn-reopen:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 184, 148, 0.4); }

.kafichat-myaccount-wrap .kafichat-page-numbers { display: flex; align-items: center; gap: 4px; }
.kafichat-myaccount-wrap .kafichat-page-btn { min-width: 36px; height: 36px; padding: 6px 12px; }
.kafichat-myaccount-wrap .kafichat-page-current { background: linear-gradient(135deg, #00B894 0%, #009975 100%) !important; color: white !important; border-color: #00B894 !important; cursor: default; box-shadow: 0 2px 8px rgba(0, 184, 148, 0.3); }
.kafichat-myaccount-wrap .kafichat-page-current:hover { transform: none; color: white !important; background: linear-gradient(135deg, #00B894 0%, #009975 100%) !important; }
.kafichat-myaccount-wrap .kafichat-page-disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.kafichat-myaccount-wrap .kafichat-page-dots { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; color: #a0aec0; font-size: 14px; font-weight: 700; letter-spacing: 2px; }

/* ═══════════════════════════════════════════════════════
   فرم ارسال پیام (My Account)
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap .kafichat-myaccount-reply-form { padding: 14px 18px; background: white; border-top: 1px solid #e2e8f0; }
.kafichat-myaccount-wrap .kafichat-ma-reply-group { display: flex; align-items: flex-end; gap: 8px; }
.kafichat-myaccount-wrap .kafichat-ma-textarea {
    flex: 1; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
    font-size: 13px; resize: vertical; min-height: 40px; max-height: 100px; transition: border-color 0.2s;
}
.kafichat-myaccount-wrap .kafichat-ma-textarea:focus { outline: none; border-color: #00B894; box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.1); }
.kafichat-myaccount-wrap .kafichat-ma-reply-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.kafichat-myaccount-wrap .kafichat-ma-btn-send {
    padding: 8px 16px; background: linear-gradient(135deg, #00B894 0%, #009975 100%);
    color: white; border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.kafichat-myaccount-wrap .kafichat-ma-btn-send:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 184, 148, 0.3); }
.kafichat-myaccount-wrap .kafichat-ma-btn-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.kafichat-myaccount-wrap .kafichat-ma-btn-attach {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 16px; cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.kafichat-myaccount-wrap .kafichat-ma-btn-attach:hover { border-color: #00B894; background: #f0fdf4; }

.kafichat-myaccount-wrap .kafichat-ma-file-preview {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f7fafc;
    border: 1px solid #e2e8f0; border-left: 3px solid #00B894; border-radius: 6px; margin-bottom: 8px; font-size: 12px;
}
.kafichat-myaccount-wrap .kafichat-ma-file-preview-icon { font-size: 16px; }
.kafichat-myaccount-wrap .kafichat-ma-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4a5568; }
.kafichat-myaccount-wrap .kafichat-ma-file-remove { background: none; border: none; color: #ef4444; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; }
.kafichat-myaccount-wrap .kafichat-ma-file-remove:hover { background: #fee2e2; }

.kafichat-myaccount-wrap .kafichat-ma-status { margin-top: 8px; padding: 8px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; text-align: center; }
.kafichat-myaccount-wrap .kafichat-ma-status-success { background: #d1fae5; color: #065f46; }
.kafichat-myaccount-wrap .kafichat-ma-status-error { background: #fee2e2; color: #991b1b; }

/* فرم امتیاز inline */
.kafichat-myaccount-wrap .kafichat-inline-rating {
    padding: 16px 18px; background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-top: 1px solid #fde68a; text-align: center;
}
.kafichat-myaccount-wrap .kafichat-inline-rating h4 { margin: 0 0 12px 0; font-size: 15px; font-weight: 700; color: #92400e; }
.kafichat-myaccount-wrap .kafichat-inline-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; direction: ltr; }
.kafichat-myaccount-wrap .kafichat-inline-stars span { font-size: 28px; cursor: pointer; opacity: 0.4; transition: all 0.2s; }
.kafichat-myaccount-wrap .kafichat-inline-stars span:hover { transform: scale(1.2); }
.kafichat-myaccount-wrap .kafichat-inline-rating .kafichat-ma-textarea { margin-bottom: 10px; max-width: 400px; margin-left: auto; margin-right: auto; display: block; }
.kafichat-myaccount-wrap .kafichat-inline-rating .kafichat-ma-btn-send { margin: 0 auto; display: block; }

/* حذف outline */
.kafichat-myaccount-wrap .kafichat-conv-item:focus, .kafichat-myaccount-wrap .kafichat-conv-item:active, .kafichat-myaccount-wrap .kafichat-conv-item:focus-visible,
.kafichat-myaccount-wrap .kafichat-btn-back:focus, .kafichat-myaccount-wrap .kafichat-btn-back:active,
.kafichat-myaccount-wrap a:focus, .kafichat-myaccount-wrap a:active,
.kafichat-myaccount-wrap .kafichat-page-btn:focus, .kafichat-myaccount-wrap .kafichat-page-btn:active,
.kafichat-myaccount-wrap .kafichat-btn-reopen:focus, .kafichat-myaccount-wrap .kafichat-btn-reopen:active {
    outline: none !important; box-shadow: none !important; border-color: transparent !important;
}

/* ═══════════════════════════════════════════════════════
   انیمیشن‌ها
   ═══════════════════════════════════════════════════════ */
@keyframes kafichatFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kafichatFadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kafichatFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes kafichatPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

/* ═══════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════ */
@media print {
    .kafichat-myaccount-wrap .kafichat-btn-back { display: none !important; }
}

/* ═══════════════════════════════════════════════════════
   Responsive Design (Mobile & Tablet)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .kafichat-myaccount-wrap .kafichat-msg-wrapper { max-width: 90%; }
    .kafichat-myaccount-wrap .kafichat-msg-wrapper:hover,
    .kafichat-myaccount-wrap .kafichat-conv-item:hover { transform: none; }

    .kafichat-myaccount-wrap .kafichat-header-triple { flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px; }
    .kafichat-myaccount-wrap .kafichat-header-right { order: 1; }
    .kafichat-myaccount-wrap .kafichat-header-center { order: 2; }
    .kafichat-myaccount-wrap .kafichat-header-left { order: 3; width: 100%; }

    .kafichat-myaccount-wrap .kafichat-conv-messages-container { padding: 12px; max-height: 400px; }
    .kafichat-myaccount-wrap .kafichat-msg-file { max-width: 100%; }
    .kafichat-myaccount-wrap .kafichat-rating-box { margin: 0 12px 12px 12px; }

    .kafichat-myaccount-wrap .kafichat-reopen-bar,
    .kafichat-myaccount-wrap .kafichat-refresh-bar { flex-direction: column; text-align: center; }
    .kafichat-myaccount-wrap .kafichat-btn-reopen,
    .kafichat-myaccount-wrap .kafichat-ma-btn-refresh { width: 100%; justify-content: center; }

    .kafichat-myaccount-wrap .kafichat-pagination { gap: 6px; padding: 12px; }
    .kafichat-myaccount-wrap .kafichat-page-btn { min-width: 32px; height: 32px; padding: 4px 8px; font-size: 12px; }

    /* ✅ بخش ارسال پیام (بهینه‌سازی شده برای موبایل) */
    .kafichat-myaccount-wrap .kafichat-ma-reply-group {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .kafichat-myaccount-wrap .kafichat-ma-textarea {
        width: 100% !important;
        min-height: 60px !important; /* ارتفاع مناسب‌تر برای تایپ */
        max-height: 120px !important;
    }

    .kafichat-myaccount-wrap .kafichat-ma-reply-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }

    /* دکمه آپلود فایل */
    .kafichat-myaccount-wrap .kafichat-ma-btn-attach {
        flex-shrink: 0 !important;
        width: 44px !important; /* استاندارد لمس */
        height: 44px !important;
        padding: 0 !important;
        justify-content: center !important;
    }

    /* دکمه ارسال */
    .kafichat-myaccount-wrap .kafichat-ma-btn-send {
        flex: 1 !important;
        width: auto !important;
        height: 44px !important;
        justify-content: center !important;
    }
}

/* ═══════════════════════════════════════════════════════
   اصلاحات آیکن‌ها، ستاره‌ها و تصاویر پیوست
   ═══════════════════════════════════════════════════════ */

/* تنظیم اندازه استاندارد برای همه آیکن‌های SVG */
.kafichat-myaccount-wrap .kafichat-svg-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
}

/* رنگ‌دهی ستاره‌های امتیاز در لیست مکالمات */
.kafichat-myaccount-wrap .kafichat-conv-rating {
    color: #f59e0b; /* رنگ طلایی */
}
.kafichat-myaccount-wrap .kafichat-conv-rating .kafichat-svg-icon {
    width: 14px;
    height: 14px;
}

/* رنگ‌دهی ستاره‌های امتیاز در باکس امتیاز (سبز تیره روی پس‌زمینه سبز) */
.kafichat-myaccount-wrap .kafichat-rating-stars {
    color: #ffffff;
}
.kafichat-myaccount-wrap .kafichat-rating-stars .kafichat-svg-icon {
    width: 18px;
    height: 18px;
}

/* رنگ‌دهی ستاره‌های فرم امتیازدهی Inline (بعد از بسته شدن مکالمه) */
.kafichat-myaccount-wrap .kafichat-inline-stars span {
    color: #f59e0b; /* رنگ طلایی */
}
.kafichat-myaccount-wrap .kafichat-inline-stars span:hover {
    color: #d97706; /* طلایی تیره‌تر هنگام هاور */
}
.kafichat-myaccount-wrap .kafichat-inline-stars .kafichat-svg-icon {
    width: 28px;
    height: 28px;
}

/* ═══════════════════════════════════════════════════════
   استایل‌دهی تصاویر پیوست (پریویو عکس‌ها)
   ═══════════════════════════════════════════════════════ */
.kafichat-myaccount-wrap .kafichat-msg-image {
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.kafichat-myaccount-wrap .kafichat-msg-image:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kafichat-myaccount-wrap .kafichat-msg-image-link {
    display: block;
    text-decoration: none;
    cursor: zoom-in;
}

.kafichat-myaccount-wrap .kafichat-msg-thumbnail {
    display: block;
    width: 100%;
    max-height: 200px; /* جلوگیری از بزرگ شدن بیش از حد عکس‌ها */
    object-fit: cover; /* برش زیبای عکس */
    border-bottom: 1px solid #e2e8f0;
}

.kafichat-myaccount-wrap .kafichat-msg-image-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    gap: 8px;
}

.kafichat-myaccount-wrap .kafichat-msg-image-info .kafichat-msg-file-name {
    font-size: 11px;
    color: #4a5568;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.kafichat-myaccount-wrap .kafichat-msg-image-info .kafichat-msg-file-size {
    font-size: 10px;
    color: #a0aec0;
    flex-shrink: 0;
}

/* ریسپانسیو کردن عکس‌ها در موبایل */
@media (max-width: 768px) {
    .kafichat-myaccount-wrap .kafichat-msg-image {
        max-width: 220px;
    }
    .kafichat-myaccount-wrap .kafichat-msg-thumbnail {
        max-height: 150px;
    }
}