/* RTL-specific overrides */
[dir="rtl"] {
    /* Fix padding and margins for specific components */
    .ps-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
    .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
    .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
    .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }

    /* Fix navigation */
    .navbar-nav {
        padding-right: 0;
    }

    /* Fix dropdown menus */
    .dropdown-menu {
        text-align: right;
        right: 0;
        left: auto !important;
    }

    /* Fix form controls */
    .form-control {
        text-align: right;
    }

    /* Fix input groups */
    .input-group .form-control:first-child {
        border-radius: 0 4px 4px 0;
    }

    .input-group .input-group-append:last-child {
        border-radius: 4px 0 0 4px;
    }

    /* Fix buttons with icons */
    .btn i {
        margin-right: 0;
        margin-left: 8px;
    }

    /* Fix list items */
    .list-unstyled {
        padding-right: 0;
    }

    /* Fix card layouts */
    .card-header, .card-body, .card-footer {
        text-align: right;
    }

    /* Fix modal dialogs */
    .modal-header .close {
        margin: -1rem auto -1rem -1rem;
    }

    /* Fix alerts */
    .alert {
        text-align: right;
        padding-right: 1.25rem;
        padding-left: 4rem;
    }

    .alert-dismissible .close {
        right: auto;
        left: 0;
    }

    /* Fix tables */
    .table th,
    .table td {
        text-align: right;
    }

    /* Fix pagination */
    .pagination {
        padding-right: 0;
    }

    /* Fix breadcrumbs */
    .breadcrumb {
        padding-right: 0;
    }

    /* Fix list groups */
    .list-group {
        padding-right: 0;
    }

    /* Fix custom checkboxes and radios */
    .custom-control {
        padding-right: 1.5rem;
        padding-left: 0;
    }

    .custom-control-label::before,
    .custom-control-label::after {
        right: -1.5rem;
        left: auto;
    }
}

/* Fix sweetalert2 popups */
.swal2-container[dir="rtl"] {
    .swal2-popup {
        text-align: right;
    }

    .swal2-actions {
        flex-direction: row-reverse;
    }

    .swal2-close {
        right: auto;
        left: 8px;
    }
}

/* Fix Bootstrap tooltips and popovers in RTL */
.tooltip[dir="rtl"],
.popover[dir="rtl"] {
    text-align: right;
}

/* Fix select dropdowns in RTL */
select.form-control {
    background-position: left 0.75rem center;
    padding-right: 0.75rem;
    padding-left: 2rem;
} 