/**
 * ============================================================================
 * RTL Perfect - Comprehensive & Professional Right-to-Left Styling
 * Applied automatically when dir="rtl" (Arabic & Urdu locales)
 * ============================================================================
 */

[dir="rtl"],
html[dir="rtl"] body {
    direction: rtl !important;
    text-align: right !important;
}

/* 1. Global Typography & Headings in RTL */
[dir="rtl"] h1:not(.text-center):not(.hero-title), 
[dir="rtl"] h2:not(.text-center), 
[dir="rtl"] h3:not(.text-center), 
[dir="rtl"] h4:not(.text-center), 
[dir="rtl"] h5:not(.text-center), 
[dir="rtl"] h6:not(.text-center),
[dir="rtl"] .title:not(.text-center), 
[dir="rtl"] .sec-main-title:not(.text-center), 
[dir="rtl"] p:not(.text-center):not(.hero-desc), 
[dir="rtl"] span:not(.text-center), 
[dir="rtl"] li:not(.text-center), 
[dir="rtl"] label:not(.text-center) {
    text-align: right;
}

/* Explicit Centering in RTL */
[dir="rtl"] .text-center,
[dir="rtl"] .text-center h1,
[dir="rtl"] .text-center h2,
[dir="rtl"] .text-center h3,
[dir="rtl"] .text-center h4,
[dir="rtl"] .text-center h5,
[dir="rtl"] .text-center h6,
[dir="rtl"] .text-center p,
[dir="rtl"] .text-center span,
[dir="rtl"] .page-inner-hero-banner,
[dir="rtl"] .page-inner-hero-banner .hero-container,
[dir="rtl"] .page-inner-hero-banner .hero-title,
[dir="rtl"] .page-inner-hero-banner .hero-desc,
[dir="rtl"] .page-inner-hero-banner .banner-pills-wrap,
[dir="rtl"] .banner-section .banner-content,
[dir="rtl"] .banner-section .hero-title,
[dir="rtl"] .banner-section .hero-desc {
    text-align: center !important;
}

[dir="rtl"] .page-inner-hero-banner .hero-desc,
[dir="rtl"] .banner-section .hero-desc {
    margin-left: auto !important;
    margin-right: auto !important;
}

[dir="rtl"] .page-inner-hero-banner .banner-pills-wrap {
    justify-content: center !important;
}

/* 2. Section Titles & Subtitle Dash */
[dir="rtl"] .sec-title-wrap {
    text-align: right !important;
}

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

/* In RTL, the decorative subtitle dash */
[dir="rtl"] .sec-subtitle-dash {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: right !important;
}

[dir="rtl"] .sec-subtitle-dash::after {
    margin-left: 0 !important;
    margin-right: 6px !important;
}

/* 3. Directional Arrows (Forward arrows point LEFT in RTL, Backward arrows point RIGHT in RTL) */
[dir="rtl"] .fa-arrow-right::before { content: "\f060" !important; } /* fa-arrow-left */
[dir="rtl"] .fa-chevron-right::before { content: "\f053" !important; } /* fa-chevron-left */
[dir="rtl"] .fa-angle-right::before { content: "\f104" !important; } /* fa-angle-left */
[dir="rtl"] .fa-arrow-circle-right::before { content: "\f0a8" !important; } /* fa-arrow-circle-left */
[dir="rtl"] .fa-long-arrow-alt-right::before { content: "\f30a" !important; } /* fa-long-arrow-alt-left */

[dir="rtl"] .fa-arrow-left::before { content: "\f061" !important; } /* fa-arrow-right */
[dir="rtl"] .fa-chevron-left::before { content: "\f054" !important; } /* fa-chevron-right */
[dir="rtl"] .fa-angle-left::before { content: "\f105" !important; } /* fa-angle-right */
[dir="rtl"] .fa-arrow-circle-left::before { content: "\f0a9" !important; } /* fa-arrow-right */
[dir="rtl"] .fa-long-arrow-alt-left::before { content: "\f30b" !important; } /* fa-long-arrow-alt-right */

/* Pagination pill font inheritance in RTL */
[dir="rtl"] .custom-pills-pagination .pill-btn,
[dir="rtl"] .custom-pills-pagination .pagination-pill-btn {
    font-family: inherit !important;
}

/* Font Awesome Font-Family Protection Across RTL */
.fa, .fas, .far {
    font-family: "Font Awesome 5 Free" !important;
}
.fab {
    font-family: "Font Awesome 5 Brands" !important;
}

/* Breadcrumb separator arrow flip */
[dir="rtl"] .breadcrumb__list li:not(:last-child)::after {
    transform: rotate(180deg) !important;
    display: inline-block !important;
}

/* 4. Luxury Buttons (Theme Buttons) in RTL */
[dir="rtl"] .btn-theme,
[dir="rtl"] .theme-btn,
[dir="rtl"] .hero-btn-primary,
[dir="rtl"] .btn-theme-outline,
[dir="rtl"] .btn-theme-light {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    padding: 6px 20px 6px 6px !important; /* 20px on text side (right), 6px on icon side (left) */
    gap: 12px !important;
    box-sizing: border-box !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

[dir="rtl"] .btn-theme.btn-sm,
[dir="rtl"] .btn-theme-sm,
[dir="rtl"] .btn-theme-outline.btn-sm,
[dir="rtl"] .btn-theme-outline-sm {
    padding: 5px 16px 5px 5px !important;
    gap: 8px !important;
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
}

[dir="rtl"] .btn-theme i,
[dir="rtl"] .btn-theme .btn-icon,
[dir="rtl"] .theme-btn i,
[dir="rtl"] .btn-theme-outline i,
[dir="rtl"] .btn-theme-outline .btn-icon,
[dir="rtl"] .btn-theme-light i,
[dir="rtl"] .btn-theme-light .btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    border-radius: 0.7em !important;
    background: rgba(11, 90, 62, 0.12) !important;
    color: var(--primary-color, #0B5A3E) !important;
    font-size: 13px !important;
    line-height: 1 !important;
    margin: 0 !important;
    transform: none !important;
    flex-shrink: 0 !important;
    align-self: center !important;
    box-sizing: border-box !important;
    transition: all 0.25s ease !important;
}

[dir="rtl"] .btn-theme.btn-sm i,
[dir="rtl"] .btn-theme-outline.btn-sm i {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    font-size: 11px !important;
}

[dir="rtl"] .btn-theme:hover i,
[dir="rtl"] .btn-theme:hover .btn-icon,
[dir="rtl"] .btn-theme-outline:hover i,
[dir="rtl"] .btn-theme-outline:hover .btn-icon,
[dir="rtl"] .btn-theme-light:hover i,
[dir="rtl"] .btn-theme-light:hover .btn-icon {
    transform: translateX(-3px) !important; /* Slides forward (to the left) on hover */
}

/* 5. Header Action Buttons */
[dir="rtl"] .btn-talk-experts {
    flex-direction: row !important;
    padding: 5px 14px 5px 6px !important;
}

[dir="rtl"] .btn-talk-experts .talk-text-group {
    text-align: right !important;
    align-items: flex-start !important;
}

[dir="rtl"] .btn-talk-experts .talk-sub-label {
    font-size: 11px !important;
    letter-spacing: 0 !important;
    font-weight: 600 !important;
    text-align: right !important;
}

[dir="rtl"] .btn-talk-experts .talk-main-label {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    text-align: right !important;
    line-height: 1.3 !important;
}

[dir="rtl"] .btn-talk-experts:hover .talk-arrow-btn {
    transform: translateX(-3px) scale(1.05) !important;
    background: linear-gradient(135deg, #063927 0%, #0B5A3E 100%) !important;
}

/* Language switcher dropdown: keep flag left, text middle, chevron right */
[dir="rtl"] .btn-lang-switcher {
    direction: ltr !important;
    display: inline-flex !important;
    flex-direction: row !important;
}

[dir="rtl"] .btn-lang-switcher .lang-flag-img { order: 1 !important; }
[dir="rtl"] .btn-lang-switcher .lang-code { order: 2 !important; }
[dir="rtl"] .btn-lang-switcher .lang-chevron { 
    order: 3 !important; 
    transform: none !important; /* Keep chevron pointing down */
}
[dir="rtl"] .btn-lang-switcher.show .lang-chevron,
[dir="rtl"] .show > .btn-lang-switcher .lang-chevron {
    transform: rotate(180deg) !important;
}

/* 6. About Section in RTL (Image 3) */
[dir="rtl"] .home-about-list {
    padding-right: 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
}

[dir="rtl"] .home-about-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: right !important;
    gap: 12px !important;
}

[dir="rtl"] .home-about-item-icon {
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
}

[dir="rtl"] .home-about-item-icon i {
    transform: scaleX(-1) !important;
}

[dir="rtl"] .home-about-item:hover .home-about-item-icon {
    transform: translateX(-3px) !important;
}

[dir="rtl"] .home-about-floating-badge {
    left: auto !important;
    right: -20px !important;
    flex-direction: row !important;
    text-align: right !important;
}

[dir="rtl"] .home-about-floating-badge-text {
    text-align: right !important;
}

@media (max-width: 575.98px) {
    [dir="rtl"] .home-about-floating-badge {
        right: 10px !important;
        left: auto !important;
    }
}

/* 7. Vision / Key Goals Section in RTL (Image 2) */
[dir="rtl"] .vision-content-left {
    text-align: right !important;
}

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

[dir="rtl"] .vision-quote-callout {
    border-left: 1px solid #F1E4D2 !important;
    border-right: 4px solid #0B5A3E !important;
    text-align: right !important;
    flex-direction: row !important;
    gap: 14px !important;
}

[dir="rtl"] .vision-quote-callout i {
    transform: scaleX(-1) !important;
    margin-left: 2px !important;
    margin-right: 0 !important;
}

[dir="rtl"] .vision-quote-callout p {
    text-align: right !important;
}

[dir="rtl"] .vision-feature-card {
    text-align: right !important;
    flex-direction: row !important;
}

[dir="rtl"] .vision-feature-card::after {
    left: auto !important;
    right: 0 !important;
}

[dir="rtl"] .vision-card-title,
[dir="rtl"] .vision-card-desc,
[dir="rtl"] .vision-card-body {
    text-align: right !important;
}

/* 8. Events & Conferences Section in RTL (Image 1) */
/* Slider arrows mirroring in RTL */
[dir="rtl"] .events-slider-prev {
    right: -24px !important;
    left: auto !important;
}

[dir="rtl"] .events-slider-prev i {
    transform: none !important;
}
[dir="rtl"] .events-slider-prev i::before {
    content: "\f054" !important; /* fa-chevron-right (points right = backward in RTL) */
}

[dir="rtl"] .events-slider-next {
    left: -24px !important;
    right: auto !important;
}

[dir="rtl"] .events-slider-next i {
    transform: none !important;
}
[dir="rtl"] .events-slider-next i::before {
    content: "\f053" !important; /* fa-chevron-left (points left = forward in RTL) */
}

@media (max-width: 991px) {
    [dir="rtl"] .events-slider-prev { right: -10px !important; left: auto !important; }
    [dir="rtl"] .events-slider-next { left: -10px !important; right: auto !important; }
}

@media (max-width: 767px) {
    [dir="rtl"] .events-slider-prev { right: -4px !important; left: auto !important; }
    [dir="rtl"] .events-slider-next { left: -4px !important; right: auto !important; }
}

/* Event Card Badges & Layout */
[dir="rtl"] .event-card-lux__date {
    right: 12px !important;
    left: auto !important;
    text-align: center !important;
}

[dir="rtl"] .event-card-lux__status {
    right: 14px !important;
    left: auto !important;
}

[dir="rtl"] .event-live-dot {
    margin-left: 4px !important;
    margin-right: 0 !important;
}

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

[dir="rtl"] .event-card-lux__meta {
    justify-content: flex-start !important;
    text-align: right !important;
}

[dir="rtl"] .event-meta-location {
    flex-direction: row !important;
}

[dir="rtl"] .event-meta-location i {
    margin-left: 4px !important;
    margin-right: 0 !important;
}

[dir="rtl"] .event-card-lux__title,
[dir="rtl"] .event-card-lux__desc {
    text-align: right !important;
}

/* Event Card Footer Link in RTL */
[dir="rtl"] .event-card-lux__link,
[dir="rtl"] .event-card-lux__btn {
    padding: 0 !important;
    background: transparent !important;
    flex-direction: row !important;
}

[dir="rtl"] .event-card-lux__link i,
[dir="rtl"] .event-card-lux__btn i,
[dir="rtl"] .event-card-lux__btn-icon i {
    transform: scaleX(-1) !important; /* Points left */
}

[dir="rtl"] .event-card-lux:hover .event-card-lux__link i,
[dir="rtl"] .event-card-lux__link:hover i,
[dir="rtl"] .event-card-lux:hover .event-card-lux__btn i,
[dir="rtl"] .event-card-lux__btn:hover i {
    transform: scaleX(-1) translateX(-4px) !important;
}

/* 9. Blog Cards (.blog-card-lux) in RTL */
[dir="rtl"] .blog-card-lux__badge {
    right: 12px !important;
    left: auto !important;
}

[dir="rtl"] .blog-card-lux__body,
[dir="rtl"] .blog-card-lux__title {
    text-align: right !important;
}

[dir="rtl"] .blog-card-lux__author {
    flex-direction: row !important;
}

[dir="rtl"] .blog-card-lux__avatar {
    margin-left: 10px !important;
    margin-right: 0 !important;
}

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

[dir="rtl"] .blog-card-lux__footer {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: space-between !important;
    align-items: center !important;
}

[dir="rtl"] .blog-card-lux__date {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-align: right !important;
    direction: rtl !important;
}

[dir="rtl"] .blog-card-lux__date i {
    margin: 0 !important;
}

[dir="rtl"] .blog-card-lux__btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 16px !important;
}

[dir="rtl"] .blog-card-lux__btn i {
    margin: 0 !important;
    transform: none !important;
}

[dir="rtl"] .blog-card-lux__btn:hover i {
    transform: translateX(-3px) !important;
}

/* 10. Book Cards (.book-card-lux) in RTL */
[dir="rtl"] .book-card-lux {
    text-align: right !important;
}

[dir="rtl"] .book-card-lux__content,
[dir="rtl"] .book-card-lux__title,
[dir="rtl"] .book-card-lux__desc,
[dir="rtl"] .book-card-lux__meta {
    text-align: right !important;
}

[dir="rtl"] .book-card-lux__badge {
    right: 12px !important;
    left: auto !important;
}

/* 11. Testimonials in RTL */
[dir="rtl"] .testimonial-card-lux {
    text-align: right !important;
}

[dir="rtl"] .testimonial-card-lux__author {
    flex-direction: row !important;
}

[dir="rtl"] .testimonial-card-lux__avatar {
    margin-left: 12px !important;
    margin-right: 0 !important;
}

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

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

[dir="rtl"] .testimonial-card-lux__quote-icon {
    right: 20px !important;
    left: auto !important;
    transform: scaleX(-1) !important;
}

/* 12. Accordions / FAQ in RTL */
[dir="rtl"] .accordion-button {
    text-align: right !important;
}

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

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

/* 13. Mobile Drawer Menu in RTL */
[dir="rtl"] .tgmobile__menu-box {
    left: auto !important;
    right: 0 !important;
    transform: translateX(101%) !important;
    text-align: right !important;
}

[dir="rtl"] body.mobile-menu-visible .tgmobile__menu-box {
    transform: translateX(0) !important;
}

[dir="rtl"] .tgmobile__menu-box .close-btn {
    right: auto !important;
    left: 20px !important;
}

[dir="rtl"] .tgmobile__menu-outer .navigation li a {
    text-align: right !important;
}

[dir="rtl"] .tgmobile__menu-outer .navigation li .dropdown-btn {
    left: 0 !important;
    right: auto !important;
}

/* 14. Footer Widgets in RTL */
[dir="rtl"] .footer-bg-luxury .fw-title {
    text-align: right !important;
}

[dir="rtl"] .footer-bg-luxury .fw-title::after {
    left: auto !important;
    right: 0 !important;
}

[dir="rtl"] .footer-widgets,
[dir="rtl"] .footer-content,
[dir="rtl"] .footer-link,
[dir="rtl"] .footer-contact {
    text-align: right !important;
}

[dir="rtl"] .footer-bg-luxury .footer-link ul li a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-align: right !important;
    direction: rtl !important;
}

[dir="rtl"] .footer-bg-luxury .footer-link ul li a i {
    margin: 0 !important;
    transform: none !important;
}

[dir="rtl"] .footer-bg-luxury .footer-link ul li a:hover {
    transform: translateX(-4px) !important;
}

[dir="rtl"] .footer-contact ul li {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    text-align: right !important;
}

[dir="rtl"] .footer-contact-icon {
    margin-left: 10px !important;
    margin-right: 0 !important;
    flex-shrink: 0 !important;
}

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

[dir="rtl"] .footer-contact-link,
[dir="rtl"] .footer-contact-link bdi {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    display: inline-block !important;
    text-align: right !important;
}

/* 15. Form Inputs in RTL */
[dir="rtl"] .form-control,
[dir="rtl"] .form-select,
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] textarea {
    text-align: right !important;
    direction: rtl !important;
}

[dir="rtl"] .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: -1px !important;
    margin-left: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 8px !important;
    border-bottom-left-radius: 8px !important;
}

/* 16. Bootstrap Utility Overrides for RTL */
[dir="rtl"] .text-start {
    text-align: right !important;
}

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

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

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

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

[dir="rtl"] .ms-1, [dir="rtl"] .ms-2, [dir="rtl"] .ms-3, [dir="rtl"] .ms-4 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

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

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

/* 17. Navigation Sub-menu in RTL */
[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu,
body[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu {
    left: auto !important;
    right: 0 !important;
    text-align: right !important;
}

[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li > a,
body[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li > a {
    text-align: right !important;
    font-size: 14.5px !important;
    line-height: 1.6 !important;
}

[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li > a:hover,
[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li.active > a,
body[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li > a:hover,
body[dir="rtl"] .tgmenu__navbar-wrap > ul.navigation > li .sub-menu > li.active > a {
    padding-left: 16px !important;
    padding-right: 20px !important;
}

/* 18. Institutions & Institution Detail Pages in RTL */
[dir="rtl"] .institution-card-lux__badge-floating {
    left: auto !important;
    right: 12px !important;
}

[dir="rtl"] .institution-card-lux__title,
[dir="rtl"] .institution-card-lux__desc {
    text-align: right !important;
}

[dir="rtl"] .institution-article,
[dir="rtl"] .institution-article p,
[dir="rtl"] .institution-article h1,
[dir="rtl"] .institution-article h2,
[dir="rtl"] .institution-article h3,
[dir="rtl"] .institution-article h4,
[dir="rtl"] .institution-article h5,
[dir="rtl"] .institution-article h6,
[dir="rtl"] .institution-article li,
[dir="rtl"] .institution-article figcaption {
    text-align: right !important;
}

[dir="rtl"] .badge-accent {
    margin-right: 0 !important;
    margin-left: 0.75rem !important;
}

[dir="rtl"] .program-card-item ul li i,
[dir="rtl"] .institution-article ul li i {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .institution-article .table th,
[dir="rtl"] .institution-article .table td {
    text-align: right !important;
}

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

[dir="rtl"] .sidebar-sticky-wrapper h5,
[dir="rtl"] .sidebar-sticky-wrapper strong,
[dir="rtl"] .sidebar-sticky-wrapper span,
[dir="rtl"] .sidebar-sticky-wrapper p {
    text-align: right !important;
}

[dir="rtl"] .sidebar-sticky-wrapper ul li i {
    margin-right: 0 !important;
    margin-left: 0.75rem !important;
}

[dir="rtl"] .sidebar-sticky-wrapper .list-group-item {
    text-align: right !important;
}

[dir="rtl"] .sidebar-sticky-wrapper .list-group-item .fa-chevron-right::before {
    content: "\f053" !important;
}
