/* static/css/rtl.css */

/* ============================================
   RTL Mirror - Flips all directional properties
   ============================================ */

/* Text alignment */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .text-start { text-align: right !important; }
.rtl .text-end { text-align: left !important; }

/* Float directions */
.rtl .float-start { float: right !important; }
.rtl .float-end { float: left !important; }

/* Margins - Bootstrap 5 */
.rtl .ms-0 { margin-right: 0 !important; margin-left: 0 !important; }
.rtl .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
.rtl .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
.rtl .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
.rtl .ms-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
.rtl .ms-5 { margin-right: 3rem !important; margin-left: 0 !important; }
.rtl .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

.rtl .me-0 { margin-left: 0 !important; margin-right: 0 !important; }
.rtl .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
.rtl .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
.rtl .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
.rtl .me-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
.rtl .me-5 { margin-left: 3rem !important; margin-right: 0 !important; }
.rtl .me-auto { margin-left: auto !important; margin-right: 0 !important; }

/* Paddings - Bootstrap 5 */
.rtl .ps-0 { padding-right: 0 !important; padding-left: 0 !important; }
.rtl .ps-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
.rtl .ps-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
.rtl .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
.rtl .ps-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
.rtl .ps-5 { padding-right: 3rem !important; padding-left: 0 !important; }

.rtl .pe-0 { padding-left: 0 !important; padding-right: 0 !important; }
.rtl .pe-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
.rtl .pe-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
.rtl .pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }
.rtl .pe-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
.rtl .pe-5 { padding-left: 3rem !important; padding-right: 0 !important; }

/* Bootstrap Icons mirroring */
.rtl .bi-arrow-left::before { transform: scaleX(-1); }
.rtl .bi-arrow-right::before { transform: scaleX(-1); }
.rtl .bi-chevron-left::before { transform: scaleX(-1); }
.rtl .bi-chevron-right::before { transform: scaleX(-1); }
.rtl .bi-arrow-left-circle::before { transform: scaleX(-1); }
.rtl .bi-arrow-right-circle::before { transform: scaleX(-1); }

/* Dropdown menus */
.rtl .dropdown-menu {
    text-align: right;
}

.rtl .dropdown-menu-end {
    right: auto !important;
    left: 0 !important;
}

.rtl .dropdown-menu-start {
    right: 0 !important;
    left: auto !important;
}

/* Border radius mirroring */
.rtl .rounded-start {
    border-radius: 0 0.375rem 0.375rem 0 !important;
}

.rtl .rounded-end {
    border-radius: 0.375rem 0 0 0.375rem !important;
}

/* Form elements */
.rtl .form-check {
    padding-right: 1.5em;
    padding-left: 0;
}

.rtl .form-check .form-check-input {
    float: right;
    margin-right: -1.5em;
    margin-left: 0;
}

/* Flexbox direction */
.rtl .flex-row {
    flex-direction: row-reverse !important;
}

.rtl .flex-row-reverse {
    flex-direction: row !important;
}

/* Positioning */
.rtl .start-0 { left: auto !important; right: 0 !important; }
.rtl .start-50 { left: auto !important; right: 50% !important; }
.rtl .start-100 { left: auto !important; right: 100% !important; }
.rtl .end-0 { left: 0 !important; right: auto !important; }
.rtl .end-50 { left: 50% !important; right: auto !important; }
.rtl .end-100 { left: 100% !important; right: auto !important; }

.rtl .translate-middle {
    transform: translate(50%, -50%) !important;
}

.rtl .translate-middle-x {
    transform: translateX(50%) !important;
}

.rtl .translate-middle-y {
    transform: translateY(-50%) !important;
}

/* Breadcrumbs */
.rtl .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-right: 0;
    padding-left: 0.5rem;
    content: var(--bs-breadcrumb-divider, "/");
}

/* List groups */
.rtl .list-group {
    padding-right: 0;
}

/* Input groups */
.rtl .input-group > :not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.rtl .input-group > :not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}