/* RTL (Right-to-Left) specific styles for Arabic */

/* Automatically flip layout for RTL languages */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

/* Reset text alignment for specific elements that should remain LTR */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] code,
[dir="rtl"] pre {
  direction: ltr;
  text-align: left;
}

/* Flip margins and paddings for RTL */
[dir="rtl"] .ml-auto {
  margin-left: 0;
  margin-right: auto;
}

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

/* Flip border radius for RTL */
[dir="rtl"] .rounded-l-lg {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

[dir="rtl"] .rounded-r-lg {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

/* Flip flexbox justify content */
[dir="rtl"] .justify-start {
  justify-content: flex-end;
}

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

/* Icons and arrows should flip in RTL */
[dir="rtl"] .transform {
  transform: scaleX(-1);
}

/* Preserve original transform for images and media */
[dir="rtl"] img,
[dir="rtl"] video,
[dir="rtl"] canvas {
  transform: none;
}
