/**
 * RTL (Right-to-Left) Stylesheet for Arabic Language
 * Hijri-Calendars.com
 */

/* RTL Text Direction */
[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

/* Navigation RTL */
[dir="rtl"] .navbar-nav {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .navbar-brand {
    margin-left: 1rem;
    margin-right: 0;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* Bootstrap Grid RTL */
[dir="rtl"] .col-md-6:first-child,
[dir="rtl"] .col-lg-4:first-child {
    padding-right: 15px;
    padding-left: 15px;
}

/* Forms RTL */
[dir="rtl"] .form-check {
    padding-right: 1.5em;
    padding-left: 0;
}

[dir="rtl"] .form-check-input {
    float: right;
    margin-right: -1.5em;
    margin-left: 0;
}

/* Buttons RTL */
[dir="rtl"] .btn-group > .btn:not(:last-child):not(.dropdown-toggle) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: .375rem;
    border-bottom-right-radius: .375rem;
}

[dir="rtl"] .btn-group > .btn:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: .375rem;
    border-bottom-left-radius: .375rem;
}

/* Cards RTL */
[dir="rtl"] .card-header {
    text-align: right;
}

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

/* List Groups RTL */
[dir="rtl"] .list-group-item {
    text-align: right;
}

/* Alerts RTL */
[dir="rtl"] .alert {
    text-align: right;
}

/* Flex RTL */
[dir="rtl"] .d-flex {
    direction: rtl;
}

[dir="rtl"] .justify-content-between {
    flex-direction: row-reverse;
}

/* Margins and Paddings RTL */
[dir="rtl"] .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

[dir="rtl"] .ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

[dir="rtl"] .pe-2 {
    padding-left: 0.5rem !important;
    padding-right: 0 !important;
}

[dir="rtl"] .ps-2 {
    padding-right: 0.5rem !important;
    padding-left: 0 !important;
}

/* Float RTL */
[dir="rtl"] .float-end {
    float: left !important;
}

[dir="rtl"] .float-start {
    float: right !important;
}

/* Text Alignment RTL */
[dir="rtl"] .text-start {
    text-align: right !important;
}

[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Border RTL */
[dir="rtl"] .border-start {
    border-right: 1px solid #dee2e6 !important;
    border-left: 0 !important;
}

[dir="rtl"] .border-end {
    border-left: 1px solid #dee2e6 !important;
    border-right: 0 !important;
}

/* Dropdown RTL */
[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
}

/* Navbar Toggle RTL */
[dir="rtl"] .navbar-toggler {
    margin-right: 0;
    margin-left: auto;
}

/* Arabic Numbers */
[dir="rtl"] .display-number {
    font-family: 'Cairo', sans-serif;
}

/* Form Select RTL */
[dir="rtl"] select.form-select {
    background-position: left 0.75rem center;
    padding-right: 0.75rem;
    padding-left: 2.25rem;
}

/* Input Group RTL */
[dir="rtl"] .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
    margin-right: -1px;
    margin-left: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Badge RTL */
[dir="rtl"] .badge {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Footer RTL */
[dir="rtl"] footer {
    text-align: right;
}

[dir="rtl"] footer ul {
    padding-right: 0;
}

/* SVG Icons RTL */
[dir="rtl"] svg {
    transform: scaleX(-1);
}

/* Specific Adjustments */
[dir="rtl"] .navbar-collapse {
    text-align: right;
}

[dir="rtl"] .navbar-nav .nav-link {
    padding-right: 1rem;
    padding-left: 1rem;
}

/* Responsive RTL */
@media (max-width: 991px) {
    [dir="rtl"] .navbar-collapse {
        text-align: right;
    }

    [dir="rtl"] .navbar-nav {
        align-items: flex-end;
    }
}

/* Custom RTL for Prayer Times */
[dir="rtl"] .list-group-item .d-flex {
    flex-direction: row-reverse;
}

/* Button Group RTL */
[dir="rtl"] .btn-group {
    direction: rtl;
}

[dir="rtl"] .btn-group > .btn {
    float: right;
}

/* Form Floating Labels RTL */
[dir="rtl"] .form-floating > label {
    right: 0;
    left: auto;
}

/* Offcanvas RTL */
[dir="rtl"] .offcanvas-start {
    right: 0;
    left: auto;
    border-left: 1px solid rgba(0,0,0,.2);
    border-right: 0;
    transform: translateX(100%);
}

[dir="rtl"] .offcanvas-end {
    left: 0;
    right: auto;
    border-right: 1px solid rgba(0,0,0,.2);
    border-left: 0;
    transform: translateX(-100%);
}
