/* ====================================
   RTL CSS for Arabic Language Support
   ==================================== */


/* Import Cairo Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* General RTL */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif;
}

/* Typography */
body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3,
body[dir="rtl"] h4,
body[dir="rtl"] h5,
body[dir="rtl"] h6 {
    text-align: right;
}

/* Flex Direction */
body[dir="rtl"] .d-flex,
body[dir="rtl"] .header-main,
body[dir="rtl"] .footer-wrapper,
body[dir="rtl"] .breadcrumb-items {
    flex-direction: row-reverse;
}

/* Margins */
body[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
body[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
body[dir="rtl"] .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
body[dir="rtl"] .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
body[dir="rtl"] .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
body[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
body[dir="rtl"] .mr-7 { margin-left: 7px; margin-right: 0; }
body[dir="rtl"] .mr-44 { margin-left: 44px; margin-right: 0; }
body[dir="rtl"] .ml-50 { margin-right: 50px; margin-left: 0; }

/* Paddings */
body[dir="rtl"] .ps-lg-5 { padding-right: 0 !important; padding-left: 3rem !important; }
body[dir="rtl"] .pe-lg-5 { padding-left: 0 !important; padding-right: 3rem !important; }

/* Text Alignment */
body[dir="rtl"] .text-left { text-align: right !important; }
body[dir="rtl"] .text-right { text-align: left !important; }
body[dir="rtl"] .text-center { text-align: center !important; }

/* Icons & SVG */
body[dir="rtl"] svg.flip,
body[dir="rtl"] .arrow-icon {
    transform: scaleX(-1);
}

body[dir="rtl"] i.flip {
    transform: scaleX(-1);
    display: inline-block;
}

/* Header */
body[dir="rtl"] .header-main .main-menu ul li {
    margin-inline-end: 0;
    margin-inline-start: 55px;
}

body[dir="rtl"] .header-main .main-menu ul li:first-child {
    margin-inline-start: 0;
}

body[dir="rtl"] .header-main .main-menu ul li a i {
    margin-left: 0;
    margin-right: 7px;
}

body[dir="rtl"] .header-main .main-menu ul li .submenu {
    inset-inline-start: auto;
    inset-inline-end: 0;
}

body[dir="rtl"] .header-main .main-menu ul li .submenu li .submenu {
    inset-inline-start: auto;
    inset-inline-end: 100%;
}

body[dir="rtl"] .header-right {
    flex-direction: row-reverse;
}

body[dir="rtl"] .sidebar__toggle {
    margin-left: 0;
    margin-right: 30px;
}

/* Offcanvas */
body[dir="rtl"] .offcanvas__info {
    right: auto;
    left: 0;
    border-left: none;
    border-right: 2px solid var(--theme);
    transform: translateX(calc(-100% - 80px));
}

body[dir="rtl"] .offcanvas__info.info-open {
    transform: translateX(0);
}

body[dir="rtl"] .offcanvas__wrapper .offcanvas__content .offcanvas__contact ul li .offcanvas__contact-icon {
    margin-right: 0;
    margin-left: 20px;
}

/* Intro Section */
body[dir="rtl"] .intro-wrapper.style1 .intro-content .intro-section-title .intro-subtitle img {
    margin-left: 0;
    margin-right: 10px;
}

body[dir="rtl"] .intro-wrapper.style1 .intro-thumb .thumbShape1 {
    right: auto;
    left: 0;
}

body[dir="rtl"] .intro-wrapper.style1 .intro-thumb .thumbShape2 {
    right: auto;
    left: 40px;
}

/* About Section */
body[dir="rtl"] .about-wrapper.style1 .about-thumb .bg {
    right: auto;
    left: 0;
}

body[dir="rtl"] .about-wrapper.style1 .about-thumb .thumbShape1 {
    left: auto;
    right: -100px;
}

body[dir="rtl"] .about-wrapper.style1 .about-thumb .thumbShape2 {
    right: auto;
    left: -20px;
}

body[dir="rtl"] .about-wrapper.style1 .about-thumb .absolute-thumb {
    left: auto;
    right: -10px;
}

/* WCU Section */
body[dir="rtl"] .fancy-box.style2 {
    flex-direction: row-reverse;
}

body[dir="rtl"] .fancy-box.style2 .icon {
    margin-right: 0;
    margin-left: 19px;
}

/* Counter */
body[dir="rtl"] .counter-box.style1 .shape {
    left: auto;
    right: 0;
}

/* Screenshots */
body[dir="rtl"] .screenshot-wrapper {
    text-align: center;
}

/* Footer */
body[dir="rtl"] .footer-widgets-wrapper.style1 .single-footer-widget .widget-head h3::before {
    left: auto;
    right: 0;
}

body[dir="rtl"] .footer-widgets-wrapper.style1 .single-footer-widget .widget-head h3::after {
    left: auto;
    right: 40px;
}

body[dir="rtl"] .footer-widgets-wrapper.style1 .single-footer-widget .footer-content .store-links .apple a svg,
body[dir="rtl"] .footer-widgets-wrapper.style1 .single-footer-widget .footer-content .store-links .play a svg {
    margin-right: 0;
    margin-left: 5px;
}

body[dir="rtl"] .footer-bottom.style1 .footer-wrapper .social-links {
    flex-direction: row-reverse;
}

/* Contact Section */
body[dir="rtl"] .contact-info-box.style1 .contact-content .icon {
    margin-left: 0;
    margin-right: 20px;
}

body[dir="rtl"] .contact-form.style1 .contact-form-items .form-clt input,
body[dir="rtl"] .contact-form.style1 .contact-form-items .form-clt textarea {
    text-align: right;
}

/* Breadcrumb */
body[dir="rtl"] .breadcrumb-wrapper .page-heading .breadcrumb-items {
    flex-direction: row-reverse;
}

body[dir="rtl"] .breadcrumb-wrapper .page-heading .breadcrumb-items li i {
    transform: scaleX(-1);
}

/* Buttons */
body[dir="rtl"] .theme-btn i,
body[dir="rtl"] .theme-btn svg {
    margin-left: 0;
    margin-right: 6px;
}

body[dir="rtl"] .theme-btn svg {
    transform: scaleX(-1);
}

/* Forms */
body[dir="rtl"] input,
body[dir="rtl"] textarea,
body[dir="rtl"] select {
    text-align: right;
}

body[dir="rtl"] .form-group > i {
    right: auto;
    left: 25px;
}

body[dir="rtl"] input[type="checkbox"] ~ label {
    padding-left: 0;
    padding-right: 30px;
}

body[dir="rtl"] input[type="checkbox"] ~ label:before {
    left: auto;
    right: 0;
}

body[dir="rtl"] input[type="checkbox"] ~ label:after {
    left: auto;
    right: 6px;
}

body[dir="rtl"] input[type="radio"] ~ label {
    padding-left: 0;
    padding-right: 30px;
}

body[dir="rtl"] input[type="radio"] ~ label::before {
    left: auto;
    right: 0;
}

/* Social Links */
body[dir="rtl"] .social-links {
    flex-direction: row-reverse;
}

body[dir="rtl"] .social-media {
    flex-direction: row-reverse;
}

/* Checklist */
body[dir="rtl"] .checklist.style1 li img {
    margin-right: 0;
    margin-left: 10px;
}

/* Fancy Box */
body[dir="rtl"] .fancy-box-wrapper.style1 {
    flex-direction: row-reverse;
}

body[dir="rtl"] .fancy-box.style1 {
    flex-direction: row-reverse;
}

/* CTA Section */
body[dir="rtl"] .cta-wrapper.style1 .cta-content .playstore {
    margin-right: 0;
    margin-left: 20px;
}

/* Sidebar */
body[dir="rtl"] .sidebar__toggle {
    margin-left: 0;
    margin-right: 30px;
}

/* Search */
body[dir="rtl"] .search-close {
    right: auto;
    left: 50px;
}

/* Navigation */
body[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

/* Pagination */
body[dir="rtl"] .page-nav-wrap ul {
    direction: rtl;
}

/* Slider Arrows */
body[dir="rtl"] .slider-arrow.style1 {
    transform: scaleX(-1);
}

/* Profile Meta */
body[dir="rtl"] .profile-meta {
    flex-direction: row-reverse;
}

/* Counter Box Wrapper */
body[dir="rtl"] .counter-box-wrapper.style3 {
    flex-direction: row-reverse;
}

/* Recent Post */
body[dir="rtl"] .recent-post .media-img {
    margin-right: 0;
    margin-left: 20px;
}

/* Feature Box */
body[dir="rtl"] .feature-box-items {
    flex-direction: row-reverse;
}

/* Technology Box */
body[dir="rtl"] .technology-box-items.style-4 {
    text-align: center;
}

/* Shapes - No flip needed */
body[dir="rtl"] .shape1,
body[dir="rtl"] .shape2,
body[dir="rtl"] .shape3,
body[dir="rtl"] .shape4,
body[dir="rtl"] .shape5 {
    /* Keep shapes in same position */
}

/* Lists */
body[dir="rtl"] ul,
body[dir="rtl"] ol {
    padding-right: 0;
    padding-left: 0;
}

/* Justify Content */
body[dir="rtl"] .justify-content-between {
    flex-direction: row-reverse;
}

body[dir="rtl"] .justify-content-start {
    justify-content: flex-end;
}

body[dir="rtl"] .justify-content-end {
    justify-content: flex-start;
}

/* Float */
body[dir="rtl"] .float-left {
    float: right !important;
}

body[dir="rtl"] .float-right {
    float: left !important;
}

/* Border Radius - Keep as is */
body[dir="rtl"] .border-radius {
    /* No changes needed */
}

/* Animations - Keep as is */
body[dir="rtl"] .cir36,
body[dir="rtl"] .float-bob-y,
body[dir="rtl"] .spin {
    /* Animations work same in RTL */
}

/* Responsive Adjustments */
@media (max-width: 1199px) {
    body[dir="rtl"] .header-main .main-menu ul li {
        margin-inline-start: 25px;
    }
}

@media (max-width: 991px) {
    body[dir="rtl"] .header-main .main-menu ul li {
        margin-inline-start: 15px;
    }
}

@media (max-width: 767px) {
    body[dir="rtl"] .btn-wrapper {
        flex-direction: column;
    }
    
    body[dir="rtl"] .fancy-box-wrapper.style1 {
        flex-direction: column;
    }
}

/* Additional specific fixes */
body[dir="rtl"] .testimonial-card.style1 .testimonial-header {
    flex-direction: row-reverse;
}

body[dir="rtl"] .wcu-content .fancy-box {
    flex-direction: row-reverse;
}

body[dir="rtl"] .contact-info-items {
    flex-direction: row-reverse;
}

body[dir="rtl"] .intro-wrapper.style1 .intro-content .btn-wrapper {
    flex-direction: row-reverse;
}

/* Ensure center alignment stays center */
body[dir="rtl"] .text-center,
body[dir="rtl"] .mx-auto {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}