/* RTL Support for Arabic Language */

/* Base RTL adjustments */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] body,
[dir="rtl"] .rtl {
    direction: rtl;
}

/* Navigation adjustments */
[dir="rtl"] .navbar {
    direction: rtl;
}

[dir="rtl"] .navbar-nav {
    margin-right: 0;
    margin-left: auto;
}

[dir="rtl"] .navbar-brand {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
    right: auto;
    left: 0;
}

[dir="rtl"] .nav-link {
    text-align: right;
}

/* Text alignment utilities */
[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Margin and padding utilities */
[dir="rtl"] .ms-1, [dir="rtl"] .ms-2, [dir="rtl"] .ms-3, [dir="rtl"] .ms-4, [dir="rtl"] .ms-5 {
    margin-left: 0 !important;
}

[dir="rtl"] .me-1, [dir="rtl"] .me-2, [dir="rtl"] .me-3, [dir="rtl"] .me-4, [dir="rtl"] .me-5 {
    margin-right: 0 !important;
}

[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-right: 1rem !important; }
[dir="rtl"] .ms-4 { margin-right: 1.5rem !important; }
[dir="rtl"] .ms-5 { margin-right: 3rem !important; }

[dir="rtl"] .me-1 { margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-left: 0.5rem !important; }
[dir="rtl"] .me-3 { margin-left: 1rem !important; }
[dir="rtl"] .me-4 { margin-left: 1.5rem !important; }
[dir="rtl"] .me-5 { margin-left: 3rem !important; }

[dir="rtl"] .ps-1, [dir="rtl"] .ps-2, [dir="rtl"] .ps-3, [dir="rtl"] .ps-4, [dir="rtl"] .ps-5 {
    padding-left: 0 !important;
}

[dir="rtl"] .pe-1, [dir="rtl"] .pe-2, [dir="rtl"] .pe-3, [dir="rtl"] .pe-4, [dir="rtl"] .pe-5 {
    padding-right: 0 !important;
}

[dir="rtl"] .ps-1 { padding-right: 0.25rem !important; }
[dir="rtl"] .ps-2 { padding-right: 0.5rem !important; }
[dir="rtl"] .ps-3 { padding-right: 1rem !important; }
[dir="rtl"] .ps-4 { padding-right: 1.5rem !important; }
[dir="rtl"] .ps-5 { padding-right: 3rem !important; }

[dir="rtl"] .pe-1 { padding-left: 0.25rem !important; }
[dir="rtl"] .pe-2 { padding-left: 0.5rem !important; }
[dir="rtl"] .pe-3 { padding-left: 1rem !important; }
[dir="rtl"] .pe-4 { padding-left: 1.5rem !important; }
[dir="rtl"] .pe-5 { padding-left: 3rem !important; }

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

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

/* Border utilities */
[dir="rtl"] .border-start {
    border-right: 1px solid #dee2e6 !important;
    border-left: 0 !important;
}

[dir="rtl"] .border-end {
    border-left: 1px solid #dee2e6 !important;
    border-right: 0 !important;
}

/* Cards and containers */
[dir="rtl"] .card {
    text-align: right;
}

[dir="rtl"] .list-group-item {
    text-align: right;
}

/* Forms */
[dir="rtl"] .form-label {
    text-align: right;
}

[dir="rtl"] .form-control,
[dir="rtl"] .form-select {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="number"] {
    direction: ltr;
    text-align: right;
}

/* Buttons with icons */
[dir="rtl"] .btn i:first-child,
[dir="rtl"] .btn svg:first-child {
    margin-left: 0.5rem;
    margin-right: 0;
}

[dir="rtl"] .btn i:last-child,
[dir="rtl"] .btn svg:last-child {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Progress bars */
[dir="rtl"] .progress {
    direction: ltr;
}

/* Breadcrumbs */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* Carousel */
[dir="rtl"] .carousel-control-prev {
    right: 0;
    left: auto;
}

[dir="rtl"] .carousel-control-next {
    left: 0;
    right: auto;
}

[dir="rtl"] .carousel-control-prev-icon {
    transform: scaleX(-1);
}

[dir="rtl"] .carousel-control-next-icon {
    transform: scaleX(-1);
}

/* Modal */
[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Alerts */
[dir="rtl"] .alert-dismissible .btn-close {
    left: 0;
    right: auto;
}

/* Pagination */
[dir="rtl"] .pagination {
    direction: ltr;
}

/* Tables */
[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

/* Timeline or process steps */
[dir="rtl"] .timeline {
    direction: rtl;
}

[dir="rtl"] .timeline-item {
    text-align: right;
}

/* Social icons */
[dir="rtl"] .social-links {
    direction: ltr;
}

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

/* Feature cards */
[dir="rtl"] .feature-card {
    text-align: right;
}

[dir="rtl"] .feature-card .icon {
    float: right;
    margin-left: 1rem;
    margin-right: 0;
}

/* Stats counters */
[dir="rtl"] .stat-item {
    text-align: center;
}

/* Team cards */
[dir="rtl"] .team-member {
    text-align: center;
}

/* Contact form */
[dir="rtl"] .contact-form {
    text-align: right;
}

/* Footer */
[dir="rtl"] footer {
    text-align: right;
}

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

/* Language switcher dropdown */
[dir="rtl"] .language-switcher .dropdown-menu {
    right: auto;
    left: 0;
}

/* Accordion */
[dir="rtl"] .accordion-button::after {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .accordion-button:not(.collapsed)::after {
    transform: rotate(180deg);
}

/* Tooltips */
[dir="rtl"] .tooltip {
    text-align: right;
}

/* Offcanvas */
[dir="rtl"] .offcanvas-start {
    right: 0;
    left: auto;
}

[dir="rtl"] .offcanvas-end {
    left: 0;
    right: auto;
}

/* Custom scrollbar for RTL */
[dir="rtl"] ::-webkit-scrollbar {
    position: absolute;
    left: 0;
    right: auto;
}

/* Arabic font adjustments */
[dir="rtl"][lang="ar"] {
    font-family: 'Segoe UI', 'Tahoma', 'Noto Sans Arabic', 'Arial', sans-serif;
    font-size: 1.05em;
    line-height: 1.8;
}

[dir="rtl"][lang="ar"] h1,
[dir="rtl"][lang="ar"] h2,
[dir="rtl"][lang="ar"] h3,
[dir="rtl"][lang="ar"] h4,
[dir="rtl"][lang="ar"] h5,
[dir="rtl"][lang="ar"] h6 {
    font-family: 'Segoe UI', 'Tahoma', 'Noto Sans Arabic', 'Arial', sans-serif;
    font-weight: 600;
}

/* Specific Vortex website adjustments */
[dir="rtl"] .vortex-logo {
    transform: scaleX(1); /* Keep logo orientation */
}

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

[dir="rtl"] .methodology-step {
    text-align: right;
}

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

[dir="rtl"] .success-case {
    text-align: right;
}

/* Animation adjustments for RTL */
[dir="rtl"] [data-aos="fade-left"] {
    animation-name: fadeRight;
}

[dir="rtl"] [data-aos="fade-right"] {
    animation-name: fadeLeft;
}

[dir="rtl"] [data-aos="slide-left"] {
    animation-name: slideRight;
}

[dir="rtl"] [data-aos="slide-right"] {
    animation-name: slideLeft;
}

@keyframes fadeRight {
    from {
        opacity: 0;
        transform: translate3d(100px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translate3d(-100px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideRight {
    from {
        transform: translate3d(100%, 0, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes slideLeft {
    from {
        transform: translate3d(-100%, 0, 0);
    }
    to {
        transform: translate3d(0, 0, 0);
    }
}