/* RTL specific styles */
.rtl {
  text-align: right;
  font-family: 'Vazir', 'Roboto', Helvetica, Arial, sans-serif;
}

/* Apply Vazir font to specific elements */
.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6,
.rtl p, .rtl span, .rtl a, .rtl button, .rtl input, 
.rtl textarea, .rtl .navbar-brand, .rtl .nav-link {
  font-family: 'Vazir', 'Roboto', Helvetica, Arial, sans-serif !important;
}

.rtl .navbar-nav {
  padding-right: 0;
}

.rtl .dropdown-menu {
  text-align: right;
}

.rtl .ms-auto {
  margin-right: auto !important;
  margin-left: 0 !important;
}

.rtl .me-auto {
  margin-left: auto !important;
  margin-right: 0 !important;
}

.rtl .ms-3 {
  margin-right: 1rem !important;
  margin-left: 0 !important;
}

.rtl .me-3 {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

.rtl .text-start {
  text-align: right !important;
}

.rtl .text-end {
  text-align: left !important;
}

.rtl .float-start {
  float: right !important;
}

.rtl .float-end {
  float: left !important;
}

/* Fix for language dropdown in RTL mode */
.rtl .dropdown-menu-end {
  right: auto !important;
  left: 0 !important;
}

.rtl .navbar-nav .dropdown-menu {
  position: absolute;
  text-align: right;
}

/* RTL arrow flip for icon-move-right */
.rtl .rtl-flip {
  transform: scaleX(-1);
}

/* material-kit forces `text-align: left !important` on .info-horizontal */
.rtl .info-horizontal,
[dir="rtl"] .info-horizontal {
  text-align: right !important;
}

.rtl .info-horizontal.d-md-flex {
  flex-direction: row-reverse;
}

.rtl .info-horizontal .ps-md-3 {
  padding-right: 1rem !important;
  padding-left: 0 !important;
}

.rtl .icon-move-right i {
  margin-right: 0.75rem !important;
  margin-left: 0 !important;
}

/* Add spacing for material icons in RTL mode */
.rtl .material-icons {
  margin-left: 0.75rem !important;
  margin-right: 0 !important;
}

/* Scroll controls keep LTR icon glyphs and must not inherit icon side-margins */
.rtl .nv-scroll-nav .material-icons,
.rtl .nv-scroll-nav svg {
  margin: 0 !important;
}

/* Ensure proper spacing in info boxes with icons */
.rtl .info-horizontal .material-icons,
.rtl .info-horizontal i {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

/* Fix icon alignment in RTL mode */
.rtl .d-md-flex .material-icons {
  margin-left: 1rem !important;
  margin-right: 0 !important;
}

/* RTL specific styles for info boxes */
.rtl .rtl-box.d-md-flex {
  flex-direction: row-reverse !important;
  text-align: right !important;
}

.rtl .rtl-content {
  text-align: right !important;
}

.rtl .rtl-content p {
  text-align: right !important;
  direction: rtl !important;
}

.rtl .rtl-content .icon-move-right {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.rtl .rtl-content .icon-move-right i {
  transform: scaleX(-1);
  margin-right: 0.25rem !important;
  margin-left: 0 !important;
}

.rtl .ps-md-3 {
  padding-right: 1rem !important;
  padding-left: 0 !important;
}

/* Footer RTL: readable link columns; bottom row flips with direction */
.rtl .footer {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  direction: rtl;
  text-align: right;
}

.rtl .footer .footer-col,
.rtl .footer .footer-brand {
  text-align: right;
}

.rtl .footer .footer-nav {
  align-items: flex-start;
  padding: 0;
  margin: 0;
}

.rtl .footer .footer-nav .nav-link {
  line-height: 1.75;
  padding: 0.2rem 0 !important;
  margin: 0;
  text-align: right;
  display: inline-block;
}

.rtl .footer .footer-brand p {
  max-width: 16rem;
  line-height: 1.9;
  white-space: normal;
  margin-left: auto;
  margin-right: 0;
}

/* Persian: copyright on the right, social icons on the left (under the divider). */
.rtl .footer .footer-bottom {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.rtl .footer .footer-copyright {
  text-align: right;
  direction: rtl;
  order: 0;
}

.rtl .footer .footer-social {
  order: 0;
}

@media (max-width: 768px) {
  .rtl .footer .footer-bottom {
    flex-wrap: wrap;
    row-gap: 0.85rem;
  }

  .rtl .footer .footer-copyright {
    justify-content: flex-start;
  }

  .rtl .footer .footer-social {
    justify-content: flex-end;
  }
}
