/* ============================================================
   Farasync Demo — استایل صفحه دمو
   استایل‌های مخصوص دمو + کلاس‌های کمکی که در CSS اصلی پلاگین نیستن
   ============================================================ */

/* ===== نوار بالای صفحه دمو ===== */
.farasync-demo-surface .farasync-demo-banner {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #5b21b6 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    margin: 16px auto 12px !important;
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    font-size: 13px;
    max-width: 1260px;
    box-sizing: border-box;
    border: none !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15) !important;
}

/* اطمینان از اینکه surface هیچ خط اضافی به هدر سایت اضافه نکند */
.farasync-demo-surface {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.farasync-demo-surface .farasync-demo-banner::before,
.farasync-demo-surface .farasync-demo-banner::after {
    display: none !important;
    content: none !important;
}

.farasync-demo-banner .farasync-demo-banner-left {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.farasync-demo-banner .demo-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
}

.farasync-demo-banner .demo-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
}

.farasync-demo-banner .demo-btn.demo-btn-primary {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.farasync-demo-banner .demo-btn.demo-btn-primary:hover {
    background: #16a34a;
}

/* ===== تب‌های ناوبری دمو ===== */
.farasync-demo-nav-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-sizing: border-box;
}

.farasync-demo-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.farasync-demo-nav-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.farasync-demo-nav-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 52%, #7c3aed 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.farasync-demo-nav-tab .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===== تب‌های بالای صفحه (مبدأ/مقصد) ===== */
.farasync-demo-mode-tabs {
    display: flex;
    gap: 4px;
    background: #fff;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    margin: 0 0 16px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    font-family: 'Vazirmatn', -apple-system, sans-serif;
}

.farasync-demo-mode-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    font-family: inherit;
}

.farasync-demo-mode-tab:hover {
    background: #eef2ff;
    color: #1e3a8a;
    text-decoration: none;
}

.farasync-demo-mode-tab.is-active {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 52%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.3);
}

/* ===== Toast ===== */
.farasync-demo-toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    background: #1d2327;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    display: none;
    align-items: center;
    gap: 10px;
    border-right: 4px solid #2271b1;
    max-width: 420px;
    animation: farasync-demo-slide-in 240ms ease;
}

.farasync-demo-toast.is-visible { display: flex; }
.farasync-demo-toast.toast-success { border-right-color: #00a32a; }
.farasync-demo-toast.toast-warning { border-right-color: #dba617; }
.farasync-demo-toast.toast-error { border-right-color: #d63638; }

@keyframes farasync-demo-slide-in {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== مودال ===== */
.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-overlay{
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-overlay.is-open{ display: flex; }

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal{
    background: #fff;
    border-radius: 4px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-header{
    padding: 14px 20px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f6f7f7;
    border-radius: 4px 4px 0 0;
}

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-header h3{
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-close{
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #646970;
    padding: 4px 8px;
    border-radius: 3px;
}

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-close:hover{ background: #dcdcde; color: #1d2327; }

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-body{ padding: 20px; }

.farasync-demo-surface:has(.farasync-rep-dashboard) .fs-modal-footer{
    padding: 12px 20px;
    border-top: 1px solid #dcdcde;
    display: flex;
    gap: 8px;
    background: #f6f7f7;
    border-radius: 0 0 4px 4px;
}

/* ===== Spinner ===== */
.farasync-demo-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: farasync-demo-spin 0.8s linear infinite;
}

@keyframes farasync-demo-spin { to { transform: rotate(360deg); } }


.farasync-demo-surface { display: flow-root; min-width: 0; background: transparent !important; }
.farasync-demo-surface:has(> .farasync-rep-dashboard) {
    width: 100%;
    max-width: 1260px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}
/* v3.7.0: عرض پنل نماینده مطابق پلاگین اصلی — ۱۲۶۰px */
.farasync-demo-surface .farasync-rep-container {
    max-width: 1260px !important;
    margin: 0 auto !important;
    background: #ffffff !important;
    flex: 1 !important;
}
/* v3.10.0: پس‌زمینه پنل نماینده مطابق source/dest — خاکستری روشن */
.farasync-demo-surface:has(> .farasync-rep-dashboard) .farasync-rep-dashboard {
    background: #f6f7f9 !important;
    max-width: 1260px !important;
    width: 100% !important;
    margin: 0 auto !important;
}
/* بنر دمو در همه صفحات — scoped + اطمینان از جایگاه درست */
.farasync-demo-surface .farasync-demo-banner {
    box-sizing: border-box;
    direction: rtl;
    justify-content: space-between;
    border-radius: 10px;
    max-width: 1260px !important;
    width: 100% !important;
    margin: 0 auto 0 !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}
.farasync-demo-surface .farasync-demo-banner-left { position: static; transform: none; }
.farasync-demo-surface .farasync-demo-nav-tabs { width: auto; margin: 0; flex-wrap: wrap; }
.farasync-tab-panel:not(.is-active) { display: none; }
.farasync-demo-surface [hidden] { display: none !important; }
.farasync-demo-surface .farasync-issues-view:not(.is-active) { display: none; }
@media (max-width: 782px) {
    .farasync-demo-surface .farasync-demo-banner { padding: 10px; gap: 8px; justify-content: center; }
    .farasync-demo-surface .farasync-demo-nav-tabs { width: 100%; }
    .farasync-demo-surface .farasync-demo-nav-tab { flex: 1 1 auto; justify-content: center; padding: 8px; font-size: 12px; }
    .farasync-demo-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
    .fs-modal-overlay { padding: 12px; }
}

.fs-modal-overlay:not(.is-open) { display: none; }
.fs-modal-overlay.is-open { display: flex; }

/* Keep both header controls in one corner row at tablet and phone widths. */
@media (max-width: 1100px) {
    .farasync-demo-surface .farasync-command-center .farasync-header-actions {
        position: absolute !important;
        top: 12px !important;
        inset-inline-end: 12px !important;
        width: auto !important;
        display: flex !important;
        flex-flow: row nowrap !important;
        align-items: center !important;
        gap: 8px !important;
        z-index: 6;
    }
    .farasync-demo-surface .farasync-header-actions .farasync-bell,
    .farasync-demo-surface .farasync-header-actions .farasync-camp-head-icon {
        position: relative !important;
        inset: auto !important;
        margin: 0 !important;
        transform: none !important;
        flex: 0 0 auto;
    }
}
.farasync-demo-surface { margin-block-start: 0 !important; }

/* Equal side tracks keep the three desktop destinations truly centered. */
.farasync-demo-surface .farasync-demo-banner {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 140px;
    gap: 10px;
}
.farasync-demo-surface .farasync-demo-banner-left {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}
.farasync-demo-surface .farasync-demo-nav-tabs {
    grid-column: 2;
    grid-row: 1;
    width: max-content;
    max-width: 100%;
    flex-wrap: nowrap;
    margin: 0 auto;
}
.farasync-demo-surface .farasync-demo-nav-tab { padding: 8px 10px; font-size: 12px; }

/* ===== Custom themed dropdown for mobile/tablet (replaces native <select>) ===== */
.farasync-demo-surface .farasync-demo-nav-dropdown {
    display: none;
    position: relative;
    min-width: 0;
}
.farasync-demo-surface .farasync-demo-nav-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    color: #fff;
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    text-align: right;
}
.farasync-demo-surface .farasync-demo-nav-trigger:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}
.farasync-demo-surface .farasync-demo-nav-trigger .dashicons-menu-alt3 {
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.farasync-demo-surface .farasync-demo-nav-trigger-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.farasync-demo-surface .farasync-demo-nav-caret {
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 200ms ease;
}
.farasync-demo-surface .farasync-demo-nav-dropdown.is-open .farasync-demo-nav-caret {
    transform: rotate(180deg);
}
.farasync-demo-surface .farasync-demo-nav-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #1e1b4b;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    z-index: 50;
    overflow: hidden;
}
.farasync-demo-surface .farasync-demo-nav-menu[hidden] { display: none; }
.farasync-demo-surface .farasync-demo-nav-menu li { margin: 0; }
.farasync-demo-surface .farasync-demo-nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 120ms ease;
}
.farasync-demo-surface .farasync-demo-nav-menu a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.farasync-demo-surface .farasync-demo-nav-menu a.is-active {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 52%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}
.farasync-demo-surface .farasync-demo-nav-menu a .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ===== Tablet (<= 1100px): show custom dropdown, hide desktop tabs ===== */
@media (max-width: 1100px) {
    .farasync-demo-surface .farasync-demo-banner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }
    .farasync-demo-surface .farasync-demo-nav-tabs { display: none; }
    .farasync-demo-surface .farasync-demo-nav-dropdown {
        display: block;
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }
    .farasync-demo-surface .farasync-demo-banner-left {
        grid-column: 2;
        grid-row: 1;
    }
}

/* ===== Mobile (<= 600px): full-width dropdown, full-width buy button ===== */
@media (max-width: 600px) {
    .farasync-demo-surface .farasync-demo-banner {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
    }
    .farasync-demo-surface .farasync-demo-nav-dropdown {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
    }
    .farasync-demo-surface .farasync-demo-banner-left {
        grid-column: 1;
        grid-row: 2;
        justify-self: stretch;
        width: 100%;
    }
    .farasync-demo-surface .farasync-demo-banner-left .demo-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 14px;
        font-size: 13px;
    }
    .farasync-demo-surface .farasync-demo-nav-trigger {
        font-size: 12px;
        padding: 9px 12px;
    }
}

/* ===== Tablet width fix: prevent command center from being too stretched ===== */
@media (max-width: 1100px) and (min-width: 601px) {
    .farasync-demo-surface .farasync-command-center,
    .farasync-demo-surface .farasync-wrap {
        max-width: 960px !important;
        margin: 0 auto !important;
        padding: 16px !important;
    }
}
@media (max-width: 782px) {
    .farasync-demo-surface .farasync-command-center,
    .farasync-demo-surface .farasync-wrap {
        max-width: 100% !important;
        padding: 12px !important;
    }
}

/* Explicit chart geometry prevents theme padding/min-height from inflating
   stacked bars. Every date keeps its original vertical day + month label. */
.farasync-demo-surface #farasync-stats-section .farasync-chart-canvas {
    height: 120px !important;
    box-sizing: border-box;
}
.farasync-demo-surface .farasync-demo-chart-column {
    box-sizing: border-box;
    height: 100px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    justify-content: flex-start;
}
.farasync-demo-surface .farasync-demo-chart-segment {
    box-sizing: border-box;
    min-height: 0;
    flex: 0 0 auto;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
}
.farasync-demo-surface #farasync-stats-section .farasync-chart-axis {
    height: 64px;
    overflow: visible;
}
.farasync-demo-surface #farasync-stats-section .farasync-chart-axis-cell { overflow: visible; }
@media (max-width: 782px) {
    .farasync-demo-surface #farasync-stats-section .farasync-chart-axis { height: 56px; }
}
.farasync-demo-surface .farasync-sm-product-image { object-fit: contain; background: #fff; }
.farasync-demo-surface .farasync-demo-pagination-empty { grid-column: 1 / -1; padding: 24px; text-align: center; }
.farasync-demo-surface .farasync-module-card[data-module="destination"] .farasync-stat-num {
    font-size: clamp(12px, 2vw, 18px) !important;
    white-space: normal;
    overflow-wrap: anywhere;
}
@media (max-width: 782px) {
    .farasync-demo-surface .farasync-command-center .farasync-header-mtitle {
        max-width: calc(100vw - 238px) !important;
        white-space: normal !important;
        line-height: 1.5 !important;
    }
}

/* ============================================================
   v3.8.0 — واترمارک نام کاربری + نوار تایمر شمارش معکوس
   ============================================================ */

/* واترمارک — روی کل صفحه، کمرنگ، قطری، غیرقابل کلیک */
.farasync-demo-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-30deg);
    font-size: 42px;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.07);
    pointer-events: none;
    z-index: 99998;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.6;
    max-width: 90vw;
    word-break: break-word;
}

/* واترمارک‌های اضافی در گوشه‌ها */
.farasync-demo-watermark::before,
.farasync-demo-watermark::after {
    content: attr(data-text);
    display: none;
}

/* نوار تایمر — پایین صفحه، چسبان */
.farasync-demo-countdown-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    color: #fff;
    padding: 10px 20px;
    font-family: 'Vazirmatn', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
    direction: rtl;
    flex-wrap: wrap;
}

.farasync-demo-countdown-bar .farasync-demo-countdown-greeting {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.farasync-demo-countdown-bar .farasync-demo-countdown-timewrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.farasync-demo-countdown-bar .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.farasync-demo-countdown-bar .farasync-demo-countdown-text {
    font-family: 'JetBrains Mono', 'Vazirmatn', monospace;
    font-size: 14px;
    font-weight: 700;
    direction: ltr;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

.farasync-demo-countdown-bar.is-warning {
    background: linear-gradient(135deg, #7c2d12 0%, #b91c1c 100%);
    animation: farasync-demo-pulse-warn 1s infinite;
}

@keyframes farasync-demo-pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.farasync-demo-countdown-bar.is-expired {
    background: linear-gradient(135deg, #7c2d12 0%, #b91c1c 100%);
}

/* پیام دسترسی محدود */
.farasync-demo-access-denied {
    max-width: 500px;
    margin: 40px auto !important;
    direction: rtl;
}

.farasync-demo-access-denied .dashicons {
    display: block;
    margin: 0 auto 12px;
}

.farasync-demo-access-denied h3 {
    margin: 16px 0 8px;
    font-size: 18px;
    font-weight: 700;
    color: #1d2327;
}

.farasync-demo-access-denied p {
    color: #646970;
    font-size: 14px;
    margin: 0;
}

/* روی موبایل واترمارک کوچک‌تر */
@media (max-width: 782px) {
    .farasync-demo-watermark {
        font-size: 28px;
    }
    .farasync-demo-countdown-bar {
        font-size: 11px;
        padding: 8px 10px;
        gap: 10px;
    }
    .farasync-demo-countdown-bar .farasync-demo-countdown-greeting {
        font-size: 11px;
    }
    .farasync-demo-countdown-bar .farasync-demo-countdown-timewrap {
        padding: 3px 8px;
    }
    .farasync-demo-countdown-bar .farasync-demo-countdown-text {
        font-size: 12px;
        min-width: 40px;
    }
}

/* ============================================================
   v3.10.0 — استایل reCAPTCHA badge
   ============================================================ */

/* کوچک‌تر و شفاف‌تر کردن badge پیش‌فرض Google */
.grecaptcha-badge {
    bottom: 70px !important; /* بالای نوار تایمر */
    opacity: 0.55 !important;
    transition: opacity 200ms ease !important;
    transform: scale(0.85) !important;
    transform-origin: bottom right !important;
}
.grecaptcha-badge:hover {
    opacity: 0.9 !important;
}

@media (max-width: 782px) {
    .grecaptcha-badge {
        bottom: 65px !important;
        transform: scale(0.7) !important;
        opacity: 0.45 !important;
    }
    .grecaptcha-badge:hover {
        opacity: 0.85 !important;
    }
}

/* پیام دسترسی محدود — وسط چین عمودی + فوتر در کف */
.farasync-demo-access-denied-wrap {
    box-sizing: border-box;
}
.farasync-demo-access-denied {
    animation: farasync-demo-fade-in 0.3s ease;
}
@keyframes farasync-demo-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
