/* ==========================================
   RTL Overrides for Arabic Layout
   Generated automatically for style_css.css
   Safe for global inclusion only when html[dir="rtl"]
   ========================================== */

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

/* Reverse text alignment */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[dir="rtl"] p, [dir="rtl"] span, [dir="rtl"] a, [dir="rtl"] li, [dir="rtl"] label, [dir="rtl"] input, [dir="rtl"] textarea {
  text-align: right !important;
}

/* Logical margins and paddings */
[dir="rtl"] * {
  margin-left: 0 !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: auto !important;
  text-align: right;
}

/* Float and positioning */
[dir="rtl"] .float-left { float: right !important; }
[dir="rtl"] .float-right { float: left !important; }
[dir="rtl"] [style*="float:left"] { float: right !important; }
[dir="rtl"] [style*="float:right"] { float: left !important; }

[dir="rtl"] [style*="left:"] {
  right: auto !important;
  left: auto !important;
}

[dir="rtl"] [style*="right:"] {
  left: auto !important;
  right: auto !important;
}

/* Flex and grid direction corrections */
[dir="rtl"] .d-flex, [dir="rtl"] .flex-row, [dir="rtl"] .row {
  flex-direction: row-reverse !important;
}

[dir="rtl"] .justify-content-start { justify-content: flex-end !important; }
[dir="rtl"] .justify-content-end { justify-content: flex-start !important; }

/* Breadcrumbs, navigation, pagination */
[dir="rtl"] .breadcrumb,
[dir="rtl"] .pagination,
[dir="rtl"] .nav,
[dir="rtl"] .navbar-nav {
  flex-direction: row-reverse !important;
}

/* Swap icons (arrows, chevrons) */
[dir="rtl"] i[class*="arrow"],
[dir="rtl"] i[class*="chevron"],
[dir="rtl"] svg {
  transform: scaleX(-1);
}

/* Form labels and inputs alignment */
[dir="rtl"] label, [dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select {
  text-align: right !important;
}

/* Background position */
[dir="rtl"] [style*="background-position:left"] {
  background-position: right center !important;
}

[dir="rtl"] [style*="background-position:right"] {
  background-position: left center !important;
}

/* Alignment utility classes */
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }

/* Buttons, links, lists spacing */
[dir="rtl"] a, [dir="rtl"] button, [dir="rtl"] li {
  padding-inline-start: 0.75rem;
  padding-inline-end: 0.75rem;
}

/* Ensure logical ordering for grids and columns */
[dir="rtl"] [class*="col-"] {
  float: right !important;
}

/* End of RTL overrides */
