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

/* Body RTL */
body[dir="rtl"] {
  font-family: 'Cairo', sans-serif;
  text-align: right;
}

/* Reverse flex directions */
[dir="rtl"] .flex-row {
  flex-direction: row-reverse;
}

/* Reverse margins and paddings */
[dir="rtl"] .ml-auto {
  margin-left: unset;
  margin-right: auto;
}

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

/* Navigation RTL */
[dir="rtl"] nav {
  direction: rtl;
}

[dir="rtl"] .space-x-8 > * {
  margin-left: 0;
  margin-right: 2rem;
}

[dir="rtl"] .space-x-8 > *:last-child {
  margin-right: 0;
}

[dir="rtl"] .space-x-4 > * {
  margin-left: 0;
  margin-right: 1rem;
}

[dir="rtl"] .space-x-4 > *:last-child {
  margin-right: 0;
}

[dir="rtl"] .space-x-2 > * {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .space-x-2 > *:last-child {
  margin-right: 0;
}

/* Form elements RTL */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
  text-align: right;
}

[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
  text-align: right;
}

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

/* Grid RTL adjustments */
[dir="rtl"] .grid {
  direction: rtl;
}

/* Icons positioning RTL */
[dir="rtl"] .mr-2 {
  margin-right: 0;
  margin-left: 0.5rem;
}

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

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

[dir="rtl"] .ml-2 {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .ml-3 {
  margin-left: 0;
  margin-right: 0.75rem;
}

[dir="rtl"] .ml-4 {
  margin-left: 0;
  margin-right: 1rem;
}

/* Text alignment */
[dir="rtl"] .text-left {
  text-align: right;
}

[dir="rtl"] .text-right {
  text-align: left;
}

/* Float RTL */
[dir="rtl"] .float-left {
  float: right;
}

[dir="rtl"] .float-right {
  float: left;
}

/* Border radius 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;
}

/* Dropdown menus RTL */
[dir="rtl"] .right-0 {
  right: unset;
  left: 0;
}

[dir="rtl"] .left-0 {
  left: unset;
  right: 0;
}

/* Footer RTL */
[dir="rtl"] footer {
  direction: rtl;
}

/* Breadcrumbs RTL */
[dir="rtl"] .breadcrumb::before {
  content: "◄";
}

/* Arrows RTL */
[dir="rtl"] .arrow-right::after {
  content: "◄";
}

[dir="rtl"] .arrow-left::before {
  content: "►";
}

/* Checkbox and radio RTL */
[dir="rtl"] input[type="checkbox"],
[dir="rtl"] input[type="radio"] {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Table RTL */
[dir="rtl"] table {
  direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
  text-align: right;
}

/* Scrollbar RTL (for browsers that support it) */
[dir="rtl"]::-webkit-scrollbar {
  left: 0;
  right: unset;
}

/* Language switcher RTL positioning */
[dir="rtl"] #languageMenu {
  left: 0;
  right: unset;
}

/* Mobile menu RTL */
[dir="rtl"] #mobileMenu {
  text-align: right;
}

/* Hero section RTL */
[dir="rtl"] .hero-animate {
  direction: rtl;
}

/* Service cards RTL */
[dir="rtl"] .service-card {
  text-align: right;
}

/* Form RTL specific */
[dir="rtl"] label {
  text-align: right;
  display: block;
}

/* Button icons RTL */
[dir="rtl"] button svg {
  margin-left: 0.5rem;
  margin-right: 0;
}

/* Flexbox RTL utilities */
[dir="rtl"] .flex-row-reverse {
  flex-direction: row;
}

/* Shadows RTL (if directional) */
[dir="rtl"] .shadow-left {
  box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .shadow-right {
  box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
}

/* Animation direction RTL */
[dir="rtl"] @keyframes slideInRight {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

[dir="rtl"] @keyframes slideInLeft {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Typography adjustments for Arabic */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-weight: 700;
  line-height: 1.6;
}

[dir="rtl"] p {
  line-height: 1.8;
}

/* Better spacing for Arabic text */
[dir="rtl"] body {
  letter-spacing: 0;
}
