/* RTL Overrides for elgamal CRM */

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

/* Icon flips for RTL direction */
[dir="rtl"] .fa-arrow-left::before {
    content: "\f061"; /* arrow-right */
}
[dir="rtl"] .fa-arrow-right::before {
    content: "\f060"; /* arrow-left */
}
[dir="rtl"] .fa-chevron-left::before {
    content: "\f054"; /* chevron-right */
}
[dir="rtl"] .fa-chevron-right::before {
    content: "\f053"; /* chevron-left */
}

/* Sidebar active indicators position */
[dir="rtl"] .nav-item.active::before {
    left: auto;
    right: 0;
}

/* Adjust search boxes */
[dir="rtl"] .search-box-icon {
    left: auto;
    right: var(--space-2);
}
[dir="rtl"] .search-box-input {
    padding-left: var(--space-3) !important;
    padding-right: 2.2rem !important;
}

/* Combobox absolute positions */
[dir="rtl"] .custom-combobox .combobox-clear {
    right: auto !important;
    left: 8px !important;
}
[dir="rtl"] .custom-combobox .combobox-arrow {
    right: auto !important;
    left: 8px !important;
}
[dir="rtl"] .custom-combobox-dropdown {
    left: 0 !important;
    right: 0 !important;
}
[dir="rtl"] .custom-combobox-option i {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Global Header Search RTL Adjustments */
[dir="rtl"] .header-search-input {
    padding-left: 40px !important;
    padding-right: 36px !important;
}
[dir="rtl"] .header-search-icon {
    left: auto !important;
    right: var(--space-3) !important;
}
[dir="rtl"] .header-search-kbd {
    right: auto !important;
    left: var(--space-2) !important;
}
[dir="rtl"] .header-search-results {
    left: auto !important;
    right: 0 !important;
}

/* RTL additions for Facebook Mobile Search UI */
[dir="rtl"] .btn-back-search i {
    transform: scaleX(-1);
}
@media (max-width: 768px) {
    [dir="rtl"] .crm-header.search-active .header-search-icon {
        left: auto !important;
        right: 14px !important;
    }
    [dir="rtl"] .btn-clear-search {
        right: auto !important;
        left: 10px !important;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .crm-sidebar {
        left: auto !important;
        right: 0 !important;
        transform: translateX(100%) !important;
    }
    [dir="rtl"] body.sidebar-open .crm-sidebar {
        transform: translateX(0) !important;
    }
    [dir="rtl"] .nav-submenu {
        padding-left: 0 !important;
        padding-right: var(--space-4) !important;
        border-left: none !important;
        border-right: 1px solid var(--border-muted) !important;
        margin-left: 0 !important;
        margin-right: 28px !important;
    }
    [dir="rtl"] .nav-item.active::before {
        left: auto !important;
        right: 0 !important;
        border-radius: 4px 0 0 4px !important;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .chart-card-header > div:last-child > div:last-child {
        border-left: none !important;
        border-right: 1px solid var(--border-muted) !important;
        padding-left: 0 !important;
        padding-right: var(--space-4) !important;
    }
}
