/**
 * RTL (Right-to-Left) Styles
 * These styles are applied when the website language is set to Arabic
 */

/* Global RTL reset for HTML and body */
html.rtl,
html.rtl body {
    margin-left: 0 !important;
    padding-left: 0 !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
}

/* Reset all elements in RTL mode */
body.rtl * {
    margin-left: 0 !important;
}

/* Basic RTL Setup */
body.rtl {
    direction: rtl;
    text-align: right;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Force remove all left margins and paddings */
body.rtl,
body.rtl html,
body.rtl .container,
body.rtl .container-fluid,
body.rtl .row,
body.rtl .main-content,
body.rtl .content,
body.rtl .wrapper {
    margin-left: 0 !important;
    padding-left: 0 !important;
}

/* Navigation */
body.rtl .navbar-nav {
    padding-right: 0;
}

body.rtl .navbar-nav .nav-item {
    margin-right: 0;
    margin-left: 1rem;
}

body.rtl .dropdown-menu {
    text-align: right;
}

/* Fix navbar brand positioning for RTL */
body.rtl .navbar-brand {
    margin-left: 0 !important;
    margin-right: 20px !important;
    padding-left: 0 !important;
    padding-right: 15px !important;
}

/* Remove all left margins in RTL */
body.rtl *,
body.rtl .ml-1,
body.rtl .ml-2,
body.rtl .ml-3,
body.rtl .ml-4,
body.rtl .ml-5,
body.rtl .ml-auto,
body.rtl .mx-auto {
    margin-left: 0 !important;
}

/* Override Bootstrap margin utilities */
body.rtl .col,
body.rtl .col-1,
body.rtl .col-2,
body.rtl .col-3,
body.rtl .col-4,
body.rtl .col-5,
body.rtl .col-6,
body.rtl .col-7,
body.rtl .col-8,
body.rtl .col-9,
body.rtl .col-10,
body.rtl .col-11,
body.rtl .col-12,
body.rtl .col-md-1,
body.rtl .col-md-2,
body.rtl .col-md-3,
body.rtl .col-md-4,
body.rtl .col-md-5,
body.rtl .col-md-6,
body.rtl .col-md-7,
body.rtl .col-md-8,
body.rtl .col-md-9,
body.rtl .col-md-10,
body.rtl .col-md-11,
body.rtl .col-md-12 {
    margin-left: 0 !important;
    padding-left: 15px !important;
}

body.rtl .container,
body.rtl .container-fluid {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body.rtl .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Fix page margins for RTL */
body.rtl .container {
    margin-left: auto !important;
    margin-right: auto !important;
}

body.rtl .main-content {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

body.rtl .ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

body.rtl .mr-2,
body.rtl .mr-3 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

body.rtl .ml-3 {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

/* Text Alignment */
body.rtl .text-md-right {
    text-align: left !important;
}

body.rtl .text-md-left {
    text-align: right !important;
}

/* Search Form */
body.rtl .search-form button {
    right: auto;
    left: 0;
}

body.rtl .search-form input {
    padding-right: 15px;
    padding-left: 40px;
}

/* Icons */
body.rtl .fa-angle-right:before {
    content: "\f104";
}

body.rtl .fa-arrow-right:before {
    content: "\f060";
}

body.rtl .fa-chevron-left:before {
    content: "\f054";
}

body.rtl .fa-chevron-right:before {
    content: "\f053";
}

/* Footer Widgets */
body.rtl .footer-widget h4::after {
    left: auto;
    right: 0;
}

body.rtl .footer-widget ul li a:hover {
    padding-left: 0;
    padding-right: 5px;
}

/* Carousel Controls */
body.rtl .carousel-control-prev {
    right: auto;
    left: 0;
}

body.rtl .carousel-control-next {
    left: auto;
    right: 0;
}

/* Pagination */
body.rtl .pagination .page-item:first-child .page-link {
    border-radius: 0 0.25rem 0.25rem 0;
}

body.rtl .pagination .page-item:last-child .page-link {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Social Icons */
body.rtl .social-icons a {
    margin: 0 0 8px 8px;
}

/* Post Cards */
body.rtl .card-body {
    text-align: right;
}

/* Modal */
body.rtl .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}