/* RTL (Right-to-Left) Styles for Arabic */

/* Apply RTL direction */
html[dir="rtl"] body,
html[dir="rtl"] .container,
html[dir="rtl"] .row {
    direction: rtl;
    text-align: right;
}

/* Flip float directions */
html[dir="rtl"] .float-left {
    float: right !important;
}

html[dir="rtl"] .float-right {
    float: left !important;
}

/* Flip text alignment */
html[dir="rtl"] .text-left {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: left !important;
}

/* Flip margins */
html[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-5 { margin-right: 3rem !important; margin-left: 0 !important; }

html[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-5 { margin-left: 3rem !important; margin-right: 0 !important; }

/* Flip padding */
html[dir="rtl"] .pl-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-5 { padding-right: 3rem !important; padding-left: 0 !important; }

html[dir="rtl"] .pr-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-5 { padding-left: 3rem !important; padding-right: 0 !important; }

/* Flip borders */
html[dir="rtl"] .border-left {
    border-left: none !important;
    border-right: 1px solid #dee2e6 !important;
}

html[dir="rtl"] .border-right {
    border-right: none !important;
    border-left: 1px solid #dee2e6 !important;
}

/* Navigation adjustments */
html[dir="rtl"] .nav,
html[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
    text-align: right;
}

/* Form controls */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    direction: rtl;
    text-align: right;
}

/* Checkboxes and radios */
html[dir="rtl"] .form-check {
    padding-right: 1.25rem;
    padding-left: 0;
}

html[dir="rtl"] .form-check-input {
    margin-right: -1.25rem;
    margin-left: 0;
}

/* Breadcrumbs */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    padding-right: 0.5rem;
    padding-left: 0;
    content: "/";
}

/* Icons */
html[dir="rtl"] .fa,
html[dir="rtl"] .fas,
html[dir="rtl"] .far,
html[dir="rtl"] .fab {
    margin-left: 5px;
    margin-right: 0;
}

/* Modal */
html[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

/* List groups */
html[dir="rtl"] .list-group {
    padding-right: 0;
}

/* Pagination */
html[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

/* Tables */
html[dir="rtl"] table {
    text-align: right;
}

html[dir="rtl"] th {
    text-align: right;
}

/* Carousel controls */
html[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 0;
}

html[dir="rtl"] .carousel-control-next {
    right: auto;
    left: 0;
}

/* Arabic font improvements */
html[lang="ar"] {
    font-family: 'Segoe UI', 'Helvetica Neue', 'Arial', 'Noto Sans Arabic', sans-serif;
}

/* French language specific if needed */
html[lang="fr"] {
    /* Add French-specific styles if needed */
}
