/* Shared bidirectional layout rules. Keep component-specific colors and sizing
   in their owning stylesheets; this file owns direction and alignment. */
.text-end {
    text-align: end !important;
}

.text-start {
    text-align: start !important;
}

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

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

html[dir="rtl"] .content-wrapper,
html[dir="rtl"] .main-header,
html[dir="rtl"] .main-footer {
    margin-left: 0 !important;
    margin-right: var(--cms-sidebar-width) !important;
}

html[dir="rtl"] .nav-sidebar,
html[dir="rtl"] .navbar-nav,
html[dir="rtl"] .dropdown-menu,
html[dir="rtl"] .modal-content,
html[dir="rtl"] .form-group,
html[dir="rtl"] .card,
html[dir="rtl"] .alert {
    text-align: right;
}

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

/* In RTL the navigation belongs on the right, but the culture selector remains
   anchored to the opposite edge so it is always easy to find. */
html[dir="rtl"] .main-header .navbar-nav.ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html[dir="rtl"] .main-header .language-selector {
    direction: ltr;
}

html[dir="rtl"] .main-header .language-selector .dropdown-menu {
    left: 0;
    right: auto;
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

html[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-radius: 0 .25rem .25rem 0;
}

html[dir="rtl"] .input-group-append {
    margin-left: 0;
    margin-right: -1px;
}

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

html[dir="rtl"] .pagination {
    padding-right: 0;
}

html[dir="rtl"] .fa-arrow-left::before,
html[dir="rtl"] .fa-chevron-left::before {
    display: inline-block;
    transform: scaleX(-1);
}

@media (max-width: 1000px) {
    html[dir="rtl"] .content-wrapper,
    html[dir="rtl"] .main-header,
    html[dir="rtl"] .main-footer {
        margin-right: 0 !important;
    }
}
