/* ==========================================
   RTL MOBILE CSS - ARABIC MOBILE PAGES
   Lightweight RTL support for all mobile pages
   Only changes direction and alignment, preserves layout
   ========================================== */

/* ==========================================
   BASE RTL FIXES FOR MOBILE
   ========================================== */

/* Set RTL direction with minimal overflow prevention */
[dir="rtl"] html,
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    left: 0;
    right: 0;
}

/* Ensure main content is visible in RTL */
[dir="rtl"] main,
[dir="rtl"] #main-content,
[dir="rtl"] .main-content {
    display: block;
    visibility: visible;
    opacity: 1;
    overflow-x: hidden;
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
}

/* Prevent overflow on containers only */
[dir="rtl"] section,
[dir="rtl"] .mobile-section {
    overflow-x: hidden;
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
}

/* Inherit direction for all elements */
[dir="rtl"] * {
    direction: inherit;
}

/* Prevent images and media from causing overflow */
[dir="rtl"] img {
    max-width: 100%;
    height: auto;
}

/* Video backgrounds should cover */
[dir="rtl"] .mobile-video-background {
    max-width: none;
}

/* ==========================================
   MOBILE HEADER RTL FIXES
   ========================================== */

/* Header container */
[dir="rtl"] .modern-mobile-header {
    direction: rtl;
}

[dir="rtl"] .mobile-header-inner {
    direction: rtl;
    flex-direction: row-reverse;
}

/* Logo positioning - Move to right */
[dir="rtl"] .mobile-header-logo {
    margin-right: 0;
    margin-left: auto;
    order: 2;
}

/* Header actions - Move to left */
[dir="rtl"] .mobile-header-actions {
    margin-left: 0;
    margin-right: auto;
    order: 1;
    flex-direction: row-reverse;
}

/* Mobile Menu RTL */
[dir="rtl"] .modern-mobile-menu {
    left: auto;
    right: 0;
    transform: translateX(-100%);
}

[dir="rtl"] .modern-mobile-menu.active {
    transform: translateX(0);
}

/* Menu items alignment */
[dir="rtl"] .mobile-menu-link {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-menu-link i {
    margin-right: 0;
    margin-left: 0.75rem;
}

/* Submenu items */
[dir="rtl"] .mobile-submenu-link {
    padding: 0.875rem 3.5rem 0.875rem 1.25rem;
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-nested-submenu-link {
    padding-right: 5rem;
    padding-left: 1.25rem;
}

[dir="rtl"] .mobile-lang-link {
    padding: 0.75rem 3.5rem 0.75rem 1.25rem;
}

/* ==========================================
   MOBILE SECTIONS RTL
   ========================================== */

[dir="rtl"] .mobile-section {
    direction: rtl;
}

[dir="rtl"] .mobile-title,
[dir="rtl"] .mobile-subtitle {
    direction: rtl;
}

/* ==========================================
   MOBILE CARDS & COMPONENTS RTL
   ========================================== */

[dir="rtl"] .mobile-card {
    direction: rtl;
}

/* Training Features */
[dir="rtl"] .mobile-training-feature {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-feature-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* Feature List */
[dir="rtl"] .mobile-feature-list {
    padding: 0 1rem 0 0;
}

[dir="rtl"] .mobile-feature-list li {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-feature-list li i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ==========================================
   TABS RTL
   ========================================== */

[dir="rtl"] .mobile-tabs {
    direction: rtl;
}

[dir="rtl"] .mobile-tab-buttons {
    direction: rtl;
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-tab-button {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-tab-button i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .mobile-tab-content {
    direction: rtl;
}

[dir="rtl"] .mobile-highlight-box {
    border-left: none;
    border-right: 4px solid #8B5CF6;
}

/* ==========================================
   ASSESSMENT SECTION RTL
   ========================================== */

[dir="rtl"] .mobile-assessment-section {
    direction: rtl;
}

[dir="rtl"] .mobile-assessment-features {
    direction: rtl;
}

[dir="rtl"] .mobile-assessment-feature {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-assessment-feature-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* ==========================================
   SERVICE CARDS & GRIDS RTL
   ========================================== */

[dir="rtl"] .mobile-service-card {
    direction: rtl;
}

[dir="rtl"] .mobile-service-card-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-grid,
[dir="rtl"] .mobile-grid-2,
[dir="rtl"] .mobile-grid-3,
[dir="rtl"] .mobile-grid-4 {
    direction: rtl;
}

/* ==========================================
   SLA SECTION RTL
   ========================================== */

[dir="rtl"] .mobile-sla-grid,
[dir="rtl"] .mobile-sla-card {
    direction: rtl;
}

/* ==========================================
   OPTIMIZATION BENEFITS RTL
   ========================================== */

[dir="rtl"] .mobile-optimization-benefits,
[dir="rtl"] .mobile-benefit-item {
    direction: rtl;
}

/* ==========================================
   CTA SECTION RTL
   ========================================== */

[dir="rtl"] .mobile-cta-section {
    direction: rtl;
}

[dir="rtl"] .mobile-cta-button {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-cta-button i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ==========================================
   VIDEO HERO SLIDER RTL - CRITICAL FIX
   ========================================== */

[dir="rtl"] .mobile-video-hero-slider {
    direction: rtl;
    overflow: hidden;
    max-width: 100vw;
    width: 100%;
    display: block !important;
}

[dir="rtl"] .mobile-slider-container {
    display: block !important;
    visibility: visible !important;
}

/* Force active slide to be visible */
[dir="rtl"] .mobile-video-slide.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1 !important;
}

[dir="rtl"] .mobile-video-slide {
    direction: rtl;
}

[dir="rtl"] .mobile-slide-content-container {
    direction: rtl;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

[dir="rtl"] .mobile-slide-content {
    direction: rtl;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

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

[dir="rtl"] .mobile-slider-dots {
    direction: rtl;
}

/* ==========================================
   STATISTICS & COUNTERS RTL
   ========================================== */

[dir="rtl"] .mobile-stat-card {
    direction: rtl;
}

/* ==========================================
   ICON BOXES RTL
   ========================================== */

[dir="rtl"] .mobile-icon-box {
    direction: rtl;
}

[dir="rtl"] .mobile-icon-box-horizontal {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-icon-box-horizontal .mobile-icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* ==========================================
   TESTIMONIALS RTL
   ========================================== */

[dir="rtl"] .mobile-testimonial-card {
    direction: rtl;
}

[dir="rtl"] .mobile-testimonial-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-testimonial-avatar {
    margin-right: 0;
    margin-left: 1rem;
}

/* ==========================================
   BADGES & PILLS RTL
   ========================================== */

[dir="rtl"] .mobile-badge {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-badge i {
    margin-right: 0;
    margin-left: 0.5rem;
}

[dir="rtl"] .mobile-assessment-badge {
    direction: rtl;
}

/* ==========================================
   BUTTONS RTL
   ========================================== */

[dir="rtl"] button,
[dir="rtl"] .btn,
[dir="rtl"] a.button {
    direction: rtl;
}

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

/* ==========================================
   IMAGES & MEDIA RTL
   ========================================== */

[dir="rtl"] img {
    direction: ltr; /* Keep images in normal direction */
}

[dir="rtl"] .mobile-assessment-image,
[dir="rtl"] .mobile-section img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   PROCESS STEPS RTL
   ========================================== */

[dir="rtl"] .mobile-process-step {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .mobile-step-number {
    margin-right: 0;
    margin-left: 1rem;
}

[dir="rtl"] .mobile-step-content {
    text-align: right;
}

/* ==========================================
   ACCORDION RTL
   ========================================== */

[dir="rtl"] .mobile-accordion {
    direction: rtl;
}

[dir="rtl"] .mobile-accordion-header {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .mobile-accordion-icon {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .mobile-accordion-content {
    text-align: right;
}

/* ==========================================
   CONTACT FORM RTL
   ========================================== */

[dir="rtl"] .mobile-form,
[dir="rtl"] .mobile-contact-form,
[dir="rtl"] .mobile-form-group {
    direction: rtl;
}

[dir="rtl"] .mobile-form-control,
[dir="rtl"] .mobile-form-input,
[dir="rtl"] .mobile-form-select,
[dir="rtl"] .mobile-form-textarea {
    direction: rtl;
}

/* ==========================================
   BREADCRUMBS RTL
   ========================================== */

[dir="rtl"] .mobile-breadcrumb {
    direction: rtl;
    flex-direction: row-reverse;
}

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

/* ==========================================
   FOOTER RTL
   ========================================== */

[dir="rtl"] .mobile-footer,
[dir="rtl"] .mobile-footer-section {
    direction: rtl;
}

[dir="rtl"] .mobile-social-links {
    flex-direction: row-reverse;
}

/* ==========================================
   PRICING TABLES RTL
   ========================================== */

[dir="rtl"] .mobile-pricing-card,
[dir="rtl"] .mobile-price,
[dir="rtl"] .mobile-pricing-features {
    direction: rtl;
}

[dir="rtl"] .mobile-pricing-features li {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-pricing-features li i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ==========================================
   TIMELINE RTL
   ========================================== */

[dir="rtl"] .mobile-timeline,
[dir="rtl"] .mobile-timeline-item {
    direction: rtl;
}

[dir="rtl"] .mobile-timeline-marker {
    right: auto;
    left: 0;
}

[dir="rtl"] .mobile-timeline-content {
    padding-right: 0;
    padding-left: 2rem;
}

/* ==========================================
   LIST ITEMS RTL
   ========================================== */

[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-right: 1.5rem;
    padding-left: 0;
}

/* ==========================================
   MARGIN & PADDING UTILITIES RTL
   ========================================== */

[dir="rtl"] .me-1 { margin-right: 0; margin-left: 0.25rem; }
[dir="rtl"] .me-2 { margin-right: 0; margin-left: 0.5rem; }
[dir="rtl"] .me-3 { margin-right: 0; margin-left: 1rem; }
[dir="rtl"] .me-4 { margin-right: 0; margin-left: 1.5rem; }
[dir="rtl"] .me-5 { margin-right: 0; margin-left: 3rem; }

[dir="rtl"] .ms-1 { margin-left: 0; margin-right: 0.25rem; }
[dir="rtl"] .ms-2 { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .ms-3 { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .ms-4 { margin-left: 0; margin-right: 1.5rem; }
[dir="rtl"] .ms-5 { margin-left: 0; margin-right: 3rem; }

[dir="rtl"] .pe-1 { padding-right: 0; padding-left: 0.25rem; }
[dir="rtl"] .pe-2 { padding-right: 0; padding-left: 0.5rem; }
[dir="rtl"] .pe-3 { padding-right: 0; padding-left: 1rem; }
[dir="rtl"] .pe-4 { padding-right: 0; padding-left: 1.5rem; }
[dir="rtl"] .pe-5 { padding-right: 0; padding-left: 3rem; }

[dir="rtl"] .ps-1 { padding-left: 0; padding-right: 0.25rem; }
[dir="rtl"] .ps-2 { padding-left: 0; padding-right: 0.5rem; }
[dir="rtl"] .ps-3 { padding-left: 0; padding-right: 1rem; }
[dir="rtl"] .ps-4 { padding-left: 0; padding-right: 1.5rem; }
[dir="rtl"] .ps-5 { padding-left: 0; padding-right: 3rem; }

/* ==========================================
   FLEXBOX UTILITIES RTL
   ========================================== */

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

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

/* ==========================================
   ICONS & ARROWS RTL
   ========================================== */

[dir="rtl"] .fa-arrow-right::before {
    content: "\f060"; /* fa-arrow-left */
}

[dir="rtl"] .fa-arrow-left::before {
    content: "\f061"; /* fa-arrow-right */
}

[dir="rtl"] .fa-chevron-right::before {
    content: "\f053"; /* fa-chevron-left */
}

[dir="rtl"] .fa-chevron-left::before {
    content: "\f054"; /* fa-chevron-right */
}

[dir="rtl"] .fa-angle-right::before {
    content: "\f104"; /* fa-angle-left */
}

[dir="rtl"] .fa-angle-left::before {
    content: "\f105"; /* fa-angle-right */
}

/* Keep email addresses and URLs LTR */
[dir="rtl"] .email,
[dir="rtl"] .url,
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href^="http"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* Keep numbers LTR */
[dir="rtl"] .number,
[dir="rtl"] .phone-number {
    direction: ltr;
    unicode-bidi: embed;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

/* Small phones */
@media (max-width: 374px) {
    [dir="rtl"] .mobile-section {
        padding: 1.5rem 0.5rem;
    }
    
    [dir="rtl"] .mobile-tab-content,
    [dir="rtl"] .mobile-feature-list,
    [dir="rtl"] .mobile-highlight-box {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* Standard phones */
@media (min-width: 375px) and (max-width: 767px) {
    [dir="rtl"] .mobile-section {
        overflow-x: hidden !important;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
    [dir="rtl"] .mobile-section {
        padding: 2rem 2rem;
    }
    
    [dir="rtl"] .mobile-header-inner {
        padding-right: 2rem;
        padding-left: 2rem;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    [dir="rtl"] .mobile-video-hero-slider {
        min-height: 100vh;
    }
}

/* ==========================================
   PRINT STYLES RTL
   ========================================== */

@media print {
    [dir="rtl"] {
        direction: rtl;
    }
    
    [dir="rtl"] * {
        text-align: right;
    }
}

/* ==========================================
   FORCED RTL FIXES FOR STUBBORN ELEMENTS
   ========================================== */

/* Text inputs RTL */
[dir="rtl"] input[type="text"],
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[type="search"],
[dir="rtl"] textarea {
    direction: rtl;
}

/* Select dropdowns RTL */
[dir="rtl"] select {
    direction: rtl;
}


/* ==========================================
   ACCESSIBILITY IMPROVEMENTS FOR RTL
   ========================================== */

/* Focus styles for RTL */
[dir="rtl"] *:focus {
    outline-offset: 2px;
}

/* Skip to content link for RTL */
[dir="rtl"] .skip-to-content {
    right: auto;
    left: 1rem;
}

/* Screen reader only text */
[dir="rtl"] .sr-only {
    direction: rtl;
}

