/* RTL (Right-to-Left) Styles for Arabic Language */

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

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

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

[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

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

[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: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

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

/* Form elements */
[dir="rtl"] .form-control {
    text-align: right;
}

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

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

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

/* Tables */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

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

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

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

/* Modals */
[dir="rtl"] .modal-header {
    text-align: right;
}

[dir="rtl"] .modal-footer {
    text-align: left;
}

/* Navigation */
[dir="rtl"] .nav-tabs .nav-link {
    text-align: right;
}

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

[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "\\";
    padding-left: 0.5rem;
    padding-right: 0;
}

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

/* Custom components */
[dir="rtl"] .language-switcher {
    right: auto;
    left: 10px;
}

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

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

/* Icons and buttons */
[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .btn i:last-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Sidebar and navigation */
[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .main-content {
    margin-right: 250px;
    margin-left: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .main-content {
        margin-right: 0;
    }
    
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    
    [dir="rtl"] .sidebar.show {
        transform: translateX(0);
    }
}

/* Font adjustments for Arabic */
[dir="rtl"] {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Animation adjustments for RTL */
[dir="rtl"] .fade-in {
    animation: fadeInRTL 0.5s ease-in;
}

@keyframes fadeInRTL {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Custom utility classes for RTL */
[dir="rtl"] .text-start {
    text-align: right !important;
}

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

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

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

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

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