/* RTL Styles for Arabic Language */
.rtl {
    direction: rtl;
    text-align: right;
}

/* Bootstrap RTL Overrides */
.rtl .navbar-brand {
    margin-right: 0;
    margin-left: 1rem;
}

.rtl .navbar-nav .nav-link {
    padding-right: 0;
    padding-left: 0.5rem;
}

.rtl .dropdown-menu {
    right: 0;
    left: auto;
}

.rtl .me-1, .rtl .me-2, .rtl .me-3, .rtl .me-4, .rtl .me-5 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

.rtl .me-2 {
    margin-left: 0.5rem !important;
}

.rtl .me-3 {
    margin-left: 1rem !important;
}

.rtl .ms-1, .rtl .ms-2, .rtl .ms-3, .rtl .ms-4, .rtl .ms-5 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

.rtl .ms-2 {
    margin-right: 0.5rem !important;
}

.rtl .ms-3 {
    margin-right: 1rem !important;
}

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

/* Card RTL */
.rtl .card-body {
    text-align: right;
}

.rtl .card-title {
    text-align: right;
}

/* Form RTL */
.rtl .form-label {
    text-align: right;
}

.rtl .form-control {
    text-align: right;
}

.rtl .form-select {
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
    padding-right: 0.75rem;
}

.rtl .input-group-text {
    border-left: 1px solid #ced4da;
    border-right: 0;
}

.rtl .input-group .form-control:not(:first-child) {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.rtl .input-group .form-control:not(:last-child) {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Button RTL */
.rtl .btn-group > .btn:not(:first-child) {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.rtl .btn-group > .btn:not(:last-child) {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Table RTL */
.rtl .table {
    text-align: right;
}

.rtl .table th,
.rtl .table td {
    text-align: right;
}

/* Modal RTL */
.rtl .modal-header {
    text-align: right;
}

.rtl .modal-title {
    text-align: right;
}

.rtl .modal-body {
    text-align: right;
}

.rtl .modal-footer {
    justify-content: flex-start;
}

.rtl .modal-footer .btn {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* Alert RTL */
.rtl .alert {
    text-align: right;
}

/* Breadcrumb RTL */
.rtl .breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    transform: scaleX(-1);
}

/* Pagination RTL */
.rtl .page-link {
    margin-left: -1px;
    margin-right: 0;
}

.rtl .page-item:first-child .page-link {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.rtl .page-item:last-child .page-link {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Custom POS Styles RTL */
.rtl .pos-categories {
    text-align: right;
}

.rtl .pos-products {
    text-align: right;
}

.rtl .pos-cart {
    text-align: right;
}

.rtl .product-card {
    text-align: center;
}

.rtl .product-card .card-title {
    text-align: center;
}

.rtl .cart-item {
    text-align: right;
}

.rtl .cart-item .item-name {
    text-align: right;
}

.rtl .cart-item .item-price {
    text-align: left;
}

/* Dashboard RTL */
.rtl .dashboard-card {
    text-align: right;
}

.rtl .dashboard-card .card-title {
    text-align: right;
}

.rtl .stat-card {
    text-align: center;
}

.rtl .stat-value {
    text-align: center;
}

.rtl .stat-label {
    text-align: center;
}

/* Navigation RTL */
.rtl .nav-pills .nav-link {
    text-align: right;
}

.rtl .nav-tabs .nav-link {
    text-align: right;
}

/* List Group RTL */
.rtl .list-group-item {
    text-align: right;
}

/* Progress RTL */
.rtl .progress {
    direction: ltr;
}

/* Tooltip RTL */
.rtl .tooltip {
    direction: ltr;
}

/* Popover RTL */
.rtl .popover {
    direction: ltr;
}

/* Custom Scrollbar RTL */
.rtl ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.rtl ::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.rtl ::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.rtl ::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Font Adjustments for Arabic */
.rtl {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-weight: 600;
}

.rtl .navbar-brand {
    font-weight: 700;
}

/* Number and Currency RTL */
.rtl .currency,
.rtl .number {
    direction: ltr;
    text-align: left;
    display: inline-block;
}

/* Date and Time RTL */
.rtl .date,
.rtl .time {
    direction: ltr;
    text-align: left;
    display: inline-block;
}

/* Icon RTL Adjustments */
.rtl .fa-chevron-right::before {
    content: "\f053";
}

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

.rtl .fa-angle-right::before {
    content: "\f104";
}

.rtl .fa-angle-left::before {
    content: "\f105";
}

/* Responsive RTL */
@media (max-width: 768px) {
    .rtl .navbar-collapse {
        text-align: right;
    }
    
    .rtl .navbar-nav {
        text-align: right;
    }
    
    .rtl .offcanvas {
        text-align: right;
    }
}

/* Print RTL */
@media print {
    .rtl {
        direction: rtl;
        text-align: right;
    }
    
    .rtl .receipt {
        text-align: center;
    }
    
    .rtl .receipt-header {
        text-align: center;
    }
    
    .rtl .receipt-footer {
        text-align: center;
    }
}

/* Animation RTL */
.rtl .slide-in-right {
    animation: slideInLeft 0.3s ease-in-out;
}

.rtl .slide-in-left {
    animation: slideInRight 0.3s ease-in-out;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

