/* ============================================
   RTL (RIGHT-TO-LEFT) STYLES FOR ARABIC
   ============================================ */

/* Import Google Fonts for Arabic */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Tajawal:wght@400;500;700&display=swap');

/* RTL Body - Enhanced Arabic Typography */
body.rtl {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    letter-spacing: 0;
}

/* Better Arabic Font Rendering */
.rtl * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RTL Typography - Improved Spacing */
.rtl h1 {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    word-spacing: 2px;
}

.rtl h2 {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
}

.rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0;
}

.rtl p {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    line-height: 1.8;
    letter-spacing: 0;
    word-spacing: 1px;
}

/* RTL Header & Navigation - IMPROVED */
.rtl .nav-container {
    flex-direction: row-reverse;
}

/* Mobile Header RTL Adjustment */
@media (max-width: 968px) {
    .rtl .nav-container {
        flex-direction: row-reverse !important;
        justify-content: space-between;
    }
    
    .rtl .mobile-menu-toggle {
        order: 1; /* Menu icon on left */
    }
    
    .rtl .logo {
        order: 2; /* Logo on right */
    }
}

.rtl .nav-links ul {
    flex-direction: row-reverse;
    gap: 25px;
}

.rtl .nav-links li {
    margin: 0;
}

.rtl .logo {
    margin-right: 0;
    margin-left: auto;
}

/* Fix logo text direction - keep English order */
.rtl .logo a {
    direction: ltr;
    unicode-bidi: embed;
}

/* Better navigation spacing */
.rtl .nav-links a {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    padding: 8px 15px;
}

/* Language toggle in header */
.rtl .lang-toggle {
    margin-right: 10px;
    margin-left: 0;
}

/* Get Quote button in header */
.rtl .nav-links .btn {
    margin-right: 0;
    margin-left: 10px;
}

/* RTL Hero Section - Better Spacing */
.rtl .hero-content {
    text-align: right;
}

/* CRITICAL: Flip hero image to left side in RTL */
.rtl .hero-img {
    right: auto;
    left: 5%;
}

/* Better text contrast and readability */
.rtl .hero h1 {
    font-size: 3rem;
    line-height: 1.3;
    margin-bottom: 25px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    max-width: 550px;
}

.rtl .hero p {
    line-height: 1.9;
    margin-bottom: 30px;
    max-width: 500px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
    font-size: 1.05rem;
}

.rtl .hero-btns {
    flex-direction: row-reverse;
    gap: 15px;
}

.rtl .hero-btns .btn {
    padding: 14px 32px;
    font-size: 1rem;
}

/* RTL Service Cards - Improved Layout + OVERFLOW FIX */
.rtl .services-grid {
    direction: rtl;
}

.rtl .service-card {
    text-align: right;
    padding: 30px 25px;
    box-sizing: border-box;
    overflow: hidden;
    max-width: 100%;
}

.rtl .service-card h3 {
    margin-top: 20px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.rtl .service-card p {
    line-height: 1.8;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.rtl .read-more {
    flex-direction: row-reverse;
    gap: 8px;
}

/* Ensure service icons stay in place */
.rtl .service-icon {
    margin: 0 auto 20px auto;
}

/* Fix for any card-based layouts */
.rtl .card,
.rtl .value-card,
.rtl .feature-card {
    text-align: right;
    padding: 25px 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.rtl .card h3,
.rtl .card h4,
.rtl .value-card h3,
.rtl .feature-card h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    margin-bottom: 15px;
}

.rtl .card p,
.rtl .value-card p,
.rtl .feature-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.8;
}

/* RTL About Section - FIXED OVERFLOW */
.rtl .about-wrapper {
    flex-direction: row-reverse;
}

.rtl .about-text {
    text-align: right;
    padding-right: 20px;
    padding-left: 50px;
    max-width: 100%;
    overflow: hidden;
}

.rtl .about-text h2 {
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.rtl .about-text p {
    line-height: 1.9;
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.rtl .exp-badge {
    right: auto;
    left: 30px;
}

.rtl .exp-badge .text {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

/* RTL Promise Box - PREVENT OVERFLOW */
.rtl .promise-box {
    text-align: right;
    margin-top: 30px !important;
    margin-bottom: 20px;
    padding: 20px !important;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.rtl .promise-box h3 {
    font-family: 'Cairo', sans-serif;
    margin-bottom: 15px;
    font-size: 1.2rem;
    word-wrap: break-word;
}

.rtl .promise-box p {
    line-height: 1.9;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* RTL About Button - KEEP INSIDE */
.rtl .about-text .btn {
    margin-top: 20px;
    display: inline-block;
    max-width: 100%;
}

/* RTL FAQ - Better Alignment */
.rtl .faq-question {
    flex-direction: row-reverse;
    text-align: right;
}

.rtl .faq-question h3 {
    text-align: right;
    padding-right: 0;
    padding-left: 20px;
    line-height: 1.6;
}

.rtl .faq-answer {
    text-align: right;
    padding-right: 60px;
    padding-left: 20px;
}

.rtl .faq-answer p {
    line-height: 1.9;
}

.rtl .faq-icon {
    margin-left: 0;
    margin-right: auto;
}

/* RTL Trust Badges */
.rtl .badges-carousel {
    animation: scroll-badges-rtl 30s linear infinite;
}

@keyframes scroll-badges-rtl {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(50%);
    }
}

.rtl .badge-card {
    text-align: center;
}

.rtl .badge-card h4 {
    font-family: 'Cairo', sans-serif;
    margin-top: 15px;
}

/* RTL Footer */
.rtl .footer-grid {
    direction: rtl;
}

.rtl .footer-col {
    text-align: right;
}

.rtl .footer-col h3 {
    font-family: 'Cairo', sans-serif;
    margin-bottom: 20px;
}

.rtl .footer-col ul li {
    text-align: right;
}

.rtl .footer-col ul li i {
    margin-right: 0;
    margin-left: 10px;
}

/* RTL Back to Top Button */
.rtl .back-to-top {
    right: auto;
    left: 35px;
}

/* RTL Form Elements */
.rtl input,
.rtl textarea,
.rtl select {
    text-align: right;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
    padding-right: 20px;
    padding-left: 45px;
}

.rtl .validation-icon {
    right: auto;
    left: 15px;
}

.rtl label {
    text-align: right;
    font-family: 'Tajawal', sans-serif;
}

/* RTL Buttons */
.rtl .btn {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

/* RTL Language Toggle */
.rtl .lang-toggle {
    flex-direction: row-reverse;
}

.rtl .lang-text {
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
}

/* Smooth transition for language change */
[data-i18n] {
    transition: opacity 0.15s ease;
}

/* RTL Section Titles */
.rtl .section-title {
    text-align: right;
}

.rtl .section-title h2 {
    margin-bottom: 15px;
}

.rtl .section-title p {
    line-height: 1.8;
}

.rtl .section-tag {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 1px;
}

/* RTL Spacing Adjustments */
.rtl .service-grid,
.rtl .values-grid {
    direction: rtl;
}

/* RTL Process Timeline */
.rtl .timeline-step {
    flex-direction: row-reverse;
}

.rtl .step-card.left {
    text-align: left;
}

.rtl .step-card.right {
    text-align: right;
}

/* RTL Recruitment List */
.rtl .recruitment-list li {
    flex-direction: row-reverse;
    text-align: right;
}

.rtl .recruitment-list li i {
    margin-right: 0;
    margin-left: 15px;
}

.rtl .recruitment-list li:hover {
    transform: translateX(-10px) scale(1.02);
}

/* RTL Animations - Keep smooth */
.rtl .service-card:hover {
    transform: translateY(-8px) scale(1.02);
}

.rtl .value-card:hover {
    transform: translateY(-15px) scale(1.03);
}

/* Mobile RTL Adjustments */
@media (max-width: 768px) {
    .rtl .hero h1 {
        font-size: 2rem;
        line-height: 1.4;
    }
    
    .rtl .about-text {
        padding-left: 0;
        padding-right: 0;
    }
    
    .rtl .faq-answer {
        padding-right: 20px;
        padding-left: 20px;
    }

    .rtl .back-to-top {
        left: 22px;
    }
}

/* Improve Arabic Number Display */
.rtl .exp-badge .num {
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
}

