/* ==========================================================================
   Arabic content RTL (scoped pages only)
   - Enabled only when body[data-content-rtl="1"] is present.
   - Keeps shell RTL rules in rtl-fixes.css unchanged.
   ========================================================================== */

body[data-language="ar"][data-content-rtl="1"] #main-body,
body[data-language="ar"][data-content-rtl="1"] #main-body .container,
body[data-language="ar"][data-content-rtl="1"] #main-body .row,
body[data-language="ar"][data-content-rtl="1"] #main-body .card,
body[data-language="ar"][data-content-rtl="1"] #main-body .card-body,
body[data-language="ar"][data-content-rtl="1"] #main-body form,
body[data-language="ar"][data-content-rtl="1"] #main-body .tab-content,
body[data-language="ar"][data-content-rtl="1"] #main-body .table-container {
  direction: rtl;
  text-align: right;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .form-group,
body[data-language="ar"][data-content-rtl="1"] #main-body .col-form-label,
body[data-language="ar"][data-content-rtl="1"] #main-body .form-check,
body[data-language="ar"][data-content-rtl="1"] #main-body .form-check label,
body[data-language="ar"][data-content-rtl="1"] #main-body .form-control,
body[data-language="ar"][data-content-rtl="1"] #main-body .custom-select,
body[data-language="ar"][data-content-rtl="1"] #main-body .dropdown-item,
body[data-language="ar"][data-content-rtl="1"] #main-body .btn-group .btn {
  text-align: right;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .form-check {
  padding-right: 1.5rem;
  padding-left: 0;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .form-check-input {
  margin-right: -1.5rem;
  margin-left: 0;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .form-check label {
  display: inline-block;
}

/* Bootstrap 4 float helpers still appear in WHMCS templates */
body[data-language="ar"][data-content-rtl="1"] #main-body .float-md-left {
  float: right !important;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .float-md-right {
  float: left !important;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .table,
body[data-language="ar"][data-content-rtl="1"] #main-body .table th,
body[data-language="ar"][data-content-rtl="1"] #main-body .table td,
body[data-language="ar"][data-content-rtl="1"] #main-body .dataTables_wrapper,
body[data-language="ar"][data-content-rtl="1"] #main-body .dataTables_info,
body[data-language="ar"][data-content-rtl="1"] #main-body .dataTables_paginate {
  direction: rtl;
  text-align: right;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .table .text-center {
  text-align: center !important;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .text-left {
  text-align: right !important;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .text-right,
body[data-language="ar"][data-content-rtl="1"] #main-body .text-end {
  text-align: left !important;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .input-group {
  direction: rtl;
  flex-direction: row-reverse;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .input-group > .input-group-prepend {
  margin-right: 0;
  margin-left: -1px;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .input-group > .input-group-append {
  margin-left: 0;
  margin-right: -1px;
}

body[data-language="ar"][data-content-rtl="1"] #main-body .float-left {
  float: right !important;
}

body[data-language="ar"][data-content-rtl="1"] #registration .form-group.prepend-icon {
  position: relative;
}

body[data-language="ar"][data-content-rtl="1"] #registration .prepend-icon .field-icon {
  right: 12px !important;
  left: auto !important;
}

body[data-language="ar"][data-content-rtl="1"] #registration .prepend-icon .field,
body[data-language="ar"][data-content-rtl="1"] #registration .prepend-icon .form-control {
  padding-right: 2.5rem !important;
  padding-left: 0.75rem !important;
  text-align: right;
}

body[data-language="ar"] #main-body .field-icon {
  display: none !important;
}

body[data-language="ar"] #main-body .prepend-icon .field,
body[data-language="ar"] #main-body .prepend-icon .form-control {
  padding-right: 0.75rem !important;
  padding-left: 0.75rem !important;
}

/* Keep technical values LTR for readability */
body[data-language="ar"][data-content-rtl="1"] #main-body input[type="email"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[type="url"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[type="tel"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[type="number"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[type="password"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[name*="domain"],
body[data-language="ar"][data-content-rtl="1"] #main-body input[name*="email"],
body[data-language="ar"][data-content-rtl="1"] #main-body .domain,
body[data-language="ar"][data-content-rtl="1"] #main-body .text-domain,
body[data-language="ar"][data-content-rtl="1"] #main-body .ltr-content {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
}
