/**
 * Frontend RTL Styles
 * Right-to-Left layout support for Arabic language
 */

/* Base RTL Styles */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Text Alignment */
.rtl .text-left {
    text-align: right !important;
}

.rtl .text-right {
    text-align: left !important;
}

/* Float Reversals */
.rtl .float-left {
    float: right !important;
}

.rtl .float-right {
    float: left !important;
}

/* Margin Reversals */
.rtl .mr-1, .rtl .mx-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

.rtl .mr-2, .rtl .mx-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

.rtl .mr-3, .rtl .mx-3 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

.rtl .mr-4, .rtl .mx-4 {
    margin-right: 0 !important;
    margin-left: 1.5rem !important;
}

.rtl .mr-5, .rtl .mx-5 {
    margin-right: 0 !important;
    margin-left: 3rem !important;
}

.rtl .ml-1, .rtl .mx-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

.rtl .ml-2, .rtl .mx-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

.rtl .ml-3, .rtl .mx-3 {
    margin-left: 0 !important;
    margin-right: 1rem !important;
}

.rtl .ml-4, .rtl .mx-4 {
    margin-left: 0 !important;
    margin-right: 1.5rem !important;
}

.rtl .ml-5, .rtl .mx-5 {
    margin-left: 0 !important;
    margin-right: 3rem !important;
}

.rtl .ms-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

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

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

.rtl .me-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

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

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

/* Padding Reversals */
.rtl .pr-1, .rtl .px-1 {
    padding-right: 0 !important;
    padding-left: 0.25rem !important;
}

.rtl .pr-2, .rtl .px-2 {
    padding-right: 0 !important;
    padding-left: 0.5rem !important;
}

.rtl .pr-3, .rtl .px-3 {
    padding-right: 0 !important;
    padding-left: 1rem !important;
}

.rtl .pr-4, .rtl .px-4 {
    padding-right: 0 !important;
    padding-left: 1.5rem !important;
}

.rtl .pr-5, .rtl .px-5 {
    padding-right: 0 !important;
    padding-left: 3rem !important;
}

.rtl .pl-1, .rtl .px-1 {
    padding-left: 0 !important;
    padding-right: 0.25rem !important;
}

.rtl .pl-2, .rtl .px-2 {
    padding-left: 0 !important;
    padding-right: 0.5rem !important;
}

.rtl .pl-3, .rtl .px-3 {
    padding-left: 0 !important;
    padding-right: 1rem !important;
}

.rtl .pl-4, .rtl .px-4 {
    padding-left: 0 !important;
    padding-right: 1.5rem !important;
}

.rtl .pl-5, .rtl .px-5 {
    padding-left: 0 !important;
    padding-right: 3rem !important;
}

.rtl .ps-1 {
    padding-left: 0 !important;
    padding-right: 0.25rem !important;
}

.rtl .ps-2 {
    padding-left: 0 !important;
    padding-right: 0.5rem !important;
}

.rtl .ps-3 {
    padding-left: 0 !important;
    padding-right: 1rem !important;
}

.rtl .pe-1 {
    padding-right: 0 !important;
    padding-left: 0.25rem !important;
}

.rtl .pe-2 {
    padding-right: 0 !important;
    padding-left: 0.5rem !important;
}

.rtl .pe-3 {
    padding-right: 0 !important;
    padding-left: 1rem !important;
}

/* Border Radius Reversals */
.rtl .rounded-left {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    border-top-right-radius: 0.25rem !important;
    border-bottom-right-radius: 0.25rem !important;
}

.rtl .rounded-right {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.25rem !important;
    border-bottom-left-radius: 0.25rem !important;
}

/* Form Controls */
.rtl input,
.rtl textarea,
.rtl select,
.rtl .form-control {
    text-align: right;
}

.rtl .input-group-text {
    text-align: right;
}

/* Dropdown Menus */
.rtl .dropdown-menu {
    left: auto;
    right: 0;
    text-align: right;
}

/* Navigation */
.rtl .navbar-nav {
    padding-left: 0;
    padding-right: 0;
}

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

/* Cards */
.rtl .card {
    text-align: right;
}

/* Lists */
.rtl ul,
.rtl ol {
    padding-left: 0;
    padding-right: 2rem;
}

.rtl .list-unstyled {
    padding-right: 0;
}

/* Breadcrumbs */
.rtl .breadcrumb-item + .breadcrumb-item::before {
    padding-left: 0;
    padding-right: 0.5rem;
    float: right;
}

/* Icons */
.rtl i[class*="arrow-"],
.rtl i[class*="chevron-"] {
    transform: scaleX(-1);
}

.rtl [data-feather="arrow-right"] {
    transform: scaleX(-1);
}

.rtl [data-feather="arrow-left"] {
    transform: scaleX(-1);
}

/* Modal */
.rtl .modal-header .close,
.rtl .modal-header .btn-close {
    margin: -1rem auto -1rem -1rem;
}

/* Pagination */
.rtl .pagination {
    padding-right: 0;
}

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

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

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

.rtl th {
    text-align: right;
}

/* Alerts */
.rtl .alert-dismissible .close,
.rtl .alert-dismissible .btn-close {
    left: 0;
    right: auto;
}

/* Badges */
.rtl .badge {
    text-align: right;
}

/* Toast */
.rtl .toast {
    text-align: right;
}

/* Progress Bar */
.rtl .progress-bar {
    right: 0;
}

/* Offcanvas */
.rtl .offcanvas-start {
    right: 0;
    left: auto;
    transform: translateX(100%);
}

.rtl .offcanvas-end {
    left: 0;
    right: auto;
    transform: translateX(-100%);
}

/* Carousel Controls */
.rtl .carousel-control-prev {
    left: auto;
    right: 0;
}

.rtl .carousel-control-next {
    right: auto;
    left: 0;
}

/* Custom Frontend Specific Styles */

/* Hero Section */
.rtl .hero-content {
    text-align: right;
}

/* Job Cards */
.rtl .job-card {
    text-align: right;
}

.rtl .job-meta-item {
    margin-left: 0;
    margin-right: 1.5rem;
}

.rtl .job-meta-item:last-child {
    margin-right: 0;
}

/* Company Cards */
.rtl .company-card {
    text-align: right;
}

/* Search Forms */
.rtl .search-form {
    text-align: right;
}

.rtl .search-icon {
    left: auto;
    right: 1rem;
}

/* Stats */
.rtl .stat-item {
    text-align: right;
}

/* Footer */
.rtl .footer {
    text-align: right;
}

.rtl .footer-links {
    padding-left: 0;
    padding-right: 0;
}

/* Auth Forms */
.rtl .auth-card {
    text-align: right;
}

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

/* User Type Selection */
.rtl .user-type-option {
    text-align: right;
}

.rtl .user-type-action i {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Buttons with Icons */
.rtl .btn i,
.rtl .btn svg {
    margin-left: 0;
    margin-right: 0.5rem;
}

.rtl .btn i:last-child,
.rtl .btn svg:last-child {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Checkbox and Radio */
.rtl .form-check {
    padding-left: 0;
    padding-right: 1.25em;
}

.rtl .form-check-input {
    float: right;
    margin-left: 0;
    margin-right: -1.25em;
}

/* Select2 RTL Support */
.rtl .select2-container {
    direction: rtl;
}

.rtl .select2-selection__rendered {
    text-align: right;
}

.rtl .select2-search__field {
    text-align: right;
}

/* Owl Carousel RTL Support */
.rtl .owl-carousel {
    direction: rtl;
}

.rtl .owl-carousel .owl-nav button.owl-prev {
    left: auto;
    right: 0;
}

.rtl .owl-carousel .owl-nav button.owl-next {
    right: auto;
    left: 0;
}

/* Loader */
.rtl .loader-text {
    text-align: center;
}

/* Top Bar */
.rtl .top-bar {
    text-align: right;
}

.rtl .language-selector {
    margin-left: 0;
    margin-right: 1rem;
}

/* Navigation Menu */
.rtl .navbar-collapse {
    text-align: right;
}

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

/* Job Details */
.rtl .job-details {
    text-align: right;
}

.rtl .job-details-list {
    padding-left: 0;
    padding-right: 0;
}

/* Profile */
.rtl .profile-card {
    text-align: right;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .rtl .mobile-menu {
        text-align: right;
    }

    .rtl .mobile-nav {
        right: auto;
        left: 0;
    }
}

/* Fix for specific components that might break in RTL */
.rtl .d-flex {
    direction: ltr;
}

.rtl .d-flex.rtl-flex {
    direction: rtl;
}

/* ===================================== */
/* JOB DETAIL REDESIGN - RTL SUPPORT */
/* ===================================== */

.rtl .job-detail-redesign .job-header-content {
    padding-right: 0;
    padding-left: 2rem;
}

.rtl .job-detail-redesign .breadcrumb-link {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .job-category-badge {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .job-type-badge {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .stat-item {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .stat-item i {
    margin-left: 0;
    margin-right: 0.5rem;
}

.rtl .job-detail-redesign .stat-card {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .location-inline-enhanced {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .action-panel-header {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .section-title-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .requirement-item {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 3px solid #6152aa;
}

.rtl .job-detail-redesign .requirement-item:hover {
    transform: translateX(-3px);
}

.rtl .job-detail-redesign .job-tag-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-link-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-modern-enhanced {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-icon-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-icon-modern-enhanced {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .overview-item-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .key-info-item {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .key-info-item-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .sidebar-title-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .btn-cta-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .meta-item-modern {
    flex-direction: row-reverse;
}

.rtl .job-detail-redesign .meta-item-modern i {
    text-align: center;
}

@media (max-width: 768px) {
    .rtl .job-detail-redesign .job-header-content {
        padding-left: 0;
    }
}

/* ===================================== */
/* JOB DETAIL CLEAN - RTL SUPPORT */
/* ===================================== */

.rtl .job-detail-clean .view-company-btn {
    flex-direction: row-reverse;
}

.rtl .job-detail-clean .btn-browse-similar {
    flex-direction: row-reverse;
}

.rtl .job-detail-clean .btn-apply-clean {
    flex-direction: row-reverse;
}

.rtl .job-detail-clean .btn-secondary-clean {
    flex-direction: row-reverse;
}
