/*
RTL Styles for CNJIM Theme
پشتیبانی از زبان فارسی و راست به چپ
*/

/* Base RTL Styles */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Vazir', 'Tahoma', 'Iranian Sans', sans-serif;
}

/* Header RTL */
.rtl .header-content {
    flex-direction: row-reverse;
}

.rtl .main-nav ul {
    flex-direction: row-reverse;
}

.rtl .main-nav a::after {
    right: 0;
    left: auto;
}

.rtl .mobile-menu-toggle {
    order: -1;
}

/* Hero Section RTL */
.rtl .hero-content h1 {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 700;
}

.rtl .hero-content p {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    line-height: 2;
}

/* Content Sections RTL */
.rtl .section-content h2 {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 700;
}

.rtl .section-content p {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    line-height: 2;
    text-align: right;
}

/* Form RTL */
.rtl .form-group input,
.rtl .form-group select {
    text-align: right;
    direction: rtl;
}

.rtl .form-group input::placeholder {
    text-align: right;
}

/* Footer RTL */
.rtl .footer-menu {
    flex-direction: row-reverse;
}

.rtl .social-links {
    direction: ltr; /* Keep social icons LTR */
}

.rtl .site-info {
    text-align: center;
}

/* Back to Top Button RTL */
.rtl .back-to-top {
    right: auto;
    left: 30px;
}

/* Navigation Active States RTL */
.rtl .main-nav a.active::after {
    right: 0;
    left: auto;
}

/* Mobile Menu RTL */
@media (max-width: 768px) {
    .rtl .main-nav {
        text-align: right;
    }
    
    .rtl .main-nav ul {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .rtl .back-to-top {
        left: 20px;
    }
}

/* Typography Improvements for Persian */
.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 700;
}

.rtl p, .rtl span, .rtl div {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    line-height: 1.8;
}

/* Button RTL */
.rtl .cta-button {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 600;
}

/* Contact Info RTL */
.rtl .contact-info {
    text-align: center;
}

.rtl .contact-info p {
    direction: rtl;
}

/* Form Messages RTL */
.rtl .form-message {
    text-align: right;
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

/* Additional RTL Fixes */
.rtl .site-logo {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 700;
}

.rtl .widget-title {
    font-family: 'Vazir', 'Tahoma', sans-serif;
    font-weight: 600;
}

/* Animations RTL */
@keyframes fadeInUpRTL {
    from {
        opacity: 0;
        transform: translateY(30px) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

.rtl .fade-in-up {
    animation: fadeInUpRTL 0.8s ease-out;
}

/* Persian Number Support */
.rtl .persian-numbers {
    font-feature-settings: "ss01" on;
}

/* Improve readability for Persian text */
.rtl {
    word-spacing: 0.1em;
    letter-spacing: 0.02em;
}

/* Fix for mixed content (Persian + English) */
.rtl .mixed-content {
    unicode-bidi: embed;
}

/* Responsive RTL Adjustments */
@media (max-width: 480px) {
    .rtl .hero-content h1 {
        font-size: 1.8rem;
        line-height: 1.4;
    }
    
    .rtl .section-content h2 {
        font-size: 1.6rem;
        line-height: 1.4;
    }
    
    .rtl .hero-content p,
    .rtl .section-content p {
        font-size: 0.95rem;
        line-height: 1.8;
    }
}

/* Loading Animation RTL */
.rtl .cta-button.loading::after {
    right: auto;
    left: 10px;
}

/* Error States RTL */
.rtl .form-group input.error,
.rtl .form-group select.error {
    border-right: 3px solid #e74c3c;
    border-left: 2px solid #ddd;
}

/* Success States RTL */
.rtl .form-message.success {
    border-right: 4px solid #27ae60;
    padding-right: 15px;
}

.rtl .form-message.error {
    border-right: 4px solid #e74c3c;
    padding-right: 15px;
}

