/* RTL Styles for Arabic and other RTL languages */

/* Basic direction settings */
html[dir="rtl"],
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Flip margins and paddings for common elements */
html[dir="rtl"] .ml-1,
html[dir="rtl"] .ml-2,
html[dir="rtl"] .ml-3,
html[dir="rtl"] .ml-4,
html[dir="rtl"] .ml-5 {
    margin-left: 0 !important;
}

html[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; }
html[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important; }
html[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; }
html[dir="rtl"] .ml-5 { margin-right: 3rem !important; }

html[dir="rtl"] .mr-1,
html[dir="rtl"] .mr-2,
html[dir="rtl"] .mr-3,
html[dir="rtl"] .mr-4,
html[dir="rtl"] .mr-5 {
    margin-right: 0 !important;
}

html[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; }
html[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important; }
html[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; }
html[dir="rtl"] .mr-5 { margin-left: 3rem !important; }

html[dir="rtl"] .pl-1,
html[dir="rtl"] .pl-2,
html[dir="rtl"] .pl-3,
html[dir="rtl"] .pl-4,
html[dir="rtl"] .pl-5 {
    padding-left: 0 !important;
}

html[dir="rtl"] .pl-1 { padding-right: 0.25rem !important; }
html[dir="rtl"] .pl-2 { padding-right: 0.5rem !important; }
html[dir="rtl"] .pl-3 { padding-right: 1rem !important; }
html[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; }
html[dir="rtl"] .pl-5 { padding-right: 3rem !important; }

html[dir="rtl"] .pr-1,
html[dir="rtl"] .pr-2,
html[dir="rtl"] .pr-3,
html[dir="rtl"] .pr-4,
html[dir="rtl"] .pr-5 {
    padding-right: 0 !important;
}

html[dir="rtl"] .pr-1 { padding-left: 0.25rem !important; }
html[dir="rtl"] .pr-2 { padding-left: 0.5rem !important; }
html[dir="rtl"] .pr-3 { padding-left: 1rem !important; }
html[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; }
html[dir="rtl"] .pr-5 { padding-left: 3rem !important; }

/* Flip text alignment classes */
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }

/* Flip floats */
html[dir="rtl"] .float-left { float: right !important; }
html[dir="rtl"] .float-right { float: left !important; }

/* Flip flexbox alignment */
html[dir="rtl"] .justify-content-start { justify-content: flex-end !important; }
html[dir="rtl"] .justify-content-end { justify-content: flex-start !important; }

/* Flip borders */
html[dir="rtl"] .border-left { border-left: none !important; border-right: 1px solid; }
html[dir="rtl"] .border-right { border-right: none !important; border-left: 1px solid; }

/* Flip positions */
html[dir="rtl"] .left-0 { left: auto !important; right: 0 !important; }
html[dir="rtl"] .right-0 { right: auto !important; left: 0 !important; }

/* Flip transforms */
html[dir="rtl"] .rotate-90 { transform: rotate(-90deg) !important; }
html[dir="rtl"] .rotate-180 { transform: rotate(180deg) !important; }
html[dir="rtl"] .rotate-270 { transform: rotate(270deg) !important; }

/* Flip icons and arrows */
html[dir="rtl"] .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.255em;
}

/* Adjust language dropdown */
html[dir="rtl"] #language-dropdown-menu {
    left: 0;
    right: auto;
}

/* Adjust navigation items */
html[dir="rtl"] .nav-item {
    margin-right: 0;
    margin-left: 1rem;
}

/* Adjust form controls */
html[dir="rtl"] .form-check-input {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Adjust buttons with icons */
html[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Adjust list items */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* Adjust grid columns if needed */
@media (min-width: 768px) {
    html[dir="rtl"] .offset-md-1 { margin-left: 0; margin-right: 8.333333%; }
    html[dir="rtl"] .offset-md-2 { margin-left: 0; margin-right: 16.666667%; }
    html[dir="rtl"] .offset-md-3 { margin-left: 0; margin-right: 25%; }
    html[dir="rtl"] .offset-md-4 { margin-left: 0; margin-right: 33.333333%; }
}

/* Adjust specific components for your application */
html[dir="rtl"] .language-dropdown-button svg {
    margin-left: 0;
    margin-right: 0.375rem;
}

/* Adjust any specific components in your welcome page */
html[dir="rtl"] .feature-card {
    text-align: right;
}

html[dir="rtl"] .step-number {
    margin-right: 0;
    margin-left: 1rem;
}

/* Fix any SVG or icon directions */
html[dir="rtl"] .icon-arrow-right {
    transform: rotate(180deg);
}

/* Adjust any specific components in your application */
html[dir="rtl"] .footer-links {
    text-align: right;
}
