/**
 * بوابة رفق | Welfare Gateway
 * RTL (Right-to-Left) Support
 * ==========================
 * Arabic language specific styles
 */

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

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

/* Typography RTL */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
  text-align: right;
}

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

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

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

html[dir="rtl"] .flex-col {
  flex-direction: column;
}

/* Icons RTL - Mirror horizontally */
html[dir="rtl"] .icon-mirror {
  transform: scaleX(-1);
}

/* Buttons RTL */
html[dir="rtl"] .btn {
  flex-direction: row-reverse;
}

/* Forms RTL */
html[dir="rtl"] label {
  text-align: right;
}

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

/* Tables RTL */
html[dir="rtl"] th,
html[dir="rtl"] td {
  text-align: right;
}

/* Cards RTL */
html[dir="rtl"] .card-header,
html[dir="rtl"] .card-body,
html[dir="rtl"] .card-footer {
  text-align: right;
}

/* Dashboard Cards RTL */
html[dir="rtl"] .dashboard-card {
  text-align: right;
}

/* Tabs RTL */
html[dir="rtl"] .tabs {
  flex-direction: row-reverse;
}

/* Modal RTL */
html[dir="rtl"] .modal-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .modal-footer {
  flex-direction: row-reverse;
}

/* Profile Dropdown RTL */
html[dir="rtl"] .profile-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .profile-detail-item {
  flex-direction: row-reverse;
}

html[dir="rtl"] .profile-action-btn {
  flex-direction: row-reverse;
  text-align: right;
}

/* Footer RTL */
html[dir="rtl"] .footer-links {
  flex-direction: row-reverse;
}

/* Topbar RTL */
html[dir="rtl"] .topbar .container {
  flex-direction: row-reverse;
}

html[dir="rtl"] .topbar .actions {
  flex-direction: row-reverse;
}

/* Badge RTL */
html[dir="rtl"] .badge {
  flex-direction: row-reverse;
}

/* Empty State RTL */
html[dir="rtl"] .empty-state {
  text-align: center;
}

/* Responsive RTL */
@media (max-width: 768px) {
  html[dir="rtl"] .toast-container {
    left: var(--space-3);
    right: var(--space-3);
  }

  html[dir="rtl"] .profile-dropdown {
    left: auto;
    right: 0;
  }
}
