
/* RTL Specific Styles */
body[dir="rtl"] .me-1, 
body[dir="rtl"] .me-2, 
body[dir="rtl"] .me-3, 
body[dir="rtl"] .me-4 {
    margin-left: 0.25rem !important;
    margin-left: 0.5rem !important;
    margin-left: 1rem !important;
    margin-left: 1.5rem !important;
    margin-right: 0 !important;
}

body[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

body[dir="rtl"] .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

body[dir="rtl"] .text-start {
    text-align: right !important;
}

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

/* Dashboard specific RTL fixes */
body[dir="rtl"] .card-title i {
    margin-right: 0;
    margin-left: 0.5rem;
}

body[dir="rtl"] .dropdown-menu {
    text-align: right;
}

body[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

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

body[dir="rtl"] .fa-eye, 
body[dir="rtl"] .fa-sync-alt {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* Fix RTL button icons */
body[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Fix input group in RTL */
body[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

body[dir="rtl"] .input-group > .input-group-append > .btn {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

/* RTL Support CSS */

/* Basic RTL Direction */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Margins and Paddings */
html[dir="rtl"] .me-1,
html[dir="rtl"] .me-2,
html[dir="rtl"] .me-3,
html[dir="rtl"] .me-4,
html[dir="rtl"] .me-5 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .ms-1,
html[dir="rtl"] .ms-2,
html[dir="rtl"] .ms-3,
html[dir="rtl"] .ms-4,
html[dir="rtl"] .ms-5 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .pe-1,
html[dir="rtl"] .pe-2,
html[dir="rtl"] .pe-3,
html[dir="rtl"] .pe-4,
html[dir="rtl"] .pe-5 {
    padding-left: 0.25rem !important;
    padding-right: 0 !important;
}

html[dir="rtl"] .ps-1,
html[dir="rtl"] .ps-2,
html[dir="rtl"] .ps-3,
html[dir="rtl"] .ps-4,
html[dir="rtl"] .ps-5 {
    padding-right: 0.25rem !important;
    padding-left: 0 !important;
}

/* List styles and text alignment */
html[dir="rtl"] .text-start {
    text-align: right !important;
}

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

/* Float */
html[dir="rtl"] .float-start {
    float: right !important;
}

html[dir="rtl"] .float-end {
    float: left !important;
}

/* Dropdown menus */
html[dir="rtl"] .dropdown-menu {
    text-align: right;
}

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

/* Navbar and Navigation */
html[dir="rtl"] .navbar-nav .nav-item {
    margin-left: 1rem;
    margin-right: 0;
}

/* Button Icons */
html[dir="rtl"] .btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Card positions */
html[dir="rtl"] .copy-btn {
    right: auto;
    left: 10px;
}

/* Form controls */
html[dir="rtl"] .form-check-input {
    float: right;
    margin-left: 0.5rem;
    margin-right: -1.5rem;
}

html[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.5rem;
}

/* Modal dialogs */
html[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Alert dismissibles */
html[dir="rtl"] .alert-dismissible {
    padding-right: 1rem;
    padding-left: 4rem;
}

html[dir="rtl"] .alert-dismissible .btn-close {
    right: auto;
    left: 0;
}

/* List groups */
html[dir="rtl"] .list-group {
    padding-right: 0;
}

/* Breadcrumbs */
html[dir="rtl"] .breadcrumb-item+.breadcrumb-item {
    padding-right: 0.5rem;
    padding-left: 0;
}

html[dir="rtl"] .breadcrumb-item+.breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}