/* RTL Support CSS - Global Styles for Right-to-Left Languages */

/* Base RTL Direction */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Margin and Padding Utilities */
[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
[dir="rtl"] .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

/* Text Alignment */
[dir="rtl"] .text-start { text-align: right !important; }
[dir="rtl"] .text-end { text-align: left !important; }
[dir="rtl"] .text-left { text-align: right !important; }
[dir="rtl"] .text-right { text-align: left !important; }

/* Float */
[dir="rtl"] .float-start { float: right !important; }
[dir="rtl"] .float-end { float: left !important; }
[dir="rtl"] .float-left { float: right !important; }
[dir="rtl"] .float-right { float: left !important; }

/* Form Controls */
[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .form-label {
    text-align: right;
}

[dir="rtl"] .form-select {
    text-align: right;
}

/* Input Groups */
[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;
}

[dir="rtl"] .input-group > .input-group-text: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 > .input-group-text: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;
}

/* Buttons */
[dir="rtl"] .btn i,
[dir="rtl"] .btn svg {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .btn i:last-child,
[dir="rtl"] .btn svg:last-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Icons in Text */
[dir="rtl"] .text-muted i,
[dir="rtl"] .fw-bold i,
[dir="rtl"] .text-primary i,
[dir="rtl"] .text-success i,
[dir="rtl"] .text-danger i,
[dir="rtl"] .text-warning i,
[dir="rtl"] .text-info i {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* Tables */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

[dir="rtl"] .table .text-end {
    text-align: left !important;
}

/* Cards */
[dir="rtl"] .card-header .d-flex.align-items-center .me-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .card-header .d-flex.align-items-center .me-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

/* Modals */
[dir="rtl"] .modal-header .modal-title i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .modal-footer .btn i {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .modal-footer .btn i:last-child {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

[dir="rtl"] .modal-footer .btn + .btn {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Dropdown Menus */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

[dir="rtl"] .dropdown-item {
    text-align: right;
}

[dir="rtl"] .dropdown-item svg,
[dir="rtl"] .dropdown-item i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Pagination */
[dir="rtl"] .pagination {
    direction: rtl;
}

[dir="rtl"] .page-link {
    margin-right: 0;
    margin-left: -1px;
}

/* Alerts */
[dir="rtl"] .alert i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Badges */
[dir="rtl"] .badge {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* Gap Utilities */
[dir="rtl"] .gap-1 > * {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .gap-2 > * {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .gap-3 > * {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .gap-4 > * {
    margin-right: 1.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .gap-5 > * {
    margin-right: 3rem !important;
    margin-left: 0 !important;
}

/* Flexbox Gap */
[dir="rtl"] .d-flex.gap-1 > * {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .d-flex.gap-2 > * {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .d-flex.gap-3 > * {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .d-flex.gap-4 > * {
    margin-right: 1.5rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .d-flex.gap-5 > * {
    margin-right: 3rem !important;
    margin-left: 0 !important;
}

/* Custom Classes */
[dir="rtl"] .rt-mr-4 {
    margin-right: 0 !important;
    margin-left: 1.5rem !important;
}

[dir="rtl"] .rt-mr-8 {
    margin-right: 0 !important;
    margin-left: 2rem !important;
}

[dir="rtl"] .rt-ml-6 {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}

[dir="rtl"] .info-tools.rt-mr-8 {
    margin-right: 0 !important;
    margin-left: 2rem !important;
}

/* Dashboard Elements */
[dir="rtl"] .dashboard-right-header .left-text {
    text-align: right;
}

[dir="rtl"] .dashboard-right-header form {
    direction: rtl;
}

[dir="rtl"] .header-dropdown {
    margin-right: 0;
    margin-left: 1.5rem;
}

[dir="rtl"] .sidebar-open-nav {
    margin-right: 0;
    margin-left: 1rem;
}

/* Status Icons */
[dir="rtl"] .ft-wt-5 i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Radio Buttons */
[dir="rtl"] .expired_radio::after {
    margin-right: 0;
    margin-left: 8px;
}

/* Select2 RTL Support */
[dir="rtl"] .select2-container--default .select2-selection--single .select2-selection__rendered {
    text-align: right;
}

[dir="rtl"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* CKEditor RTL Support */
[dir="rtl"] .ck-editor__editable_inline {
    direction: rtl;
    text-align: right;
}

/* Switch/Toggle RTL Support */
[dir="rtl"] .slider:before {
    left: auto;
    right: 3px;
}

[dir="rtl"] input:checked + .slider:before {
    -webkit-transform: translateX(-15px);
    -ms-transform: translateX(-15px);
    transform: translateX(-15px);
}

/* Custom Modal RTL */
[dir="rtl"] .modal-content {
    direction: rtl;
}

[dir="rtl"] .modal-body {
    text-align: right;
}

/* Custom Table RTL */
[dir="rtl"] .table-responsive {
    direction: rtl;
}

[dir="rtl"] .table-responsive .table {
    direction: rtl;
}

/* Custom Form RTL */
[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .form-text {
    text-align: right;
}

/* Custom Button Groups 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: 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;
}

/* Custom Navigation RTL */
[dir="rtl"] .nav-link {
    text-align: right;
}

[dir="rtl"] .nav-tabs .nav-link {
    border-top-left-radius: 0;
    border-top-right-radius: 0.375rem;
}

[dir="rtl"] .nav-pills .nav-link {
    border-radius: 0.375rem;
}

/* Custom List Groups RTL */
[dir="rtl"] .list-group-item {
    text-align: right;
}

/* Custom Breadcrumbs RTL */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-right: 0;
    padding-left: 0.5rem;
}

/* Custom Progress Bars RTL */
[dir="rtl"] .progress-bar {
    text-align: right;
}

/* Custom Tooltips RTL */
[dir="rtl"] .tooltip-inner {
    text-align: right;
}

/* Custom Popovers RTL */
[dir="rtl"] .popover-body {
    text-align: right;
}

/* Custom Carousel RTL */
[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 0;
}

[dir="rtl"] .carousel-control-next {
    right: auto;
    left: 0;
}

/* ATS Job Detail Page RTL Styles */
[dir="rtl"] .ats-dashboard-header {
    direction: rtl;
}

[dir="rtl"] .ats-dashboard-header .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-dashboard-header .btn-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-dashboard-header .btn-group .btn {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-dashboard-header .btn-group .btn:last-child {
    margin-left: 0;
}

/* ATS Statistics Cards RTL */
[dir="rtl"] .ats-stats-card {
    direction: rtl;
}

[dir="rtl"] .ats-stats-card .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-stats-card .ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

[dir="rtl"] .ats-stats-card .me-0 {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* ATS Filters Section RTL */
[dir="rtl"] .ats-filters .form-label {
    text-align: right;
}

[dir="rtl"] .ats-filters .form-select {
    text-align: right;
}

[dir="rtl"] .ats-filters .form-control {
    text-align: right;
}

[dir="rtl"] .ats-filters .btn-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-filters .btn-group .btn {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-filters .btn-group .btn:last-child {
    margin-left: 0;
}

/* ATS Candidates Table RTL */
[dir="rtl"] .ats-candidates-table {
    direction: rtl;
}

[dir="rtl"] .ats-candidates-table .table {
    direction: rtl;
}

[dir="rtl"] .ats-candidates-table th {
    text-align: right;
}

[dir="rtl"] .ats-candidates-table td {
    text-align: right;
}

[dir="rtl"] .ats-candidates-table .candidate-info .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-candidates-table .candidate-info img {
    margin-right: 0;
    margin-left: 0.75rem;
}

[dir="rtl"] .ats-candidates-table .candidate-score-container {
    direction: rtl;
}

[dir="rtl"] .ats-candidates-table .candidate-score .progress-bar {
    text-align: center;
}

[dir="rtl"] .ats-candidates-table .candidate-status {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-candidates-table .btn-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-candidates-table .btn-group .btn {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-candidates-table .btn-group .btn:last-child {
    margin-left: 0;
}

/* ATS Modals RTL */
[dir="rtl"] .ats-modal .modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-modal .modal-header .modal-title i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .ats-modal .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

[dir="rtl"] .ats-modal .modal-body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .ats-modal .modal-body .form-label {
    text-align: right;
}

[dir="rtl"] .ats-modal .modal-body .form-control {
    text-align: right;
}

[dir="rtl"] .ats-modal .modal-body .form-select {
    text-align: right;
}

[dir="rtl"] .ats-modal .modal-body .form-range {
    direction: rtl;
}

[dir="rtl"] .ats-modal .modal-body .input-group {
    direction: rtl;
}

[dir="rtl"] .ats-modal .modal-body .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"] .ats-modal .modal-body .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;
}

[dir="rtl"] .ats-modal .modal-body .input-group > .input-group-text: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"] .ats-modal .modal-body .input-group > .input-group-text: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;
}

[dir="rtl"] .ats-modal .modal-footer {
    flex-direction: row-reverse;
}

[dir="rtl"] .ats-modal .modal-footer .btn {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .ats-modal .modal-footer .btn:last-child {
    margin-left: 0;
}

[dir="rtl"] .ats-modal .modal-footer .btn i {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* ATS Configuration Modal RTL */
[dir="rtl"] #configModal .modal-body .row {
    direction: rtl;
}

[dir="rtl"] #configModal .modal-body .col-md-6 {
    text-align: right;
}

[dir="rtl"] #configModal .modal-body h6 {
    text-align: right;
}

[dir="rtl"] #configModal .modal-body .alert {
    text-align: right;
}

[dir="rtl"] #configModal .modal-body .alert i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ATS Statistics Modal RTL */
[dir="rtl"] #statisticsModal .modal-body .row {
    direction: rtl;
}

[dir="rtl"] #statisticsModal .modal-body .card {
    text-align: center;
}

[dir="rtl"] #statisticsModal .modal-body .card-body {
    direction: rtl;
}

/* ATS Comparison Modal RTL */
[dir="rtl"] #comparisonModal .modal-body {
    direction: rtl;
}

[dir="rtl"] #comparisonModal .table {
    direction: rtl;
}

[dir="rtl"] #comparisonModal th {
    text-align: right;
}

[dir="rtl"] #comparisonModal td {
    text-align: right;
}

/* ATS Candidate Details Modal RTL */
[dir="rtl"] #candidateDetailsModal .modal-body .row {
    direction: rtl;
}

[dir="rtl"] #candidateDetailsModal .modal-body .col-md-6 {
    text-align: right;
}

[dir="rtl"] #candidateDetailsModal .modal-body .card-header {
    text-align: right;
}

[dir="rtl"] #candidateDetailsModal .modal-body .card-body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] #candidateDetailsModal .modal-body .badge {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] #candidateDetailsModal .modal-body .font-monospace {
    direction: ltr;
    text-align: left;
}

/* ATS Progress Bars RTL */
[dir="rtl"] .ats-progress .progress {
    direction: rtl;
}

[dir="rtl"] .ats-progress .progress-bar {
    text-align: center;
}

/* ATS Buttons RTL */
[dir="rtl"] .ats-btn i {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-btn:last-child i {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* ATS Icons RTL */
[dir="rtl"] .ats-icon {
    margin-right: 0;
    margin-left: 0.25rem;
}

[dir="rtl"] .ats-icon:last-child {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* ATS Text Utilities RTL */
[dir="rtl"] .ats-text-start {
    text-align: right !important;
}

[dir="rtl"] .ats-text-end {
    text-align: left !important;
}

[dir="rtl"] .ats-text-left {
    text-align: right !important;
}

[dir="rtl"] .ats-text-right {
    text-align: left !important;
}

/* ATS Margin Utilities RTL */
[dir="rtl"] .ats-me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
[dir="rtl"] .ats-me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
[dir="rtl"] .ats-me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .ats-me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
[dir="rtl"] .ats-me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

[dir="rtl"] .ats-ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
[dir="rtl"] .ats-ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
[dir="rtl"] .ats-ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ats-ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
[dir="rtl"] .ats-ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

/* ATS Padding Utilities RTL */
[dir="rtl"] .ats-pe-1 { padding-right: 0 !important; padding-left: 0.25rem !important; }
[dir="rtl"] .ats-pe-2 { padding-right: 0 !important; padding-left: 0.5rem !important; }
[dir="rtl"] .ats-pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
[dir="rtl"] .ats-pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
[dir="rtl"] .ats-pe-5 { padding-right: 0 !important; padding-left: 3rem !important; }

[dir="rtl"] .ats-ps-1 { padding-left: 0 !important; padding-right: 0.25rem !important; }
[dir="rtl"] .ats-ps-2 { padding-left: 0 !important; padding-right: 0.5rem !important; }
[dir="rtl"] .ats-ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
[dir="rtl"] .ats-ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
[dir="rtl"] .ats-ps-5 { padding-left: 0 !important; padding-right: 3rem !important; }

/* ATS Float Utilities RTL */
[dir="rtl"] .ats-float-start { float: right !important; }
[dir="rtl"] .ats-float-end { float: left !important; }
[dir="rtl"] .ats-float-left { float: right !important; }
[dir="rtl"] .ats-float-right { float: left !important; }

/* ATS Flexbox Utilities RTL */
[dir="rtl"] .ats-flex-row-reverse {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .ats-justify-content-start {
    justify-content: flex-end !important;
}

[dir="rtl"] .ats-justify-content-end {
    justify-content: flex-start !important;
}

[dir="rtl"] .ats-justify-content-left {
    justify-content: flex-end !important;
}

[dir="rtl"] .ats-justify-content-right {
    justify-content: flex-start !important;
}

/* ATS Border Radius RTL */
[dir="rtl"] .ats-rounded-start {
    border-top-right-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

[dir="rtl"] .ats-rounded-end {
    border-top-left-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ATS Responsive RTL */
@media (max-width: 767.98px) {
    [dir="rtl"] .ats-mobile-stack {
        flex-direction: column !important;
    }
    
    [dir="rtl"] .ats-mobile-stack .btn {
        margin-right: 0 !important;
        margin-left: 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    [dir="rtl"] .ats-mobile-stack .btn:last-child {
        margin-bottom: 0 !important;
    }
}

/* ATS Dark Mode RTL */
[dir="rtl"] .dark-mode .ats-dark-card {
    background-color: #2d3748;
    color: #e2e8f0;
}

[dir="rtl"] .dark-mode .ats-dark-card .card-header {
    background-color: #4a5568;
    border-bottom-color: #718096;
}

[dir="rtl"] .dark-mode .ats-dark-card .card-body {
    background-color: #2d3748;
}

[dir="rtl"] .dark-mode .ats-dark-table {
    background-color: #2d3748;
    color: #e2e8f0;
}

[dir="rtl"] .dark-mode .ats-dark-table th {
    background-color: #4a5568;
    border-color: #718096;
}

[dir="rtl"] .dark-mode .ats-dark-table td {
    border-color: #718096;
}

/* ATS Print RTL */
@media print {
    [dir="rtl"] .ats-print-hidden {
        display: none !important;
    }
    
    [dir="rtl"] .ats-print-visible {
        display: block !important;
    }
    
    [dir="rtl"] .ats-print-break {
        page-break-before: always;
    }
} 