/* ========================================
   فونت‌های فارسی و انگلیسی مشترک
   ======================================== */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX-Bold.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX-Black.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto';
    src: url('../fonts/noto-sans-v42-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto';
    src: url('../fonts/noto-sans-v42-latin-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Noto';
    src: url('../fonts/noto-sans-v42-latin-700.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body { font-family: 'Noto', -apple-system, sans-serif; }

.fa-body, .fa-body * {
    font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.fa-body .info-note, .fa-body .status-pill, .fa-body .form-type-badge,
.fa-body .header-brand-name, .fa-body .header-brand-byline, .fa-body footer,
.fa-body .accordion-content, .fa-body .stream-item-text, .fa-body .analysis-item p,
.fa-body .progress-item, .fa-body table, .fa-body select, .fa-body button,
.fa-body input, .fa-body h1, .fa-body h2, .fa-body h3, .fa-body label, .lang-fa {
    font-family: 'IRANYekanX', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.fr-body, .fr-body * { font-family: 'Noto', sans-serif; }

/* --- دکمه بازگشت شناور مدرن --- */
.floating-back-btn {
    position: fixed; top: 50%; z-index: 1000;
    width: 48px; height: 48px; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #475569; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease; cursor: pointer; text-decoration: none;
    left: 24px; right: auto;
}
.floating-back-btn:hover {
    background: #ffffff; color: #0b2b83; /* تم آبی ارزیابی */
    transform: translateY(-50%) scale(1.1); 
    box-shadow: 0 8px 25px rgba(11, 43, 131, 0.25);
}
[dir="rtl"] .floating-back-btn { left: auto; right: 24px; }
[dir="rtl"] .floating-back-btn svg { transform: rotate(180deg); }
@media (max-width: 768px) {
    .floating-back-btn { width: 40px; height: 40px; left: 16px; }
    [dir="rtl"] .floating-back-btn { right: 16px; left: auto; }
}

/* --- Floating Action Button (FAB) --- */
.global-fab {
    position: fixed; bottom: 24px; width: 56px; height: 56px;
    background: #0b2b83; /* تم آبی */
    color: white; border-radius: 50%;
    box-shadow: 0 6px 20px rgba(11, 43, 131, 0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; cursor: pointer; z-index: 9999;
    transition: transform 0.3s ease, background 0.3s;
    right: 20px; left: auto;
}
html[lang="fa"] .global-fab { left: 20px; right: auto; }
.global-fab:hover { transform: scale(1.1); background: #081d5a; }
.global-fab.open { background: #081d5a; box-shadow: 0 6px 24px rgba(11, 43, 131, 0.6); }

.fab-menu {
    position: absolute; bottom: 70px; right: 0;
    display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
    opacity: 0; pointer-events: none; transform: translateY(10px);
    transition: all 0.3s ease; max-width: calc(100vw - 40px); white-space: nowrap;
}
.global-fab.open .fab-menu { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fab-item {
    display: flex; align-items: center; padding: 10px 18px;
    background: white; border-radius: 28px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1); color: #111827;
    text-decoration: none; font-size: 14px; font-weight: 600; transition: 0.2s;
}
.fab-item:hover { background: #f9fafb; transform: translateX(-4px); }
html[lang="fa"] .fab-menu { align-items: flex-start; right: auto; left: 0; }
html[lang="fa"] .fab-item:hover { transform: translateX(4px); }

/* --- AI Loader & Result --- */
.ai-loading { padding: 20px; text-align: center; color: #0b2b83; font-weight: 600; }
#ai-result-box { padding: 15px; border: 1px dashed #c7d2fe; max-height: 400px; overflow-y: auto; }
#ai-result-box strong { color: #0b2b83; }