/**
 * استایل ویجت فرانت‌اند چت آنلاین قاصدک سافت
 *
 * @package Ghasedak_Soft_Chat_Free
 * @version  1.0.0
 */

/* ─── متغیرها ───────────────────────────────────────────────────── */
:root {
        --gksoft-chat-primary: #e8740c;
        --gksoft-chat-primary-light: #ff9a3c;
        --gksoft-chat-bg: #ffffff;
        --gksoft-chat-text: #1f2937;
        --gksoft-chat-text-light: #6b7280;
        --gksoft-chat-border: #e5e7eb;
        --gksoft-chat-radius: 12px;
        --gksoft-chat-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ─── v3.24.21: ایزولاسیون CSS — رویکرد حداقلی و ایمن ─── */
/*
 * v3.24.14–v3.24.20: لایه ۱ ریست عمومی (* + :where()) باعث خرابی استایل باکس چت شد.
 * علت: حتی با :where()، ریست border/font-size/font-weight/background-image روی *
 * ویژگی‌های لایه‌بندی و ظاهری عناصر ویجت رو تغییر می‌داد.
 *
 * راه‌حل v3.24.21: حذف کامل لایه ۱ (ریست عمومی) و استفاده فقط از
 * لایه ۲ (double-class + !important) برای پراپرتی‌هایی که:
 *   ۱) در تمام ویجت مقدار یکسانی دارند
 *   ۲) تم‌ها معمولاً با !important حمله می‌کنن
 *   ۳) هرگز با استایل‌های خاص ویجت تداخل ندارن
 */

/* box-sizing یکتا — فقط پراپرتی‌ای که روی همه عناصر لازمه */
.gksoft-chat-free-widget,
.gksoft-chat-free-widget *,
.gksoft-chat-free-widget *::before,
.gksoft-chat-free-widget *::after {
        box-sizing: border-box;
        -webkit-box-sizing: border-box;
}

/* placeholder — جزو طراحی ویجت، نه ریست */
.gksoft-chat-free-widget ::placeholder {
        color: var(--gksoft-chat-text-light);
        opacity: 1;
}

/*
 * لایه ۲: مقابله با !important تم‌ها
 * specificity: 0-2-0 (double-class) + !important
 * فقط پراپرتی‌هایی که تم‌ها واقعاً با !important تهاجمی استایل می‌دن
 * و در ویجت هیچ عنصری مقدار متفاوتی برای اون‌ها نداره
 */
.gksoft-chat-free-widget.gksoft-chat-free-widget button,
.gksoft-chat-free-widget.gksoft-chat-free-widget input,
.gksoft-chat-free-widget.gksoft-chat-free-widget textarea,
.gksoft-chat-free-widget.gksoft-chat-free-widget select {
        font-family: Vazirmatn, Tahoma, Arial, sans-serif !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        text-shadow: none !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        float: none !important;
}

.gksoft-chat-free-widget.gksoft-chat-free-widget img {
        max-width: none !important;
}

/* ─── کانتینر اصلی ──────────────────────────────────────────────── */
.gksoft-chat-free-widget {
        position: fixed;
        z-index: 999999;
        font-family: Vazirmatn, Tahoma, Arial, sans-serif;
        font-size: 14px;
        line-height: 1.5;
        direction: rtl;
}

.gksoft-chat-free-widget-bottom-left {
        bottom: 20px;
        left: 20px;
}

.gksoft-chat-free-widget-bottom-right {
        bottom: 20px;
        right: 20px;
}

/* ─── دکمه شروع چت (Bubble) ────────────────────────────────────── */
.gksoft-chat-free-bubble {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--gksoft-chat-primary), var(--gksoft-chat-primary-light));
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(232,116,12,0.4);
        transition: transform 0.3s, box-shadow 0.3s;
        position: relative;
        z-index: 2;
}

/* وقتی پنل چت باز است، دکمه نارنجی زیر پنل قرار می‌گیرد */
.gksoft-chat-free-wrap.chat-open .gksoft-chat-free-bubble {
        z-index: 1;
}

.gksoft-chat-free-bubble:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(232,116,12,0.5);
}

.gksoft-chat-free-bubble-icon {
        width: 28px;
        height: 28px;
}

/* پالس ضربان‌دار */
@keyframes gksoft-chat-free-pulse {
        0% { box-shadow: 0 0 0 0 rgba(232,116,12,0.4); }
        70% { box-shadow: 0 0 0 15px rgba(232,116,12,0); }
        100% { box-shadow: 0 0 0 0 rgba(232,116,12,0); }
}

.gksoft-chat-free-bubble.pulse {
        animation: gksoft-chat-free-pulse 2s infinite;
}

/* نشانگر آنلاین */
.gksoft-chat-free-online-dot {
        position: absolute;
        top: 2px;
        right: 2px;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: #22c55e;
        border: 2px solid #fff;
        transition: background 0.3s;
}

.gksoft-chat-free-online-dot.status-busy {
        background: #f59e0b;
}

.gksoft-chat-free-online-dot.status-away {
        background: #3b82f6;
}

.gksoft-chat-free-online-dot.status-offline {
        display: none;
}

/* شمارنده پیام خوانده‌نشده */
.gksoft-chat-free-bubble-badge {
        position: absolute;
        top: -4px;
        left: -4px;
        background: #ef4444;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
}

/* ─── پنل‌ها (پیش‌چت و چت) ─────────────────────────────────────── */
.gksoft-chat-free-prechat,
.gksoft-chat-free-chat-panel {
        position: absolute;
        bottom: 75px;
        width: 370px;
        height: 560px;
        max-height: 80vh;
        background: var(--gksoft-chat-bg);
        border-radius: var(--gksoft-chat-radius);
        box-shadow: var(--gksoft-chat-shadow);
        display: flex;
        flex-direction: column;
}

.gksoft-chat-free-prechat {
        overflow: hidden;
}

/* NOTE: overflow: visible برای اجازه نمایش emoji picker که با position:absolute بالای input-area قرار می‌گیرد.
   corner radius با border-radius روی خود panel حفظ می‌شود. */
.gksoft-chat-free-chat-panel {
        overflow: visible;
}

.gksoft-chat-free-widget-bottom-left .gksoft-chat-free-prechat,
.gksoft-chat-free-widget-bottom-left .gksoft-chat-free-chat-panel {
        left: 0;
}

.gksoft-chat-free-widget-bottom-right .gksoft-chat-free-prechat,
.gksoft-chat-free-widget-bottom-right .gksoft-chat-free-chat-panel {
        right: 0;
}

/* ─── هدر پنل ──────────────────────────────────────────────────── */
.gksoft-chat-free-panel-header {
        background: linear-gradient(135deg, var(--gksoft-chat-primary), var(--gksoft-chat-primary-light));
        color: #fff;
        padding: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
}

.gksoft-chat-free-panel-title h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
}

.gksoft-chat-free-panel-title p {
        margin: 2px 0 0;
        font-size: 12px;
        opacity: 0.85;
}

.gksoft-chat-free-panel-close,
.gksoft-chat-free-minimize,
.gksoft-chat-free-sound-toggle {
        background: none;
        border: none;
        color: #fff;
        font-size: 22px;
        cursor: pointer;
        opacity: 0.8;
        transition: opacity 0.2s;
        padding: 0 4px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
}

.gksoft-chat-free-panel-close:hover,
.gksoft-chat-free-minimize:hover,
.gksoft-chat-free-sound-toggle:hover {
        opacity: 1;
}

/* دکمه صدای اعلان */
.gksoft-chat-free-sound-toggle {
        font-size: 18px;
        opacity: 0.65;
}
.gksoft-chat-free-sound-toggle.sound-active {
        opacity: 0.95;
}
.gksoft-chat-free-sound-toggle svg {
        display: block;
}

.gksoft-chat-free-panel-actions {
        display: flex;
        align-items: center;
        gap: 8px;
}

/* ─── اطلاعات کارشناس ──────────────────────────────────────────── */
.gksoft-chat-free-agent-info {
        display: flex;
        align-items: center;
        gap: 10px;
}

.gksoft-chat-free-agent-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: rgba(255,255,255,0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
}

.gksoft-chat-free-agent-status-text {
        font-size: 12px;
        opacity: 0.85;
}

/* ─── آواتار کارشناسان — همپوشانی ۳۰٪، حداکثر ۵ ──────────── */
.gksoft-chat-free-agents-avatars {
        display: flex;
        align-items: center;
        padding: 0 16px 8px 16px;
        direction: ltr;
}

.gksoft-chat-free-agent-avatar-item {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border: 2px solid #fff;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.gksoft-chat-free-agent-avatar-item img {
        width: 100%;
        height: 100%;
        border-radius: 50%;
        object-fit: cover;
}

.gksoft-chat-free-avatar-overlap {
        margin-left: -11px; /* ۳۰٪ همپوشانی: 36px × 0.3 ≈ 11px */
}

.gksoft-chat-free-avatar-initials {
        font-size: 14px;
        font-weight: 600;
        color: #6b7280;
}

.gksoft-chat-free-avatar-more {
        background: #f3f4f6;
        font-size: 11px;
        font-weight: 700;
        color: #6b7280;
}

/* ─── فرم پیش‌چت ───────────────────────────────────────────────── */
.gksoft-chat-free-prechat-body {
        padding: 20px;
        flex: 1;
        overflow-y: auto;
}

.gksoft-chat-free-field {
        margin-bottom: 12px;
}

.gksoft-chat-free-field input {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid var(--gksoft-chat-border);
        border-radius: 8px;
        font-size: 14px;
        font-family: inherit;
        direction: rtl;
        transition: border-color 0.2s;
        box-sizing: border-box;
}

.gksoft-chat-free-field input:focus {
        border-color: var(--gksoft-chat-primary);
        outline: none;
        box-shadow: 0 0 0 2px rgba(232,116,12,0.2);
}

.gksoft-chat-free-start-btn {
        width: 100%;
        padding: 12px;
        background: linear-gradient(135deg, var(--gksoft-chat-primary), var(--gksoft-chat-primary-light));
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        transition: opacity 0.2s;
}

.gksoft-chat-free-start-btn:hover {
        opacity: 0.9;
}

/* ─── پیام آفلاین ──────────────────────────────────────────────── */
.gksoft-chat-free-offline-msg {
        text-align: center;
        padding: 20px;
        color: var(--gksoft-chat-text-light);
}

.gksoft-chat-free-offline-msg p {
        margin: 0;
        font-size: 14px;
}

/* ─── پیام حالت صف (کارشناسان مشغول) ─────────────────────── */
.gksoft-chat-free-busy-notice {
        background: #fef3c7;
        border: 1px solid #fcd34d;
        border-radius: 8px;
        padding: 12px 14px;
        margin: 0 0 14px 0;
        color: #92400e;
        text-align: center;
}

.gksoft-chat-free-busy-notice p {
        margin: 0;
        font-size: 13px;
        line-height: 1.6;
}

/* شورتکد وضعیت — حالت صف */
.gksoft-chat-free-status-busy {
        color: #d97706;
}

/* ─── v3.24.13: wrapper پیام‌ها (الگوی agent — positioning context برای دکمه اسکرول) ─── */
.gksoft-chat-free-messages-wrapper {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
}

/* ─── ناحیه پیام‌ها ────────────────────────────────────────────── */
.gksoft-chat-free-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 16px;
        background: #f9fafb;
        min-height: 0;
        width: 100%;
        box-sizing: border-box;
}

.gksoft-chat-free-msg {
        margin-bottom: 10px;
        display: flex;
}

.gksoft-chat-free-msg-visitor {
        flex-direction: column;
        align-items: flex-start;
}

.gksoft-chat-free-msg-agent {
        flex-direction: column;
        align-items: flex-end;
}

.gksoft-chat-free-msg-system {
        justify-content: center;
}

.gksoft-chat-free-msg-bubble {
        padding: 10px 14px;
        border-radius: 12px;
        max-width: 80%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        font-size: 14px;
        line-height: 1.6;
}

.gksoft-chat-free-msg-text {
        white-space: pre-wrap;
        word-break: break-word;
}

.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-bubble {
        background: #f3f4f6;
        color: var(--gksoft-chat-text);
        border-bottom-left-radius: 4px;
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-bubble {
        background: linear-gradient(135deg, var(--gksoft-chat-primary), var(--gksoft-chat-primary-light));
        color: #fff;
        border-bottom-right-radius: 4px;
}

.gksoft-chat-free-msg-system .gksoft-chat-free-msg-bubble {
        background: transparent;
        color: var(--gksoft-chat-text-light);
        font-size: 12px;
        text-align: center;
}

.gksoft-chat-free-msg-time {
        font-size: 11px;
        color: #9ca3af;
        margin-top: 4px;
        display: block;
}

/* رنگ روشن‌تر برای تاریخ روی حباب نارنجی (پیام کارشناس) */
.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-time {
        color: #e5e7eb;
}

/* ─── نشانگر تایپ ──────────────────────────────────────────────── */
.gksoft-chat-free-typing-indicator {
        padding: 8px 16px;
        font-size: 13px;
        color: var(--gksoft-chat-text-light);
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
}

.gksoft-chat-free-typing-dots {
        display: inline-flex;
        gap: 3px;
}

.gksoft-chat-free-typing-dots span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--gksoft-chat-text-light);
        animation: gksoft-chat-free-typing-bounce 1.4s infinite;
}

.gksoft-chat-free-typing-dots span:nth-child(2) {
        animation-delay: 0.2s;
}

.gksoft-chat-free-typing-dots span:nth-child(3) {
        animation-delay: 0.4s;
}

@keyframes gksoft-chat-free-typing-bounce {
        0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
        30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── وضعیت صف ─────────────────────────────────────────────────── */
.gksoft-chat-free-queue-status {
        padding: 8px 16px;
        text-align: center;
        background: #fef3c7;
        color: #92400e;
        font-size: 13px;
        border-top: 1px solid #fde68a;
        flex-shrink: 0;
}

/* ─── ناحیه ورودی ──────────────────────────────────────────────── */
.gksoft-chat-free-input-area {
        display: flex;
        align-items: flex-end;
        gap: 8px;
        padding: 12px 16px;
        border-top: 1px solid var(--gksoft-chat-border);
        background: var(--gksoft-chat-bg);
        flex-shrink: 0;
        position: relative;
}

.gksoft-chat-free-input-area textarea {
        flex: 1;
        resize: none;
        border: 1px solid var(--gksoft-chat-border);
        border-radius: 8px;
        padding: 10px 12px;
        font-size: 14px;
        font-family: inherit;
        direction: rtl;
        max-height: 80px;
        overflow-y: auto;
        line-height: 1.5;
}

.gksoft-chat-free-input-area textarea:focus {
        border-color: var(--gksoft-chat-primary);
        outline: none;
        box-shadow: 0 0 0 2px rgba(232,116,12,0.2);
}

.gksoft-chat-free-send-btn {
        background: linear-gradient(135deg, var(--gksoft-chat-primary), var(--gksoft-chat-primary-light));
        color: #fff;
        border: none;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: opacity 0.2s;
        flex-shrink: 0;
}

.gksoft-chat-free-send-btn:hover:not(:disabled) {
        opacity: 0.9;
}

.gksoft-chat-free-send-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
}

.gksoft-chat-free-send-btn svg {
        fill: currentColor;
}

/* ─── شورتکد وضعیت ─────────────────────────────────────────────── */
.gksoft-chat-free-status {
        display: inline-block;
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 13px;
        font-weight: 500;
}

.gksoft-chat-free-status-online {
        background: #dcfce7;
        color: #166534;
}

.gksoft-chat-free-status-offline {
        background: #fee2e2;
        color: #991b1b;
}

/* ─── قدرت گرفته از ──────────────────────────────────────────────── */
.gksoft-chat-free-powered-by {
        text-align: center;
        padding: 6px 12px;
        font-size: 11px;
        color: #9ca3af;
        background: #f9fafb;
        border-top: 1px solid #e5e7eb;
        flex-shrink: 0;
        direction: rtl;
        overflow: visible;
}

.gksoft-chat-free-powered-by a {
        color: #e8740c;
        text-decoration: none;
        font-weight: 600;
}

.gksoft-chat-free-powered-by a:hover {
        text-decoration: underline;
}

/* ─── ریسپانسیو ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
        .gksoft-chat-free-prechat,
        .gksoft-chat-free-chat-panel {
                position: fixed !important;
                top: 0 !important;
                bottom: 0 !important;
                left: 0 !important;
                right: 0 !important;
                width: 100% !important;
                height: 100% !important;
                max-height: 100% !important;
                max-width: 100% !important;
                border-radius: 0 !important;
        }

        .gksoft-chat-free-bubble {
                width: 50px;
                height: 50px;
        }

        .gksoft-chat-free-bubble-icon {
                width: 24px;
                height: 24px;
        }

        /* مخفی کردن حباب چت هنگام باز بودن پنل چت روی موبایل */
        .gksoft-chat-free-widget.chat-open .gksoft-chat-free-bubble {
                display: none !important;
        }
}

/* ─── دکمه آپلود عکس ──────────────────────────────────────────── */
.gksoft-chat-free-upload-btn {
        background: none;
        border: none;
        color: #9ca3af;
        cursor: pointer;
        padding: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: color 0.2s;
        border-radius: 6px;
}

.gksoft-chat-free-upload-btn:hover {
        color: var(--gksoft-chat-primary);
        background: rgba(232,116,12,0.08);
}

.gksoft-chat-free-upload-btn.upload-disabled {
        opacity: 0.4;
        cursor: not-allowed;
        pointer-events: none;
        color: #ccc;
}

/* ─── پیش‌نمایش چند تصویر قبل از ارسال ──────────────────────── */
.gksoft-chat-free-image-preview {
        position: relative;
        padding: 8px 16px;
        border-top: 1px solid var(--gksoft-chat-border);
        background: var(--gksoft-chat-bg);
        flex-shrink: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
}

.gksoft-chat-free-image-preview-item {
        position: relative;
        display: inline-block;
}

.gksoft-chat-free-image-preview-item img {
        width: 70px;
        height: 70px;
        border-radius: 6px;
        object-fit: cover;
        border: 2px solid var(--gksoft-chat-border);
}

.gksoft-chat-free-image-preview-remove {
        position: absolute;
        top: -6px;
        left: -6px;
        background: rgba(0,0,0,0.6);
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        font-size: 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        z-index: 1;
}

/* ─── پروگرس بار آپلود تصویر (بازدیدکننده — دایره‌ای) ────── */
.gksoft-chat-free-upload-progress {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.45);
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
}

.gksoft-chat-free-upload-progress-bar {
        display: none; /* استفاده از اسپینر دایره‌ای بجای خطی */
}

.gksoft-chat-free-upload-progress .gksoft-chat-free-spinner {
        width: 24px;
        height: 24px;
        border: 3px solid rgba(255,255,255,0.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: gksoft-chat-spin 0.8s linear infinite;
}

/* ─── تصویر بندانگشتی بزرگ در حباب پیام (مثل تلگرام) ──────────── */
.gksoft-chat-free-msg-image-wrapper {
        position: relative;
        min-width: 200px;
        min-height: 150px;
}

.gksoft-chat-free-msg-image-thumb {
        max-width: 280px;
        max-height: 280px;
        width: 100%;
        border-radius: 8px;
        cursor: pointer;
        object-fit: cover;
        display: block;
        transition: opacity 0.2s;
}

.gksoft-chat-free-msg-image-thumb:hover {
        opacity: 0.85;
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-image-thumb {
        border: 1px solid rgba(255,255,255,0.2);
}

.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-image-thumb {
        border: 1px solid #e5e7eb;
}

/* ─── بندانگشتی گیف/استیکر ext/ در چت — عرض 200px ثابت ── */
.gksoft-chat-free-msg-image-wrapper.gksoft-chat-free-msg-gif-wrap {
        min-width: 0;
        min-height: 0;
}

.gksoft-chat-free-msg-image-thumb.gksoft-chat-free-msg-gif-thumb {
        width: 200px !important;
        max-width: 200px !important;
        height: auto !important;
        max-height: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        object-fit: contain !important;
}

/* ─── Placeholder لودینگ تصویر ─────────────────────────────── */
.gksoft-chat-free-img-placeholder {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        min-height: 150px;
        background: #f3f4f6;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-img-placeholder {
        background: rgba(255,255,255,0.15);
}

.gksoft-chat-free-img-placeholder svg {
        opacity: 0.5;
}

/* ─── اسپینر دایره‌ای لودینگ تصویر ──────────────────────────── */
.gksoft-chat-free-spinner {
        width: 28px;
        height: 28px;
        border: 3px solid rgba(0,0,0,0.1);
        border-top-color: var(--gksoft-chat-primary, #e8740c);
        border-radius: 50%;
        animation: gksoft-chat-spin 0.8s linear infinite;
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-spinner {
        border: 3px solid rgba(255,255,255,0.2);
        border-top-color: #fff;
}

@keyframes gksoft-chat-spin {
        to { transform: rotate(360deg); }
}

/* ─── لایت‌باکس ─────────────────────────────────────────────────── */
.gksoft-chat-free-lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 9999999;
        display: flex;
        align-items: center;
        justify-content: center;
        direction: ltr;
        background: rgba(0,0,0,0.95);
}

.gksoft-chat-free-lightbox-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
}

.gksoft-chat-free-lightbox-content {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
}

.gksoft-chat-free-lightbox-content img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        user-select: none;
        -webkit-user-drag: none;
        cursor: default;
}

/* ─── دکمه بستن ─── */
.gksoft-chat-free-lightbox-close {
        position: absolute;
        top: 12px;
        left: 12px;
        z-index: 3;
        background: rgba(255,255,255,0.12);
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 22px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s, opacity 0.4s ease;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
}

.gksoft-chat-free-lightbox-close:hover {
        background: rgba(255,255,255,0.3);
}

/* ─── دکمه‌های ناوبری (شناور) ─── */
.gksoft-chat-free-lightbox-prev,
.gksoft-chat-free-lightbox-next {
        position: absolute;
        top: 50%;
        z-index: 3;
        background: rgba(255,255,255,0.1);
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        font-size: 24px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
        transition: background 0.2s, opacity 0.4s ease;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
}

.gksoft-chat-free-lightbox-prev:hover,
.gksoft-chat-free-lightbox-next:hover {
        background: rgba(255,255,255,0.3);
}

.gksoft-chat-free-lightbox-prev {
        right: 16px;
}

.gksoft-chat-free-lightbox-next {
        left: 16px;
}

/* ─── شمارنده ─── */
.gksoft-chat-free-lightbox-counter {
        position: absolute;
        bottom: 12px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
        color: #fff;
        font-size: 13px;
        background: rgba(0,0,0,0.4);
        padding: 4px 14px;
        border-radius: 14px;
        transition: opacity 0.4s ease;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
}

/* ─── هاله‌های ناوبری لبه تصویر ─── */
.gksoft-chat-free-lightbox-edge {
        position: absolute;
        top: 0;
        width: 18%;
        height: 100%;
        z-index: 2;
        cursor: pointer;
        transition: opacity 0.3s ease;
}

.gksoft-chat-free-lightbox-edge-left {
        left: 0;
        background: linear-gradient(to right, rgba(0,0,0,0.35) 0%, transparent 100%);
}

.gksoft-chat-free-lightbox-edge-right {
        right: 0;
        background: linear-gradient(to left, rgba(0,0,0,0.35) 0%, transparent 100%);
}

.gksoft-chat-free-lightbox-edge-left:hover {
        background: linear-gradient(to right, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.gksoft-chat-free-lightbox-edge-right:hover {
        background: linear-gradient(to left, rgba(0,0,0,0.5) 0%, transparent 100%);
}

/* ─── محو شدن خودکار عناصر شناور ─── */
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-close,
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-prev,
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-next,
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-counter,
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-edge {
        opacity: 0;
        pointer-events: none;
}

.gksoft-chat-free-lightbox:not(.gksoft-lightbox-ui-hidden) .gksoft-chat-free-lightbox-close,
.gksoft-chat-free-lightbox:not(.gksoft-lightbox-ui-hidden) .gksoft-chat-free-lightbox-prev,
.gksoft-chat-free-lightbox:not(.gksoft-lightbox-ui-hidden) .gksoft-chat-free-lightbox-next,
.gksoft-chat-free-lightbox:not(.gksoft-lightbox-ui-hidden) .gksoft-chat-free-lightbox-counter,
.gksoft-chat-free-lightbox:not(.gksoft-lightbox-ui-hidden) .gksoft-chat-free-lightbox-edge {
        opacity: 1;
        pointer-events: auto;
}

/* ─── نشانگر ماوس روی لبه‌ها ─── */
.gksoft-chat-free-lightbox-edge-left {
        cursor: w-resize;
}

.gksoft-chat-free-lightbox-edge-right {
        cursor: e-resize;
}

/* ═══════════════════════════════════════════════════════════════ */
/*  استایل‌های نسخه 3.7.0                                            */
/*  - پاپ‌آپ انتخاب نوع پیوست                                        */
/*  - رندر ویدئو/صوت/فایل در چت                                      */
/*  - شماره ترتیب انتخاب فایل                                        */
/*  - لایت‌باکس ویدئو با کنترل سرعت و تمام‌صفحه                       */
/* ═══════════════════════════════════════════════════════════════ */

/* ─── پاپ‌آپ انتخاب نوع پیوست ─── */
.gksoft-chat-free-attach-popup {
        position: absolute;
        bottom: 100%;
        right: 0;
        margin-bottom: 6px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        z-index: 40;
        min-width: 130px;
        overflow: hidden;
        direction: rtl;
}

.gksoft-chat-free-attach-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 14px;
        cursor: pointer;
        font-size: 13px;
        color: #374151;
        transition: background 0.15s;
        border-bottom: 1px solid #f3f4f6;
}

.gksoft-chat-free-attach-item:last-child {
        border-bottom: none;
}

.gksoft-chat-free-attach-item:hover {
        background: #fff7ed;
        color: #ea580c;
}

/* ─── رندر ویدئو در حباب پیام ─── */
.gksoft-chat-free-msg-video-wrapper {
        position: relative;
        max-width: 280px;
        border-radius: 8px;
        overflow: hidden;
}

.gksoft-chat-free-msg-video-thumb {
        width: 100%;
        max-height: 280px;
        display: block;
        border-radius: 8px;
        background: #000;
}

.gksoft-chat-free-msg-video-poster {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s;
        border-radius: 8px;
}

.gksoft-chat-free-msg-video-poster:hover {
        background: rgba(0,0,0,0.55);
}

/* ─── رندر صوت در حباب پیام ─── */
.gksoft-chat-free-msg-audio-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 220px;
        padding: 4px;
}

.gksoft-chat-free-msg-audio-icon {
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: rgba(255,255,255,0.18);
        display: flex;
        align-items: center;
        justify-content: center;
}

.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-audio-icon {
        background: rgba(0,0,0,0.06);
}

.gksoft-chat-free-msg-audio-player {
        flex: 1;
        height: 32px;
        min-width: 160px;
}

/* ─── رندر فایل (سند) در حباب پیام ─── */
.gksoft-chat-free-msg-file-wrapper {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 200px;
        padding: 6px 4px;
}

.gksoft-chat-free-msg-file-icon {
        flex-shrink: 0;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
}

.gksoft-chat-free-msg-file-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
}

.gksoft-chat-free-msg-file-name {
        font-size: 12px;
        font-weight: 500;
        word-break: break-all;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
}

.gksoft-chat-free-msg-file-download {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        text-decoration: none;
        padding: 3px 8px;
        border-radius: 6px;
        background: rgba(255,255,255,0.2);
        color: inherit !important;
        margin-top: 2px;
        width: fit-content;
}

.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-file-download {
        background: #f3f4f6;
        color: #374151 !important;
}

/* ─── شماره ترتیب انتخاب در پیش‌نمایش ─── */
.gksoft-chat-free-image-preview-item {
        position: relative;
}

.gksoft-chat-free-image-preview-order {
        position: absolute;
        top: 4px;
        right: 4px;
        background: #ea580c;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        border-radius: 50%;
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.gksoft-chat-free-file-preview-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
}

.gksoft-chat-free-file-preview-label {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, calc(-50% + 20px));
        font-size: 9px;
        color: #fff;
        background: rgba(0,0,0,0.5);
        padding: 1px 6px;
        border-radius: 4px;
}

.gksoft-chat-free-file-preview-name {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        font-size: 8px;
        color: #fff;
        background: rgba(0,0,0,0.6);
        padding: 2px 4px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 0 0 6px 6px;
}

.gksoft-chat-free-image-preview-item:not(:has(img)) {
        background: #f3f4f6;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        height: 60px;
        border-radius: 6px;
        border: 2px solid #e5e7eb;
}

/* ─── لایت‌باکس ویدئو ─── */
.gksoft-chat-free-lightbox-video-wrapper {
        position: relative;
        z-index: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        max-width: 98vw;
        max-height: 96vh;
        gap: 10px;
}

.gksoft-chat-free-lightbox-video-wrapper video {
        max-width: 98vw;
        max-height: 88vh;
        background: #000;
        border-radius: 8px;
}

.gksoft-chat-free-lightbox-video-controls {
        display: flex;
        align-items: center;
        gap: 6px;
        background: rgba(0,0,0,0.6);
        padding: 6px 10px;
        border-radius: 8px;
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 3;
}

.gksoft-chat-free-lightbox-speed-btn {
        background: rgba(255,255,255,0.1);
        color: #fff;
        border: none;
        border-radius: 4px;
        padding: 3px 8px;
        font-size: 11px;
        cursor: pointer;
        transition: background 0.2s;
}

.gksoft-chat-free-lightbox-speed-btn:hover {
        background: rgba(255,255,255,0.25);
}

.gksoft-chat-free-lightbox-speed-btn.active {
        background: #ea580c;
        color: #fff;
        font-weight: 600;
}
.gksoft-chat-free-lightbox-minimize-btn {
        background: rgba(255,255,255,0.15);
        color: #fff;
        border: none;
        border-radius: 4px;
        padding: 3px 10px;
        font-size: 12px;
        cursor: pointer;
        transition: background 0.15s;
        margin-right: 4px;
}
.gksoft-chat-free-lightbox-minimize-btn:hover {
        background: rgba(249,115,22,0.6);
}

.gksoft-chat-free-lightbox-fullscreen-btn {
        background: rgba(255,255,255,0.1);
        color: #fff;
        border: none;
        border-radius: 4px;
        padding: 3px 6px;
        cursor: pointer;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
}

.gksoft-chat-free-lightbox-fullscreen-btn:hover {
        background: rgba(255,255,255,0.25);
}

/* برای لایت‌باکس ویدئو، محو شدن خودکار UI لازم نیست */
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-video-controls,
.gksoft-chat-free-lightbox.gksoft-lightbox-ui-hidden .gksoft-chat-free-lightbox-close {
        opacity: 1;
        pointer-events: auto;
}

/* ─── پیام فقط-ایموجی: سایز بزرگ + حباب بدون پس‌زمینه ─── */
.gksoft-chat-free-msg-emoji-only {
        font-size: 3em;
        line-height: 1.2;
        text-align: center;
        padding: 0;
}

.gksoft-chat-free-msg-bubble-emoji-only {
        background: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-width: none !important;
}

.gksoft-chat-free-msg-bubble-emoji-only .gksoft-chat-free-msg-time {
        font-size: 11px;
        opacity: 0.6;
        margin-top: 2px;
}

/* ─── فاز ۲: چراغ وضعیت سه‌رنگ در هدر + نشانگر تایپ در هدر + دکمه دانلود + Toast ─── */
.gksoft-chat-free-agent-avatar-wrapper {
        position: relative;
        display: inline-block;
}

.gksoft-chat-free-agent-status-light {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
}

.gksoft-chat-free-agent-status-light-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #ef4444; /* قرمز = آفلاین */
        transition: background 0.2s;
}

.gksoft-chat-free-agent-status-light.status-online .gksoft-chat-free-agent-status-light-dot {
        background: #22c55e;
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.6);
}

.gksoft-chat-free-agent-status-light.status-busy .gksoft-chat-free-agent-status-light-dot {
        background: #f59e0b;
        box-shadow: 0 0 4px rgba(245, 158, 11, 0.6);
}

.gksoft-chat-free-agent-status-light.status-offline .gksoft-chat-free-agent-status-light-dot {
        background: #ef4444;
}

.gksoft-chat-free-agent-meta-row {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
}

.gksoft-chat-free-typing-inline {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        color: #6b7280;
        padding: 1px 6px;
        background: rgba(255,255,255,0.2);
        border-radius: 8px;
}

.gksoft-chat-free-typing-text {
        color: #fff;
}

.gksoft-chat-free-download-plugin {
        background: transparent;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 4px 6px;
        border-radius: 4px;
        transition: background 0.15s;
        display: inline-flex;
        align-items: center;
}

.gksoft-chat-free-download-plugin:hover {
        background: rgba(255,255,255,0.2);
}

/* ─── Toast سمت بازدیدکننده ─── */
.gksoft-chat-free-toast {
        position: fixed;
        bottom: 30px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        background: #1f2937;
        color: #fff;
        padding: 10px 24px;
        border-radius: 8px;
        font-size: 13px;
        z-index: 9999999;
        opacity: 0;
        transition: opacity 0.3s, transform 0.3s;
        pointer-events: none;
}

.gksoft-chat-free-toast-show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
}

/* ─── فاز ۳: پنل ایموجی + ری‌اکشن + ایموجی متحرک ─── */
.gksoft-chat-free-emoji-btn {
        background: transparent;
        border: none;
        color: #6b7280;
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        transition: color 0.15s, background 0.15s;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        position: relative;
        z-index: 10;
        pointer-events: auto;
}

.gksoft-chat-free-emoji-btn:hover {
        color: #e8740c;
        background: #fff7ed;
}

.gksoft-chat-free-emoji-picker {
        position: absolute;
        bottom: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
        height: 240px;
        overflow: hidden;
        z-index: 9999999;
        direction: rtl;
        margin-bottom: 4px;
        display: flex;
        flex-direction: column;
}

.gksoft-chat-free-emoji-tabs {
        display: flex;
        border-bottom: 1px solid #e5e7eb;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 2;
        flex-shrink: 0;
}

.gksoft-chat-free-emoji-tab-btn {
        flex: 1;
        padding: 6px 10px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 11px;
        color: #6b7280;
        border-bottom: 2px solid transparent;
}

.gksoft-chat-free-emoji-tab-btn.active {
        color: #e8740c;
        border-bottom-color: #e8740c;
        font-weight: 600;
}

/* پنل تب — پر کردن فضای باقی‌مانده با اسکرول عمودی */
.gksoft-chat-free-emoji-tab-panel {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
}

.gksoft-chat-free-emoji-category {
        padding: 6px;
}

.gksoft-chat-free-emoji-category-title {
        font-size: 10px;
        color: #9ca3af;
        margin-bottom: 4px;
        padding: 0 4px;
}

.gksoft-chat-free-emoji-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        gap: 2px;
}

.gksoft-chat-free-emoji-item {
        cursor: pointer;
        padding: 4px;
        text-align: center;
        font-size: 18px;
        border-radius: 4px;
        transition: background 0.15s;
}

.gksoft-chat-free-emoji-item:hover {
        background: #fff7ed;
}

.gksoft-chat-free-emoji-anim-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        padding: 6px;
}

.gksoft-chat-free-emoji-anim-item {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 2px;
        border-radius: 6px;
        transition: background 0.15s, transform 0.15s;
}

.gksoft-chat-free-emoji-anim-item:hover {
        background: #fff7ed;
        transform: scale(1.15);
}

.gksoft-chat-free-emoji-anim-item img {
        width: 28px;
        height: 28px;
        object-fit: contain;
}

/* ── v3.24.7: پروگرس بار اسپلش اولین بار لود گیف ── */
.gksoft-chat-free-ext-gifs-splash {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 28px 12px 20px;
        gap: 12px;
}

.gksoft-chat-free-ext-gifs-splash-text {
        font-size: 11px;
        color: #6b7280;
        text-align: center;
        line-height: 1.8;
        max-width: 260px;
}

.gksoft-chat-free-ext-gifs-splash-bar {
        width: 100%;
        max-width: 220px;
        height: 6px;
        background: #e5e7eb;
        border-radius: 3px;
        overflow: hidden;
}

.gksoft-chat-free-ext-gifs-splash-fill {
        height: 100%;
        width: 0%;
        background: linear-gradient(90deg, #f97316, #fb923c);
        border-radius: 3px;
        transition: width 4s ease-in-out;
}

/* ── گیف‌های بزرگسال (ext/) — چیدمان ماسونری ۳ ستونه ── */
.gksoft-chat-free-ext-gifs-container {
        padding: 4px 6px;
}

.gksoft-chat-free-ext-gifs-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        align-content: start;
        padding-bottom: 8px;
}

.gksoft-chat-free-ext-gif-item {
        cursor: pointer;
        border-radius: 6px;
        transition: background 0.15s, transform 0.15s;
        overflow: hidden;
}

.gksoft-chat-free-ext-gif-item:hover {
        background: #fff7ed;
        transform: scale(1.05);
}

.gksoft-chat-free-ext-gif-item img {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 4px;
        background: #f3f4f6;
}

.gksoft-chat-free-ext-gifs-loading,
.gksoft-chat-free-ext-gifs-empty {
        text-align: center;
        color: #9ca3af;
        font-size: 12px;
        padding: 24px 8px;
        grid-column: 1 / -1;
        line-height: 1.6;
}

/* نشانگر لودینگ حین اسکرول بی‌نهایت */
.gksoft-chat-free-ext-gifs-loading-more {
        grid-column: 1 / -1;
        padding: 8px;
        font-size: 11px;
        color: #9ca3af;
        text-align: center;
        animation: gksoft-ext-gif-pulse 1.5s ease-in-out infinite;
}

@keyframes gksoft-ext-gif-pulse {
        0%, 100% { opacity: 0.5; }
        50% { opacity: 1; }
}

.gksoft-chat-free-ext-gifs-pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 8px 4px 2px;
        border-top: 1px solid #f3f4f6;
        flex-shrink: 0;
}

.gksoft-chat-free-ext-gifs-page-btn {
        min-width: auto;
        height: 28px;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        background: #fff;
        color: #374151;
        font-size: 12px;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 14px;
        transition: all 0.15s;
        font-family: inherit;
        white-space: nowrap;
}

.gksoft-chat-free-ext-gifs-page-info {
        font-size: 11px;
        color: #9ca3af;
        min-width: 40px;
        text-align: center;
}

.gksoft-chat-free-ext-gifs-page-btn:hover:not(.disabled) {
        background: #f9fafb;
        border-color: #e8740c;
        color: #e8740c;
}

.gksoft-chat-free-ext-gifs-page-btn.active {
        background: #e8740c;
        color: #fff;
        border-color: #e8740c;
}

.gksoft-chat-free-ext-gifs-page-btn.disabled {
        opacity: 0.35;
        cursor: default;
        pointer-events: none;
}

/* ایموجی متحرک داخل پیام */
.gksoft-chat-free-msg-anim-emoji {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
}

.gksoft-chat-free-msg-anim-emoji-img {
        width: 70px;
        height: 70px;
        object-fit: contain;
        display: block;
}

/* دکمه‌های اقدام پیام در ویجت */
.gksoft-chat-free-msg-actions {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-top: 4px;
        padding-top: 4px;
        opacity: 0;
        transition: opacity 0.2s;
        max-width: 100%;
}

/* دکمه‌ها داخل حباب — همیشه به سمت چپ (سمت داخلی) */
.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-actions,
.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-actions {
        justify-content: flex-start;
}

.gksoft-chat-free-msg:hover .gksoft-chat-free-msg-actions,
.gksoft-chat-free-msg-bubble:hover > .gksoft-chat-free-msg-actions {
        opacity: 1;
}

.gksoft-chat-free-msg-actions button {
        background: transparent;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        padding: 6px 8px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 32px;
        min-height: 32px;
}

.gksoft-chat-free-msg-actions button svg {
        width: 18px;
        height: 18px;
}

.gksoft-chat-free-msg-actions button:hover {
        background: #fff7ed;
        color: #6b7280;
}

/* ری‌اکشن‌ها زیر پیام در ویجت */
.gksoft-chat-free-msg-reactions {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: wrap;
        margin-top: 0;
}

.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-reactions {
        justify-content: flex-start;
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-reactions {
        justify-content: flex-end;
}

.gksoft-chat-free-msg-reaction {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 18px;
        padding: 4px 8px;
        font-size: 12px;
        cursor: pointer;
        user-select: none;
        transition: background 0.15s, transform 0.15s;
}

.gksoft-chat-free-msg-reaction:hover {
        background: #fff7ed;
        transform: scale(1.05);
}

.gksoft-chat-free-msg-reaction.mine {
        background: #fff7ed;
        border-color: #fdba74;
}

.gksoft-chat-free-msg-reaction img {
        width: 32px;
        height: 32px;
        object-fit: contain;
}

.gksoft-chat-free-msg-reaction-count {
        color: #374151;
        font-weight: 600;
}

/* پنل ری‌اکشن (شناور) */
.gksoft-chat-free-reaction-picker {
        position: fixed;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        padding: 6px;
        z-index: 99999999;
        display: flex;
        align-items: center;
        gap: 2px;
        flex-wrap: wrap;
        max-width: 240px;
}

.gksoft-chat-free-reaction-item {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        border-radius: 8px;
        transition: background 0.15s, transform 0.15s;
}

.gksoft-chat-free-reaction-item:hover {
        background: #fff7ed;
        transform: scale(1.2);
}

.gksoft-chat-free-reaction-item img {
        width: 36px;
        height: 36px;
        object-fit: contain;
}

.gksoft-chat-free-reaction-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        cursor: pointer;
        border-radius: 8px;
        background: #f3f4f6;
        color: #6b7280;
        font-size: 20px;
        font-weight: 700;
        border: none;
}

.gksoft-chat-free-reaction-more:hover {
        background: #fff7ed;
}

.gksoft-chat-free-reaction-picker.collapsed .gksoft-chat-free-reaction-item-extra {
        display: none;
}

.gksoft-chat-free-reaction-picker.expanded .gksoft-chat-free-reaction-item-extra {
        display: inline-flex;
}

/* پیش‌نمایش ریپلای در ویجت */
.gksoft-chat-free-reply-preview {
        background: #fff7ed;
        border-right: 3px solid #e8740c;
        padding: 6px 10px;
        font-size: 12px;
        color: #6b7280;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 4px;
}

.gksoft-chat-free-reply-preview-label {
        font-weight: 600;
        color: #e8740c;
        margin-left: 6px;
}

.gksoft-chat-free-reply-preview-text {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
}

.gksoft-chat-free-reply-preview-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        font-size: 18px;
        padding: 0 4px;
}

.gksoft-chat-free-reply-preview-close:hover {
        color: #ef4444;
}

/* ریپلای داخل پیام */
.gksoft-chat-free-msg-reply-preview {
        display: flex;
        align-items: stretch;
        background: rgba(0,0,0,0.05);
        border-radius: 4px;
        padding: 4px 8px;
        margin-bottom: 4px;
        font-size: 11px;
        color: #6b7280;
}

.gksoft-chat-free-msg-reply-bar {
        width: 3px;
        background: #e8740c;
        border-radius: 2px;
        margin-left: 6px;
}

.gksoft-chat-free-msg-reply-content {
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
}

/* ─── بندانگشتی در ریپلای (سمت بازدیدکننده) ─── */
.gksoft-chat-free-msg-reply-thumb {
        width: 70px;
        height: 70px;
        object-fit: cover;
        border-radius: 8px;
        flex-shrink: 0;
}
/* برای ویدئو: تگ <video> هم به‌عنوان بندانگشتی نمایش داده می‌شود */
video.gksoft-chat-free-msg-reply-thumb {
        display: block;
        object-fit: cover;
        pointer-events: none;
}
/* wrapper برای ویدئو که آیکون play روی آن قرار گیرد */
.gksoft-chat-free-msg-reply-thumb-wrap {
        position: relative;
        width: 70px;
        height: 70px;
        flex-shrink: 0;
}
.gksoft-chat-free-msg-reply-thumb-wrap > video.gksoft-chat-free-msg-reply-thumb {
        width: 100%;
        height: 100%;
}
.gksoft-chat-free-msg-reply-play-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 32px;
        height: 32px;
        background: rgba(0, 0, 0, 0.55);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
}
.gksoft-chat-free-msg-reply-play-icon svg {
        margin-left: 2px;
        filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}
.gksoft-chat-free-msg-reply-content:has(.gksoft-chat-free-msg-reply-thumb),
.gksoft-chat-free-msg-reply-content:has(.gksoft-chat-free-msg-reply-thumb-wrap) {
        display: flex;
        align-items: center;
        gap: 0;
        white-space: nowrap;
        overflow: hidden;
}

/* ─── بندانگشتی در ریپلای: ریسپانسیو موبایل (≤768px) ─── */
@media (max-width: 768px) {
        .gksoft-chat-free-msg-reply-thumb,
        .gksoft-chat-free-msg-reply-thumb-wrap {
                width: 70px;
                height: 70px;
        }
        .gksoft-chat-free-msg-reply-play-icon {
                width: 28px;
                height: 28px;
        }
        .gksoft-chat-free-msg-reply-play-icon svg {
                width: 16px;
                height: 16px;
        }
}

/* ─── کلیک روی ریپلای: اسکرول به پیام اصلی + هایلایت ─── */
.gksoft-chat-free-msg-reply-preview {
        cursor: pointer;
        transition: background 0.15s;
}
.gksoft-chat-free-msg-reply-preview:hover {
        background: rgba(0, 0, 0, 0.08);
}
.gksoft-chat-free-msg-highlight {
        animation: gksoft-highlight-pulse 1.6s ease-out;
        border-radius: 8px;
}
@keyframes gksoft-highlight-pulse {
        0%   { background: rgba(232, 116, 12, 0); }
        20%  { background: rgba(232, 116, 12, 0.30); }
        60%  { background: rgba(232, 116, 12, 0.20); }
        100% { background: rgba(232, 116, 12, 0); }
}

/* ─── فاز ۵: ادامه مکالمات قبلی ─── */
.gksoft-chat-free-previous-conversations-btn {
        display: block;
        width: 100%;
        background: transparent;
        border: 1px dashed #e8740c;
        color: #e8740c;
        padding: 8px;
        margin-top: 12px;
        border-radius: 6px;
        cursor: pointer;
        font-size: 12px;
        font-weight: 600;
        transition: background 0.15s;
}

.gksoft-chat-free-previous-conversations-btn:hover {
        background: #fff7ed;
}

.gksoft-chat-free-prev-conv-modal {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 99999999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
}

.gksoft-chat-free-prev-conv-modal-content {
        background: #fff;
        border-radius: 12px;
        max-width: 500px;
        width: 100%;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        direction: rtl;
}

.gksoft-chat-free-prev-conv-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
        font-weight: 600;
        color: #1f2937;
}

.gksoft-chat-free-prev-conv-modal-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #6b7280;
        font-size: 24px;
        padding: 0 4px;
}

.gksoft-chat-free-prev-conv-modal-close:hover {
        color: #ef4444;
}

.gksoft-chat-free-prev-conv-modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
}

.gksoft-chat-free-prev-conv-group {
        margin-bottom: 16px;
        border-right: 3px solid #e8740c;
        padding-right: 10px;
}

.gksoft-chat-free-prev-conv-date {
        font-size: 12px;
        color: #6b7280;
        margin-bottom: 6px;
        font-weight: 600;
}

.gksoft-chat-free-prev-conv-messages {
        display: flex;
        flex-direction: column;
        gap: 6px;
}

.gksoft-chat-free-prev-conv-msg {
        display: flex;
        flex-direction: column;
        max-width: 75%;
}

.gksoft-chat-free-prev-conv-msg-visitor {
        align-self: flex-start;
        align-items: flex-start;
}

.gksoft-chat-free-prev-conv-msg-agent {
        align-self: flex-end;
        align-items: flex-end;
}

.gksoft-chat-free-prev-conv-msg-system {
        align-self: center;
        align-items: center;
        max-width: 90%;
}

.gksoft-chat-free-prev-conv-msg-bubble {
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 12px;
        word-wrap: break-word;
        word-break: break-word;
}

.gksoft-chat-free-prev-conv-msg-visitor .gksoft-chat-free-prev-conv-msg-bubble {
        background: #fff7ed;
        color: #1f2937;
}

.gksoft-chat-free-prev-conv-msg-agent .gksoft-chat-free-prev-conv-msg-bubble {
        background: #e8740c;
        color: #fff;
}

.gksoft-chat-free-prev-conv-msg-system .gksoft-chat-free-prev-conv-msg-bubble {
        background: #f3f4f6;
        color: #6b7280;
        font-size: 11px;
        text-align: center;
}

.gksoft-chat-free-prev-conv-msg-time {
        font-size: 10px;
        color: #9ca3af;
        margin-top: 2px;
}

.gksoft-chat-free-prev-conv-empty {
        color: #9ca3af;
        font-size: 12px;
        text-align: center;
        padding: 12px;
}

/* ─── فاز ۲: پخش‌کننده چسبان صدا (Sticky Audio Player) ─── */
.gksoft-chat-free-sticky-player {
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        padding: 6px 8px;
        display: flex;
        align-items: center;
        gap: 8px;
        z-index: 50;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        direction: rtl;
        flex-shrink: 0;
}
.gksoft-chat-free-sticky-player-info {
        display: flex;
        align-items: center;
        gap: 4px;
        max-width: 100px;
        overflow: hidden;
}
.gksoft-chat-free-sticky-player-info .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
        color: #e8740c;
        flex-shrink: 0;
}
.gksoft-chat-free-sticky-player-title {
        font-size: 11px;
        color: #374151;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
}
.gksoft-chat-free-sticky-player audio {
        flex: 1;
        height: 28px;
        min-width: 0;
}
.gksoft-chat-free-sticky-player audio::-webkit-media-controls-panel {
        height: 28px;
}
.gksoft-chat-free-sticky-player-close {
        background: none;
        border: none;
        cursor: pointer;
        color: #9ca3af;
        font-size: 18px;
        padding: 0 2px;
        flex-shrink: 0;
        line-height: 1;
}
.gksoft-chat-free-sticky-player-close:hover {
        color: #ef4444;
}

/* ─── v3.24.34: استیکی ویدئو — شناور قابل جابجایی (Drag) ─── */
.gksoft-chat-free-sticky-video {
        position: fixed;
        z-index: 99999998;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        background: #000;
        cursor: grab;
        display: none;
        direction: ltr;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
}
.gksoft-chat-free-sv-dragging {
        cursor: grabbing !important;
        transition: none !important;
}
.gksoft-chat-free-sticky-video-drag-handle {
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 3px;
        z-index: 3;
        pointer-events: none;
}
.gksoft-chat-free-sticky-video-drag-handle span {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: rgba(255,255,255,0.7);
}
.gksoft-chat-free-sticky-video-wrapper {
        width: 100%;
        height: 100%;
        overflow: hidden;
        background: #000;
}
.gksoft-chat-free-sticky-video-wrapper video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
}
.gksoft-chat-free-sticky-video-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.4);
        opacity: 0;
        transition: opacity 0.2s;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 8px;
}
.gksoft-chat-free-sticky-video:hover .gksoft-chat-free-sticky-video-overlay {
        opacity: 1;
}
.gksoft-chat-free-sv-expand {
        background: rgba(255,255,255,0.25);
        border: none;
        color: #fff;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
        padding: 0;
}
.gksoft-chat-free-sv-expand:hover {
        background: rgba(249,115,22,0.85);
}
.gksoft-chat-free-sv-close {
        background: rgba(255,255,255,0.25);
        border: none;
        color: #fff;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        line-height: 1;
        transition: background 0.15s;
        padding: 0;
}
.gksoft-chat-free-sv-close:hover {
        background: rgba(239,68,68,0.85);
}
/* ─── دکمه دانلود روی حباب پیوست ─── */
.gksoft-chat-free-msg-attachment-download {
        position: absolute;
        top: 6px;
        left: 6px;
        background: rgba(0,0,0,0.6);
        color: #fff;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 5;
        opacity: 0;
        transition: opacity 0.2s;
        text-decoration: none;
}

.gksoft-chat-free-msg-image-wrapper:hover .gksoft-chat-free-msg-attachment-download,
.gksoft-chat-free-msg-video-wrapper:hover .gksoft-chat-free-msg-attachment-download {
        opacity: 1;
}

.gksoft-chat-free-msg-attachment-download:hover {
        background: rgba(0,0,0,0.8);
        color: #fff;
}

.gksoft-chat-free-msg-attachment-download-inline {
        position: static;
        opacity: 1;
        background: #f3f4f6;
        color: #6b7280;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
}

.gksoft-chat-free-msg-attachment-download-inline:hover {
        background: #fff7ed;
        color: #e8740c;
}

.gksoft-chat-free-msg-image-wrapper,
.gksoft-chat-free-msg-video-wrapper {
        position: relative;
}

/* ─── وضعیت آپلود در پیش‌نمایش ─── */
.gksoft-chat-free-upload-status {
        position: absolute;
        bottom: 4px;
        left: 4px;
        right: 4px;
        background: rgba(255,255,255,0.95);
        border-radius: 4px;
        padding: 2px 6px;
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        z-index: 2;
}

.gksoft-chat-free-upload-status-uploading {
        color: #ea580c;
}

.gksoft-chat-free-upload-status-done {
        color: #16a34a;
        background: rgba(34, 197, 94, 0.15);
}

.gksoft-chat-free-upload-status-done .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
}

.gksoft-chat-free-upload-status-error {
        color: #ef4444;
        background: rgba(239, 68, 68, 0.15);
}

.gksoft-chat-free-upload-status-error .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
}

.gksoft-chat-free-upload-progress-text {
        font-weight: 600;
}

/* ─── اصلاح موقعیت reply preview: در input area، بالای textarea ─── */
.gksoft-chat-free-input-area {
        flex-wrap: wrap;
}

.gksoft-chat-free-reply-preview {
        flex: 1 1 100%;
        order: -1;
        margin-bottom: 4px;
}

/* ─── تصاویر در پیش‌نمایش باید position relative داشته باشن ─── */
.gksoft-chat-free-image-preview-item {
        position: relative;
}

/* ─── دکمه resize پنجره چت ─── */
.gksoft-chat-free-resize {
        background: transparent;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 4px 6px;
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background 0.15s;
}

.gksoft-chat-free-resize:hover {
        background: rgba(255,255,255,0.2);
}

/* حالت کوچک شده پنجره */
.gksoft-chat-free-resized {
        resize: both;
        overflow: auto;
        min-width: 300px;
        min-height: 300px;
}

/* ─── فرم آفلاین ─── */
.gksoft-chat-free-offline-form-wrapper {
        padding: 10px 0;
}

.gksoft-chat-free-offline-form-wrapper .gksoft-chat-free-offline-msg {
        margin-bottom: 10px;
}

#gksoft-chat-free-offline-form .gksoft-chat-free-field {
        margin-bottom: 8px;
}

#gksoft-chat-free-offline-form input,
#gksoft-chat-free-offline-form textarea {
        width: 100%;
        padding: 8px 10px;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        font-size: 13px;
        font-family: inherit;
        box-sizing: border-box;
}

#gksoft-chat-free-offline-form textarea {
        min-height: 60px;
        resize: vertical;
}

#gksoft-chat-free-offline-form input:focus,
#gksoft-chat-free-offline-form textarea:focus {
        border-color: var(--gksoft-chat-primary);
        outline: none;
        box-shadow: 0 0 0 2px rgba(232,116,12,0.2);
}

.gksoft-chat-free-offline-success {
        text-align: center;
        padding: 20px;
}

.gksoft-chat-free-offline-success .dashicons {
        font-size: 48px;
        width: 48px;
        height: 48px;
        color: #22c55e;
}

.gksoft-chat-free-offline-success p {
        margin-top: 10px;
        color: #374151;
        font-size: 14px;
}

/* ─── v3.19.6: نظرسنجی پس از بسته شدن مکالمه ─────────────────────── */

.gksoft-chat-free-survey {
        margin: 12px 0;
        padding: 16px;
        background: linear-gradient(135deg, #fff7ed, #ffedd5);
        border-radius: 12px;
        border: 1px solid #fed7aa;
        text-align: center;
        direction: rtl;
}

.gksoft-chat-free-survey-title {
        font-size: 15px;
        font-weight: 700;
        color: #9a3412;
        margin-bottom: 4px;
}

.gksoft-chat-free-survey-subtitle {
        font-size: 12px;
        color: #c2410c;
        margin-bottom: 12px;
}

.gksoft-chat-free-survey-emojis {
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 12px;
}

.gksoft-chat-free-survey-emoji {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px;
        border: 2px solid transparent;
        border-radius: 10px;
        background: #fff;
        cursor: pointer;
        transition: all 0.2s;
        min-width: 56px;
}

.gksoft-chat-free-survey-emoji img {
        width: 40px;
        height: 40px;
}

.gksoft-chat-free-survey-emoji span {
        font-size: 10px;
        color: #6b7280;
}

.gksoft-chat-free-survey-emoji:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gksoft-chat-free-survey-emoji.selected {
        border-color: #e8740c;
        background: #fff7ed;
        transform: scale(1.05);
}

.gksoft-chat-free-survey-emoji.selected span {
        color: #9a3412;
        font-weight: 600;
}

.gksoft-chat-free-survey-comment {
        width: 100%;
        padding: 8px;
        border: 1px solid #fed7aa;
        border-radius: 8px;
        font-size: 13px;
        resize: vertical;
        min-height: 40px;
        margin-bottom: 8px;
        font-family: inherit;
        box-sizing: border-box;
        background: #fff;
        color: #1f2937;
        direction: rtl;
}

.gksoft-chat-free-survey-comment:focus {
        outline: none;
        border-color: #ea580c;
        box-shadow: 0 0 0 2px rgba(232, 116, 12, 0.15);
}

.gksoft-chat-free-survey-submit {
        background: #e8740c;
        color: #fff;
        border: none;
        padding: 8px 24px;
        border-radius: 8px;
        font-size: 13px;
        cursor: pointer;
        font-weight: 600;
        font-family: inherit;
        transition: background 0.15s;
}

.gksoft-chat-free-survey-submit:disabled {
        opacity: 0.5;
        cursor: not-allowed;
}

.gksoft-chat-free-survey-submit:not(:disabled):hover {
        background: #c2610a;
}

.gksoft-chat-free-survey-thanks {
        text-align: center;
        padding: 16px;
        margin: 12px 0;
        background: linear-gradient(135deg, #fff7ed, #ffedd5);
        border-radius: 12px;
        border: 1px solid #fed7aa;
        direction: rtl;
}

.gksoft-chat-free-survey-thanks-emoji {
        width: 56px;
        height: 56px;
        margin: 0 auto 8px;
        display: block;
}

.gksoft-chat-free-survey-thanks-msg {
        font-size: 14px;
        color: #9a3412;
        font-weight: 600;
        margin-bottom: 4px;
        line-height: 1.6;
}

.gksoft-chat-free-survey-thanks-sub {
        font-size: 12px;
        color: #c2410c;
}

/* ─── حالت تاریک نظرسنجی — v3.19.6 (prefers-color-scheme) ─── */
@media (prefers-color-scheme: dark) {
        .gksoft-chat-free-survey {
                background: linear-gradient(135deg, #431407, #7c2d12);
                border-color: #9a3412;
        }

        .gksoft-chat-free-survey-title {
                color: #fed7aa;
        }

        .gksoft-chat-free-survey-subtitle {
                color: #fdba74;
        }

        .gksoft-chat-free-survey-emoji {
                background: #1f2937;
        }

        .gksoft-chat-free-survey-emoji span {
                color: #d1d5db;
        }

        .gksoft-chat-free-survey-emoji.selected {
                background: #431407;
        }

        .gksoft-chat-free-survey-emoji.selected span {
                color: #fed7aa;
        }

        .gksoft-chat-free-survey-comment {
                background: #1f2937;
                border-color: #9a3412;
                color: #f3f4f6;
        }

        .gksoft-chat-free-survey-thanks {
                background: linear-gradient(135deg, #431407, #7c2d12);
                border-color: #9a3412;
        }

        .gksoft-chat-free-survey-thanks-msg {
                color: #fed7aa;
        }

        .gksoft-chat-free-survey-thanks-sub {
                color: #fdba74;
        }
}

/* ════════════════════════════════════════════════════════════════ */
/*  v3.20.1 — بنر مکالمه‌ی بسته‌شده (قابلیت بازگشایی)                 */
/* ════════════════════════════════════════════════════════════════ */
.gksoft-chat-free-closed-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 12px 0;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    color: #92400e;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: 0 4px 12px -4px rgba(245, 158, 11, 0.4);
    animation: gksoftChatFreeBannerSlide 0.3s ease;
}

.gksoft-chat-free-closed-banner .dashicons {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #d97706;
}

.gksoft-chat-free-closed-banner-text {
    flex: 1;
}

@keyframes gksoftChatFreeBannerSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* حالت تاریک برای بنر بسته‌شده */
@media (prefers-color-scheme: dark) {
    .gksoft-chat-free-closed-banner {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.12));
        border-color: #b45309;
        color: #fcd34d;
        box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.5);
    }
    .gksoft-chat-free-closed-banner .dashicons {
        color: #fbbf24;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   v3.20.2 — استایل‌های اضافی (اسکرول‌بار سفارشی، انیمیشن، FAB)
   ═══════════════════════════════════════════════════════════════════ */

/* ─── اسکرول‌بار سفارشی ─── */
.gksoft-chat-free-messages::-webkit-scrollbar {
        width: 5px;
}

.gksoft-chat-free-messages::-webkit-scrollbar-track {
        background: transparent;
}

.gksoft-chat-free-messages::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 3px;
}

.gksoft-chat-free-messages::-webkit-scrollbar-thumb:hover {
        background: #9ca3af;
}

/* Firefox */
.gksoft-chat-free-messages {
        scrollbar-width: thin;
        scrollbar-color: #d1d5db transparent;
}

/* ─── انیمیشن ورود پیام ─── */
@keyframes gksoft-widget-msg-fade-in {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
}

.gksoft-chat-free-msg {
        animation: gksoft-widget-msg-fade-in 0.2s ease-out;
}

/* ─── سایه ملایم حباب ─── */
.gksoft-chat-free-msg-bubble {
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        transition: box-shadow 0.2s ease;
}

.gksoft-chat-free-msg:hover .gksoft-chat-free-msg-bubble {
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ─── دکمه اسکرول به پایین (FAB) — v3.24.13: داخل messages-wrapper, الگوی agent ─── */
.gksoft-chat-free-scroll-bottom {
        position: absolute;
        bottom: 16px;
        right: 16px;
        transform: translateY(16px);
        opacity: 0;
        pointer-events: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid #fed7aa;
        box-shadow: 0 2px 10px rgba(249,115,22,0.15);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 50;
        transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
        padding: 0;
        margin: 0;
}

.gksoft-chat-free-scroll-bottom.visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
}

.gksoft-chat-free-scroll-bottom:hover {
        background: #fff7ed;
        box-shadow: 0 4px 14px rgba(249,115,22,0.25);
}

.gksoft-chat-free-scroll-bottom svg {
        width: 18px;
        height: 18px;
        color: #f97316;
}

/* ─── جداساز تاریخ در چت ─── */
.gksoft-chat-free-date-sep {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 14px 0 10px;
        color: #9ca3af;
        font-size: 10px;
        direction: rtl;
}

.gksoft-chat-free-date-sep::before,
.gksoft-chat-free-date-sep::after {
        content: '';
        flex: 1;
        height: 1px;
        background: #e5e7eb;
}

.gksoft-chat-free-date-sep span {
        white-space: nowrap;
        padding: 2px 8px;
        background: #f9fafb;
        border-radius: 10px;
        font-weight: 500;
}

/* ─── ترنزیشن نرم‌تر برای های‌لایت مکالمه ─── */
.gksoft-chat-free-msg-reaction {
        transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.gksoft-chat-free-msg-reaction:hover {
        box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ─── حباب کارشناس: افکت hover روی حباب سفید (سمت بازدیدکننده) ─── */
.gksoft-chat-free-msg-visitor .gksoft-chat-free-msg-bubble:hover {
        background: #ebedf0;
}

/* ─── حباب کارشناس: افکت hover روی حباب نارنجی ─── */
.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-bubble:hover {
        filter: brightness(1.03);
}

/* ════════════════════════════════════════════════════════════════ */
/*  v3.22.0 قاصدک گارد — رمزنگاری مکالمات (سمت بازدیدکننده)          */
/* ════════════════════════════════════════════════════════════════ */

/* ── مودال ورود کد قاصدک گارد ── */
.gksoft-chat-free-guard-modal {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        backdrop-filter: blur(4px);
}

.gksoft-chat-free-guard-modal-content {
        background: #fff;
        border-radius: 12px;
        max-width: 360px;
        width: 100%;
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        animation: gksoft-free-guard-modal-in 0.2s ease-out;
}

@keyframes gksoft-free-guard-modal-in {
        from { opacity: 0; transform: scale(0.95); }
        to   { opacity: 1; transform: scale(1); }
}

.gksoft-chat-free-guard-modal-header {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px 20px;
        background: linear-gradient(135deg, #e8740c 0%, #f59e0b 100%);
        color: #fff;
}

.gksoft-chat-free-guard-modal-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        font-size: 15px;
}

.gksoft-chat-free-guard-modal-body {
        padding: 20px;
}

.gksoft-chat-free-guard-modal-desc {
        margin: 0 0 14px 0;
        color: #374151;
        font-size: 13px;
        line-height: 1.7;
        text-align: center;
}

.gksoft-chat-free-guard-modal-body input[type="password"] {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        font-size: 14px;
        font-family: inherit;
        box-sizing: border-box;
        text-align: center;
        transition: border-color 0.15s;
}

.gksoft-chat-free-guard-modal-body input[type="password"]:focus {
        outline: none;
        border-color: #e8740c;
        box-shadow: 0 0 0 3px rgba(232, 116, 12, 0.1);
}

.gksoft-chat-free-guard-modal-error {
        margin-top: 12px;
        padding: 8px 12px;
        background: #fee2e2;
        border: 1px solid #fca5a5;
        border-radius: 6px;
        color: #991b1b;
        font-size: 12px;
        text-align: center;
}

.gksoft-chat-free-guard-modal-footer {
        padding: 14px 20px;
        background: #f9fafb;
        display: flex;
        justify-content: center;
}

.gksoft-chat-free-guard-submit {
        background: linear-gradient(135deg, #e8740c 0%, #f59e0b 100%);
        color: #fff;
        border: none;
        padding: 10px 24px;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
}

.gksoft-chat-free-guard-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(232, 116, 12, 0.3);
}

.gksoft-chat-free-guard-submit:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
}

/* ── نشانگرهای بصری: سپر پس‌زمینه ── */
.gksoft-chat-free-chat-panel.gksoft-guard-active .gksoft-chat-free-messages::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 220px;
        height: 220px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322c55e'%3E%3Cpath d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        opacity: 0.06;
        pointer-events: none;
        z-index: 0;
}

.gksoft-chat-free-chat-panel.gksoft-guard-active .gksoft-chat-free-messages {
        position: relative;
}

.gksoft-chat-free-chat-panel.gksoft-guard-active .gksoft-chat-free-messages > * {
        position: relative;
        z-index: 1;
}

/* ── کادر نئونی سبز ضربان‌دار ── */
.gksoft-chat-free-chat-panel.gksoft-guard-active .gksoft-chat-free-messages {
        box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.7), inset 0 0 16px rgba(34, 197, 94, 0.3);
        animation: gksoft-free-guard-pulse 2s ease-in-out infinite;
}

@keyframes gksoft-free-guard-pulse {
        0%, 100% {
                box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 0.7), inset 0 0 16px rgba(34, 197, 94, 0.3);
        }
        50% {
                box-shadow: inset 0 0 0 2px rgba(34, 197, 94, 1), inset 0 0 24px rgba(34, 197, 94, 0.5);
        }
}

/* ── آیکون سپر سبز در هدر ویجت (فقط موقع فعال بودن گارد) ── */
.gksoft-chat-free-guard-shield {
        display: none !important;
        color: #22c55e;
        width: 18px;
        height: 18px;
        cursor: help;
        align-items: center;
        justify-content: center;
        animation: gksoft-free-shield-pulse 2s ease-in-out infinite;
}

.gksoft-chat-free-chat-panel.gksoft-guard-active .gksoft-chat-free-guard-shield,
.gksoft-chat-free-chat-panel.gksoft-guard-unlocked .gksoft-chat-free-guard-shield {
        display: inline-flex !important;
}

/* ── سپر قاصدک گارد روی بندانگشتی رسانه ── */
.gksoft-guard-active .gksoft-chat-free-msg-image-wrapper::before,
.gksoft-guard-active .gksoft-chat-free-msg-video-wrapper::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 10px;
        width: 20px;
        height: 20px;
        background: #fff;
        border: 1.5px solid #16a34a;
        border-radius: 4px;
        z-index: 2;
        pointer-events: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%2316a34a' d='M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 13px 13px;
}

/* حباب اطلاع‌رسانی سپر (هاور) */
.gksoft-guard-active .gksoft-chat-free-msg-video-wrapper {
        overflow: visible;
}

.gksoft-guard-active .gksoft-chat-free-msg-image-wrapper::after,
.gksoft-guard-active .gksoft-chat-free-msg-video-wrapper::after {
        content: '🛡️ این محتوا تحت حفاظت چندلایه «قاصدک گارد» قرار دارد و برای حفظ امنیت و محرمانگی اطلاعات محافظت می‌شود.';
        position: absolute;
        top: 34px;
        left: 10px;
        max-width: 220px;
        padding: 8px 12px;
        background: #fff;
        border: 1px solid #16a34a;
        border-radius: 8px;
        font-size: 11px;
        line-height: 1.6;
        color: #374151;
        z-index: 3;
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s, visibility 0.2s;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gksoft-guard-active .gksoft-chat-free-msg-image-wrapper:hover::after,
.gksoft-guard-active .gksoft-chat-free-msg-video-wrapper:hover::after {
        opacity: 1;
        visibility: visible;
}

@keyframes gksoft-free-shield-pulse {
        0%, 100% {
                opacity: 1;
                filter: drop-shadow(0 0 2px rgba(34, 197, 94, 0.4));
        }
        50% {
                opacity: 0.7;
                filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.8));
        }
}

/* ─ـ پیام سیستمی قاصدک گارد (متمایز) ── */
.gksoft-chat-free-msg-system {
        text-align: center;
        font-size: 11px;
        color: #22c55e;
        margin: 12px auto;
        padding: 8px 16px;
        background: linear-gradient(90deg, rgba(34, 197, 94, 0.05), rgba(34, 197, 94, 0.12), rgba(34, 197, 94, 0.05));
        border-radius: 8px;
        max-width: 85%;
        line-height: 1.8;
        white-space: pre-line;
}

.gksoft-chat-free-msg-system:first-line {
        font-weight: 700;
        font-size: 12px;
}

/* ════════════════════════════════════════════════════════════════ */
/*  v3.24.4 — ریپلای سفید داخل حباب نارنجی                           */
/* ════════════════════════════════════════════════════════════════ */

/* ─── ریپلای داخل حباب نارنجی کارشناس (سمت بازدیدکننده) — متن سفید ─── */
.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-reply-preview {
        background: rgba(255, 255, 255, 0.12);
        color: rgba(255, 255, 255, 0.9);
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-reply-preview .gksoft-chat-free-msg-reply-content {
        color: rgba(255, 255, 255, 0.85);
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-reply-bar {
        background: rgba(255, 255, 255, 0.6);
}

.gksoft-chat-free-msg-agent .gksoft-chat-free-msg-reply-preview:hover {
        background: rgba(255, 255, 255, 0.18);
}

/* ════════════════════════════════════════════════════════════════ */
/*  v3.24.5 — wrapper اسکرول + dropdown اندازه فونت                   */
/* ════════════════════════════════════════════════════════════════ */

/* ─── v3.24.6: wrapper حذف شد — دکمه اسکرول مستقیم در chat-panel قرار گرفت ─── */

/* ─── dropdown اندازه فونت (سمت بازدیدکننده) ─── */
.gksoft-chat-free-font-size-toggle {
        position: relative;
}

.gksoft-chat-free-font-size-trigger {
        background: rgba(255,255,255,0.15);
        border: 1.5px solid rgba(255,255,255,0.35);
        color: #fff;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: Vazirmatn, Tahoma, Arial, sans-serif;
        font-weight: 700;
        font-size: 13px;
        transition: all 0.2s;
        padding: 0;
        line-height: 1;
}

.gksoft-chat-free-font-size-trigger:hover {
        background: rgba(255,255,255,0.25);
}

.gksoft-chat-free-font-size-dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        margin-top: 4px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.15);
        padding: 4px;
        flex-direction: column;
        gap: 2px;
        z-index: 100;
        min-width: 44px;
}

.gksoft-chat-free-font-size-dropdown.open {
        display: flex;
}

.gksoft-chat-free-font-size-opt {
        background: none;
        border: none;
        color: #374151;
        width: 36px;
        height: 32px;
        border-radius: 6px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-family: Vazirmatn, Tahoma, Arial, sans-serif;
        font-weight: 700;
        transition: background 0.15s;
        padding: 0;
        line-height: 1;
}

.gksoft-chat-free-font-size-opt:hover {
        background: #f3f4f6;
}

.gksoft-chat-free-font-size-opt.active {
        background: #fff7ed;
        color: #ea580c;
}

/* ─── v3.24.35: سوایپ ریپلای (Swipe to Reply) ─── */
.gksoft-chat-free-msg {
        transition: transform 0.2s ease, background 0.2s ease;
}
.gksoft-chat-free-msg.swipe-active {
        transition: none;
}
