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

/* Base RTL Direction */
html[dir="rtl"] {
    direction: rtl !important;
    text-align: right !important;
}

html[dir="rtl"] body {
    direction: rtl !important;
    text-align: right !important;
}

/* AdminLTE Layout - Sidebar and Content */
html[dir="rtl"] .main-sidebar {
    right: 0 !important;
    left: auto !important;
}

html[dir="rtl"] .content-wrapper {
    margin-right: 250px !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .main-header .navbar {
    margin-right: 250px !important;
    margin-left: 0 !important;
    right: 0 !important;
    left: auto !important;
}

html[dir="rtl"] .sidebar-mini.sidebar-collapse .content-wrapper {
    margin-right: 4.6rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-header .navbar {
    margin-right: 4.6rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-sidebar:hover ~ .content-wrapper {
    margin-right: 250px !important;
}

html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-sidebar:hover ~ .main-header .navbar {
    margin-right: 250px !important;
}

/* Sidebar Navigation */
html[dir="rtl"] .nav-sidebar .nav-link {
    padding-right: 1rem !important;
    padding-left: 0.5rem !important;
}

html[dir="rtl"] .nav-sidebar .nav-link > .nav-icon {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
    float: right !important;
}

/* Brand Logo */
html[dir="rtl"] .brand-link {
    padding: 0.8125rem 0.5rem 0.8125rem 1.2rem !important;
}

html[dir="rtl"] .brand-image {
    float: right !important;
    margin-right: 0 !important;
    margin-left: 0.3125rem !important;
    margin-top: -3px !important;
}

html[dir="rtl"] .brand-text {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

/* Content Header and Breadcrumb */
html[dir="rtl"] .content-header h1 {
    text-align: right !important;
}

html[dir="rtl"] .breadcrumb {
    float: left !important;
}

/* Navbar */
html[dir="rtl"] .navbar-nav.ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
    flex-direction: row !important;
}

html[dir="rtl"] .navbar-nav .nav-item {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .navbar-nav .nav-item:first-child {
    margin-left: 0 !important;
}

html[dir="rtl"] .navbar-nav .nav-item:last-child {
    margin-right: 0 !important;
}

/* Dropdown Menus */
html[dir="rtl"] .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    text-align: right !important;
}

html[dir="rtl"] .dropdown-item {
    text-align: right !important;
    padding: 0.25rem 1.5rem 0.25rem 1rem !important;
}

html[dir="rtl"] .navbar-nav .dropdown-toggle::after {
    margin-left: 0 !important;
    margin-right: 0.255em !important;
}

/* Form Controls */
html[dir="rtl"] .form-group label {
    text-align: right !important;
}

html[dir="rtl"] .form-control {
    text-align: right !important;
}

html[dir="rtl"] .form-control::placeholder {
    text-align: right !important;
}


/* Input Groups */
html[dir="rtl"] .input-group .form-control:not(:last-child) {
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

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

html[dir="rtl"] .input-group-prepend {
    margin-right: -1px !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .input-group-append {
    margin-left: -1px !important;
    margin-right: 0 !important;
}

/* Button Groups */
html[dir="rtl"] .btn-group > .btn:not(:last-child):not(.dropdown-toggle) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

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

html[dir="rtl"] .btn-group > .btn:last-child:not(.dropdown-toggle) {
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}

html[dir="rtl"] .btn-group > .btn:first-child {
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}

html[dir="rtl"] .input-group>.input-group-append>.btn, html[dir="rtl"] .input-group>.input-group-append>.input-group-text, html[dir="rtl"] .input-group>.input-group-prepend:first-child>.btn:not(:first-child), html[dir="rtl"] .input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child), html[dir="rtl"] .input-group>.input-group-prepend:not(:first-child)>.btn, html[dir="rtl"] .input-group>.input-group-prepend:not(:first-child)>.input-group-text {
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}


/* Cards */
html[dir="rtl"] .card-header {
    text-align: right !important;
    padding: 0.75rem 1.25rem !important;
}

html[dir="rtl"] .card-title {
    float: right !important;
    margin: 0 !important;
}

html[dir="rtl"] .card-tools {
    float: left !important;
    margin-right: 0 !important;
    margin-left: -0.625rem !important;
}

html[dir="rtl"] .card-tools .btn {
    padding: 0.25rem 0.5rem !important;
}

/* DataTables */
html[dir="rtl"] .dataTables_wrapper .dataTables_length,
html[dir="rtl"] .dataTables_wrapper .dataTables_info {
    float: right !important;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_filter,
html[dir="rtl"] .dataTables_wrapper .dataTables_paginate {
    float: left !important;
}

html[dir="rtl"] table.dataTable thead th,
html[dir="rtl"] table.dataTable tbody td {
    text-align: right !important;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    float: right !important;
    margin-left: 2px !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_paginate .paginate_button.previous {
    float: right !important;
}

html[dir="rtl"] .dataTables_wrapper .dataTables_paginate .paginate_button.next {
    float: left !important;
}

/* Alerts */
html[dir="rtl"] .alert {
    text-align: right !important;
    padding: 0.75rem 1.25rem !important;
}

html[dir="rtl"] .alert-dismissible {
    padding-left: 4rem !important;
    padding-right: 1.25rem !important;
}

html[dir="rtl"] .alert-dismissible .close {
    left: 0 !important;
    right: auto !important;
    padding: 0.75rem 1.25rem !important;
}

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

html[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem !important;
}

html[dir="rtl"] .modal-body {
    text-align: right !important;
}

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

/* Pagination */
html[dir="rtl"] .pagination {
    padding-left: 0 !important;
}

html[dir="rtl"] .page-item:first-child .page-link {
    margin-right: 0 !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

html[dir="rtl"] .page-item:last-child .page-link {
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Select2 */
html[dir="rtl"] .select2-container--default .select2-selection--single {
    text-align: right !important;
}

html[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__arrow {
    right: auto !important;
    left: 1px !important;
}

html[dir="rtl"] .select2-container--default .select2-selection--multiple {
    text-align: right !important;
}

/* Toast Notifications */
html[dir="rtl"] .toast {
    right: 15px !important;
    left: auto !important;
}

/* User Panel */
html[dir="rtl"] .user-panel .image {
    float: right !important;
}

html[dir="rtl"] .user-panel .info {
    padding-right: 10px !important;
    padding-left: 0 !important;
}

/* Bootstrap Utility Class Overrides */

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

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

/* Margin Auto Classes */
html[dir="rtl"] .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

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

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

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

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

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

html[dir="rtl"] .flex-row {
    flex-direction: row-reverse !important;
}

html[dir="rtl"] .flex-row-reverse {
    flex-direction: row !important;
}

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

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

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

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

/* Responsive Design */
@media (max-width: 767.98px) {
    html[dir="rtl"] .main-sidebar {
        right: -250px !important;
        left: auto !important;
        transform: translateX(0) !important;
    }
    
    html[dir="rtl"] .sidebar-open .main-sidebar {
        right: 0 !important;
        transform: translateX(0) !important;
    }
    
    html[dir="rtl"] .content-wrapper {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    html[dir="rtl"] .main-header .navbar {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    html[dir="rtl"] .navbar-nav.ml-auto {
        flex-direction: row !important;
    }
}

/* custom code */

html[dir="rtl"] .small-box .icon>i {
    left: 15px !important;
    right: unset !important;
}

html[dir="rtl"] .navbar-nav>.user-menu>.dropdown-menu {
    width: 340px !important;
}

html[dir="rtl"] .navbar-nav .nav-item {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .dropdown-menu {
    left: 0 !important;
    right: auto !important;
}

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

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

@media (min-width: 768px) {
    html[dir="rtl"] body:not(.sidebar-mini-md):not(.sidebar-mini-xs):not(.layout-top-nav) .content-wrapper, html[dir="rtl"] body:not(.sidebar-mini-md):not(.sidebar-mini-xs):not(.layout-top-nav) .main-footer, html[dir="rtl"] body:not(.sidebar-mini-md):not(.sidebar-mini-xs):not(.layout-top-nav) .main-header {
        transition: margin-right .3s 
ease-in-out;
        margin-right: 250px;
        margin-left: unset;
    }
}

html[dir="rtl"] .nav {
    padding-left: unset !important;
    padding-right: 0 !important;
}

html[dir="rtl"] .nav-sidebar .nav-link>.right, html[dir="rtl"] .nav-sidebar .nav-link>p>.right {
    right: unset !important;
    left: 1rem !important;
}

html[dir="rtl"] .breadcrumb-item+.breadcrumb-item::before {
    float: right;
    padding-left: .5rem;
}

html[dir="rtl"] .mr-2, html[dir="rtl"] .mx-2 {
    margin-left: .5rem !important;
    margin-right: unset !important;
}

html[dir="rtl"] .mr-3, html[dir="rtl"] .mx-3 {
    margin-left: 1rem !important;
    margin-right: unset !important;
}

html[dir="rtl"] .mr-4, html[dir="rtl"] .mx-4 {
    margin-left: 1.5rem !important;
    margin-right: unset !important;
}

@media (min-width: 992px) {
    html[dir="rtl"] .sidebar-mini.sidebar-collapse .content-wrapper, html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-footer, html[dir="rtl"] .sidebar-mini.sidebar-collapse .main-header {
        margin-right: 4.6rem !important;
        margin-left: unset !important;
    }
}

/* not RTL */

.text-light {
    color: #212529 !important;
}

html {
    background-color: #f4f6f9;
}

.nav-sidebar li.nav-header {
    font-weight: bold;
    font-size: 1.1rem;
}

div#seat-map-container {
    direction: ltr;
}

/* OVERRIDE: Force English inputs to be left-aligned even in RTL mode */
html[dir="rtl"] body #english input[dir="ltr"], 
html[dir="rtl"] body #english textarea[dir="ltr"],
html[dir="rtl"] body #english .form-control[dir="ltr"] {
    text-align: left !important;
    direction: ltr !important;
}

html[dir="rtl"] body #english .form-control[dir="ltr"]::placeholder {
    text-align: left !important;
    direction: ltr !important;
}

html[dir="rtl"] body #english input[dir="ltr"]::-webkit-input-placeholder,
html[dir="rtl"] body #english textarea[dir="ltr"]::-webkit-input-placeholder {
    text-align: left !important;
    direction: ltr !important;
}

html[dir="rtl"] body #english input[dir="ltr"]::-moz-placeholder,
html[dir="rtl"] body #english textarea[dir="ltr"]::-moz-placeholder {
    text-align: left !important;
    direction: ltr !important;
}

html[dir="rtl"] body #english input[dir="ltr"]:-ms-input-placeholder,
html[dir="rtl"] body #english textarea[dir="ltr"]:-ms-input-placeholder {
    text-align: left !important;
    direction: ltr !important;
}

/* RTL Form Check Fix */
html[dir="rtl"] .form-check {
    padding-right: 1.5rem;
    padding-left: 0;
}

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

html[dir="rtl"] .form-check-label {
    margin-right: 0.5rem;
    margin-left: 0;
    padding-right: 0;
    padding-left: 0;
}

html[dir="rtl"] .form-check.d-flex {
    padding-right: 0;
}

html[dir="rtl"] .form-check.d-flex .form-check-input {
    margin-right: 0.5rem;
    margin-left: 0;
    position: relative;
    right: auto;
    left: auto;
}

html[dir="rtl"] .form-check.d-flex .form-check-label {
    margin-right: 0;
}