/* =========================
   RTL Fonts – Arabic Support
   ========================= */

/* Arabic font support for RTL pages */
html[dir="rtl"] body {
    font-family: 'Tajawal', 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: 'Tajawal', 'Cairo', 'Plus Jakarta Sans', sans-serif;
}

/* =========================
   RTL FIX – Step Progress Line
   ========================= */

html[dir="rtl"] .step-progress-bar {
    direction: rtl;
}

/* خط بین مراحل در RTL */
html[dir="rtl"] .step:not(:last-child)::after {
    left: auto;                /* خنثی کردن LTR */
    right: calc(50% + 25px);   /* شروع خط از سمت راست */
}

/* نسخه موبایل */
@media (max-width: 768px) {
    html[dir="rtl"] .step:not(:last-child)::after {
        left: auto;
        right: calc(50% + 20px);
    }
}

@media (max-width: 480px) {
  html[dir="rtl"] .mobile-menu.active {
    transform: translateX(-100%);
  }
  .trust-item {
    padding: 1rem;
  }
}

/* =========================
   RTL Footer Language Switcher
   ========================= */
html[dir="rtl"] .language-switcher i {
    right: auto;
    left: 15px;
}

html[dir="rtl"] .language-select {
    padding-left: 2.5rem;  /* Space for the icon on the left */
    padding-right: 1rem;   /* Normal padding on the right */
}

/* =========================
   RTL Navbar / Logo
   ========================= */
/* Keep English brand readable as NasajTools + icon→text (not ToolsNasaj) */
html[dir="rtl"] .logo-container {
    direction: ltr;
}

html[dir="rtl"] .site-title {
    direction: ltr;
    unicode-bidi: isolate;
}

/* =========================
   RTL Auth/Header Polish
   ========================= */
html[dir="rtl"] .nasaj-auth-container {
    margin-inline-end: 0;
    margin-inline-start: 8px;
}

html[dir="rtl"] .nasaj-user-dropdown {
    right: auto;
    left: 0;
    inset-inline-end: 0;
}

html[dir="rtl"] .nasaj-dropdown-header,
html[dir="rtl"] .nasaj-dropdown-credits,
html[dir="rtl"] .nasaj-dropdown-btn,
html[dir="rtl"] .nasaj-mobile-auth,
html[dir="rtl"] .nasaj-mobile-user-info,
html[dir="rtl"] .nasaj-mobile-credits {
    text-align: right;
}

html[dir="rtl"] .nasaj-dropdown-btn,
html[dir="rtl"] .nasaj-dropdown-credits,
html[dir="rtl"] .nasaj-mobile-credits {
    justify-content: flex-start;
}

html[dir="rtl"] .nasaj-modal-close {
    right: auto;
    left: 16px;
    inset-inline-end: auto;
}

html[dir="rtl"] .nasaj-mobile-user-info {
    flex-direction: row;
    justify-content: flex-start;
}

/* =========================
   RTL Dashboard Polish
   ========================= */
html[dir="rtl"] .dashboard-welcome,
html[dir="rtl"] .stat-card,
html[dir="rtl"] .dash-section,
html[dir="rtl"] .account-info,
html[dir="rtl"] .account-row,
html[dir="rtl"] .usage-tool-name,
html[dir="rtl"] .usage-tool-detail,
html[dir="rtl"] .usage-date {
    text-align: right;
}

html[dir="rtl"] .usage-table th,
html[dir="rtl"] .usage-table td {
    text-align: right;
}

html[dir="rtl"] .dash-actions {
    justify-content: flex-start;
}

/* =========================
   RTL Talk to PDF Polish
   ========================= */
html[dir="rtl"] .talk-to-pdf-page .quick-prompt-btn i {
    margin-right: 0;
    margin-left: 6px;
}

html[dir="rtl"] .talk-to-pdf-page .chat-input {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', 'Cairo', 'Inter', system-ui, -apple-system, sans-serif;
}

html[dir="rtl"] .talk-to-pdf-page .chat-input::placeholder {
    text-align: right;
}

html[dir="rtl"] .talk-to-pdf-page .chat-input-area .cf-turnstile {
    justify-self: start;
    justify-content: flex-start;
}

html[dir="rtl"] .talk-to-pdf-page .analysis-mode-copy,
html[dir="rtl"] .talk-to-pdf-page .analysis-mode-premium-note,
html[dir="rtl"] .talk-to-pdf-page .saved-chats-heading,
html[dir="rtl"] .talk-to-pdf-page .saved-chats-note,
html[dir="rtl"] .talk-to-pdf-page .prompt-suggestion-card-title,
html[dir="rtl"] .talk-to-pdf-page .chat-input-expectation {
    text-align: right;
}
