/* RTL (Right-to-Left) Styles for Persian (fa) and Arabic (ar) */

html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Header and Navigation */
html[dir="rtl"] .header-content {
    flex-direction: row-reverse;
}

html[dir="rtl"] nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .language-list {
    flex-direction: row-reverse;
}

html[dir="rtl"] .menu-toggle {
    order: -1;
}

/* Content Sections */
html[dir="rtl"] .features {
    flex-direction: row-reverse;
}

html[dir="rtl"] .feature-card {
    text-align: right;
}

html[dir="rtl"] .section {
    text-align: right;
}

html[dir="rtl"] .section p {
    text-align: right;
}

/* Footer */
html[dir="rtl"] .footer-grid {
    direction: rtl;
}

html[dir="rtl"] .footer-section {
    text-align: right;
}

html[dir="rtl"] .footer-links {
    text-align: right;
    padding-right: 0;
    padding-left: 0;
}

html[dir="rtl"] .footer-disclaimer {
    text-align: right;
}

/* FAQ Section */
html[dir="rtl"] .faq h3 {
    text-align: right;
}

html[dir="rtl"] .faq p {
    text-align: right;
}

/* Knowledge Base Articles */
html[dir="rtl"] .kb-article {
    text-align: right;
}

html[dir="rtl"] .kb-article h3 {
    text-align: right;
}

/* Article Content */
html[dir="rtl"] .article-container {
    text-align: right;
}

html[dir="rtl"] .article-container ol,
html[dir="rtl"] .article-container ul {
    padding-right: 2rem;
    padding-left: 0;
}

html[dir="rtl"] .article-container li {
    text-align: right;
}

/* Hero Section */
html[dir="rtl"] .hero {
    text-align: right;
}

html[dir="rtl"] .hero h1,
html[dir="rtl"] .hero p {
    text-align: center;
}

/* CTA Container */
html[dir="rtl"] .cta-container {
    text-align: center;
}

/* Back Link */
html[dir="rtl"] .back-link {
    float: right;
}

/* Mobile Menu */
@media (max-width: 768px) {
    html[dir="rtl"] nav {
        right: auto;
        left: 0;
        transform: translateX(-100%);
    }

    html[dir="rtl"] nav.active {
        transform: translateX(0);
    }

    html[dir="rtl"] .menu-toggle {
        margin-left: 0;
        margin-right: auto;
    }
}

/* Fix for mixed LTR content in RTL pages */
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .code-block {
    direction: ltr;
    text-align: left;
}

/* Adjust margins and paddings */
html[dir="rtl"] .nav-link {
    margin-left: 0;
    margin-right: 1.5rem;
}

html[dir="rtl"] .nav-link:first-child {
    margin-right: 0;
}

/* Security items in footer */
html[dir="rtl"] .footer-security-item {
    text-align: right;
}

