/* RTL Support for Arabic Language */
[dir="rtl"] body {
    text-align: right;
    direction: rtl;
}

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

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

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

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

[dir="rtl"] .mr-auto,
[dir="rtl"] .mx-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .ml-auto,
[dir="rtl"] .mx-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Padding adjustments */
[dir="rtl"] .pr-3 {
    padding-right: 0 !important;
    padding-left: 1rem !important;
}

[dir="rtl"] .pl-3 {
    padding-left: 0 !important;
    padding-right: 1rem !important;
}

/* Border radius for RTL */
[dir="rtl"] .rounded-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}

[dir="rtl"] .rounded-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}

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

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

/* Navigation */
[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

[dir="rtl"] .navbar-nav .nav-link {
    padding-right: 0;
    padding-left: 0.5rem;
}

/* Forms */
[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.25em;
}

[dir="rtl"] .form-check-input {
    float: right;
    margin-left: 0.5em;
    margin-right: -1.25em;
}

/* List items */
[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 2rem;
}

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

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

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

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

/* Alerts */
[dir="rtl"] .alert-dismissible {
    padding-left: 3rem;
    padding-right: 1rem;
}

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

/* Card */
[dir="rtl"] .card-body {
    text-align: right;
}

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

[dir="rtl"] .table th:first-child,
[dir="rtl"] .table td:first-child {
    padding-left: 0.75rem;
}

/* Sidebar */
[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

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

/* Pagination */
[dir="rtl"] .pagination {
    padding-right: 0;
}

/* Select2 RTL Support */
[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    left: 1px;
    right: auto;
}

[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 8px;
    padding-right: 20px;
}

/* Custom Scrollbar for RTL */
[dir="rtl"] ::-webkit-scrollbar {
    width: 10px;
}

[dir="rtl"] ::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

[dir="rtl"] ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hero Section - Flip the banner image and reorder columns in Arabic */
[dir="rtl"] .wsus__banner_3 {
    display: flex;
    flex-direction: column;
}

[dir="rtl"] .wsus__banner_3 > div:first-child {
    display: flex;
    flex-direction: row-reverse;
}

[dir="rtl"] .wsus__banner_3_img .img img {
    transform: scaleX(-1);
}

/* About Section - Flip images for RTL */
[dir="rtl"] .wsus__about_area_img {
    transform: scaleX(-1);
}

[dir="rtl"] .wsus__about_area_img img {
    transform: scaleX(-1);
}

[dir="rtl"] .wsus__about_area_img .about_img_text {
    transform: scaleX(-1);
}

/* Course Section Images */
[dir="rtl"] .wsus__course_item_img img {
    /* Don't flip course thumbnails - keep them normal */
}

/* Instructor Images */
[dir="rtl"] .wsus__instructor_single_img img {
    /* Don't flip instructor photos - keep them normal */
}

/* Testimonial Images */
[dir="rtl"] .wsus__testimonial_img img {
    /* Don't flip testimonial photos - keep them normal */
}

/* General decorative images that should flip */
[dir="rtl"] .decorative-image {
    transform: scaleX(-1);
}

/* Video Section Images */
[dir="rtl"] .wsus__video_area_img {
    transform: scaleX(-1);
}

[dir="rtl"] .wsus__banner_3_img .text {
    left: auto !important;
    right: -155px !important;
    padding: 15px 70px 15px 20px !important;
}

/* Marquee for brands */
[dir="rtl"] .marquee_animi {
    direction: ltr;
}

[dir="rtl"] .marquee_animi ul {
    direction: ltr;
}

/* Quality Courses Section RTL */
[dir="rtl"] .quality_course_slider .row.align-items-center > div:nth-child(1) {
    order: 1;
}

[dir="rtl"] .quality_course_slider .row.align-items-center > div:nth-child(2) {
    order: 3;
}

[dir="rtl"] .quality_course_slider .row.align-items-center > div:nth-child(3) {
    order: 2;
}

/* Book icons RTL */
[dir="rtl"] .home_3 .wsus__section_heading h5::after,
[dir="rtl"] .wsus__become_instructor .wsus__section_heading h5::after,
[dir="rtl"] .wsus__banner_3_text h5::after,
[dir="rtl"] .wsus__features_3 .wsus__section_heading h5::after,
[dir="rtl"] .wsus__about_3_text .wsus__section_heading h5::after {
    left: auto;
    right: auto;
    display: none;
}

[dir="rtl"] .wsus__section_heading h5 {
    padding-right: 0 !important;
}

/* Hero Section RTL */
[dir="rtl"] .wsus__banner_3::after {
    right: auto !important;
    left: 0 !important;
    transform: scaleX(-1);
    width: 1000px !important;
}

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

[dir="rtl"] .wsus__banner_3 .row.justify-content-between {
    width: 100% !important;
}

[dir="rtl"] .wsus__banner_3 .row.justify-content-between > div:nth-child(1) {
    order: 1;
}

[dir="rtl"] .wsus__banner_3 .row.justify-content-between > div:nth-child(2) {
    order: 2;
}

/* Hero buttons RTL */
[dir="rtl"] .wsus__banner_2_btn_area {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

[dir="rtl"] .wsus__banner_2_btn_area .common_btn {
    margin-left: 20px !important;
    margin-right: 0 !important;
}

[dir="rtl"] .wsus__banner_2_btn_area .play_btn_area {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

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

/* Hero Features Icons RTL */
[dir="rtl"] .wsus__banner_features {
    flex-direction: row !important;
}

[dir="rtl"] .wsus__banner_features li {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
}

[dir="rtl"] .wsus__banner_features li .icon {
    margin-left: 15px;
    margin-right: 0;
    flex-shrink: 0;
}

[dir="rtl"] .wsus__banner_features li .text {
    text-align: right;
    width: auto !important;
    flex: 1;
}

/* Hero banner main image flip in RTL - الصورة الرئيسية في البانر */
[dir="rtl"] .wsus__banner_3_img .img > img.img-fluid {
    transform: scaleX(-1) !important;
}

/* Keep text box normal */
[dir="rtl"] .wsus__banner_3_img .text * {
    transform: scaleX(1);
}

