/* RTL (Right-to-Left) Support for Arabic Language */

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

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

/* Navigation and Header RTL */
html[dir="rtl"] .navbar-nav {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .navbar-nav .nav-item {
  margin-left: 0;
  margin-right: 15px;
}

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

html[dir="rtl"] .navbar-toggler {
  float: right;
  margin-left: 0;
  margin-right: 0;
}

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

html[dir="rtl"] .language-switcher .btn {
  text-align: right;
}

/* Form Elements RTL */
html[dir="rtl"] .form-control {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .form-icon {
  left: 15px;
  right: auto;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
  padding-left: 45px;
  padding-right: 15px;
}

html[dir="rtl"] .form-control:focus + .form-icon {
  left: 15px;
  right: auto;
}

/* Button Alignment RTL */
html[dir="rtl"] .btn {
  text-align: center;
}

html[dir="rtl"] .text-center .btn {
  margin-left: 5px;
  margin-right: 5px;
}

/* Margin and Padding RTL Utilities */
html[dir="rtl"] .me-10px {
  margin-left: 10px !important;
  margin-right: 0 !important;
}

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

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

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

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

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

/* Padding RTL Utilities */
html[dir="rtl"] .ps-25px {
  padding-left: 0 !important;
  padding-right: 25px !important;
}

html[dir="rtl"] .pe-25px {
  padding-left: 25px !important;
  padding-right: 0 !important;
}

html[dir="rtl"] .ps-0 {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

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

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

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

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

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

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

/* Position RTL */
html[dir="rtl"] .left-minus-25px {
  left: auto;
  right: -25px;
}

html[dir="rtl"] .left-minus-300px {
  left: auto;
  right: -300px;
}

/* Icons and Features RTL */
html[dir="rtl"] .icon-with-text .feature-box-icon {
  margin-left: 15px;
  margin-right: 0;
}

html[dir="rtl"] .d-inline-block.icon-small.me-10px {
  margin-left: 10px;
  margin-right: 0;
}

/* Contact Information RTL */
html[dir="rtl"] .contact-info .icon {
  margin-left: 15px;
  margin-right: 0;
}

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

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

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

/* Statistics and Numbers RTL */
html[dir="rtl"] .counter {
  text-align: center;
}

/* Responsive RTL Adjustments */
@media (max-width: 991.98px) {
  html[dir="rtl"] .navbar-nav {
    text-align: right;
  }
  
  html[dir="rtl"] .navbar-collapse {
    text-align: right;
  }
  
  html[dir="rtl"] .mobile-header .navbar-nav .nav-item {
    text-align: right;
  }
}

@media (max-width: 767.98px) {
  html[dir="rtl"] .text-center.text-sm-start {
    text-align: right !important;
  }
  
  html[dir="rtl"] .text-center.text-md-start {
    text-align: right !important;
  }
  
  html[dir="rtl"] .xs-w-100 {
    text-align: right;
  }
}

/* Container and Grid RTL */
html[dir="rtl"] .row {
  direction: rtl;
}

html[dir="rtl"] .col,
html[dir="rtl"] [class*="col-"] {
  direction: rtl;
  text-align: right;
}

/* Override text-center where needed in RTL */
html[dir="rtl"] .text-center h1,
html[dir="rtl"] .text-center h2,
html[dir="rtl"] .text-center h3,
html[dir="rtl"] .text-center h4,
html[dir="rtl"] .text-center h5,
html[dir="rtl"] .text-center h6 {
  text-align: center !important;
}

html[dir="rtl"] .text-center p.text-center {
  text-align: center !important;
}

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

html[dir="rtl"] .dropdown-item {
  text-align: right;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Border Radius RTL for Directional Elements */
html[dir="rtl"] .border-radius-top-lr {
  border-top-left-radius: 0;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 6px;
}

/* Animation and Transform RTL */
html[dir="rtl"] .transform-rotate {
  transform: scaleX(-1);
}

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

html[dir="rtl"] ul li,
html[dir="rtl"] ol li {
  text-align: right;
}

/* Contact Form Specific RTL */
html[dir="rtl"] .contact-form-style-03 .form-control {
  border-left: none;
  border-right: 1px solid #e5e5e5;
  text-align: right;
}

html[dir="rtl"] .contact-form-style-03 .form-icon {
  left: 15px;
  right: auto;
}

/* Arabic Font Adjustments */
html[dir="rtl"] body,
html[dir="rtl"] .form-control,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] button {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* Specific Arabic Typography */
html[lang="ar"] {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  line-height: 1.8;
}

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

html[lang="ar"] .fw-700 {
  font-weight: 600;
}

html[lang="ar"] .fw-600 {
  font-weight: 500;
}