/* ==========================================================================
   Umayya RTL Styles — Arabic Layout Overrides
   Auto-loaded by WordPress when locale is Arabic (ar)
   ========================================================================== */

/* Typography */
html[dir="rtl"] body,
html[dir="rtl"] .entry-content,
html[dir="rtl"] .widget {
    font-family: 'Noto Sans Arabic', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    line-height: 1.8;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: 'Tajawal', 'Noto Sans Arabic', sans-serif;
}

/* LearnDash course content RTL adjustments */
html[dir="rtl"] .learndash-wrapper .ld-item-list-item {
    text-align: right;
}

html[dir="rtl"] .learndash-wrapper .ld-status-icon {
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] .learndash-wrapper .ld-progress-stats {
    direction: rtl;
}

html[dir="rtl"] .learndash-wrapper .ld-breadcrumbs {
    direction: rtl;
}

/* LearnDash course navigation */
html[dir="rtl"] .learndash-wrapper .ld-lesson-item-preview-heading {
    padding-right: 0;
    padding-left: 15px;
}

html[dir="rtl"] .learndash-wrapper .ld-expand-button {
    left: 0;
    right: auto;
}

/* WooCommerce RTL adjustments */
html[dir="rtl"] .woocommerce .product .price {
    direction: ltr;
    unicode-bidi: embed;
}

html[dir="rtl"] .woocommerce .woocommerce-ordering {
    float: left;
}

html[dir="rtl"] .woocommerce .woocommerce-result-count {
    float: right;
}

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

html[dir="rtl"] .woocommerce table.cart td.actions .coupon {
    float: right;
}

/* Elementor widgets RTL */
html[dir="rtl"] .elementor-widget-container {
    text-align: right;
}

html[dir="rtl"] .elementor-icon-list-items {
    padding-right: 0;
}

html[dir="rtl"] .elementor-icon-list-icon {
    margin-left: 10px;
    margin-right: 0;
}

/* Umayya custom components RTL */
html[dir="rtl"] .umayya-course-card {
    text-align: right;
}

html[dir="rtl"] .umayya-progress-bar-fill {
    float: right;
}

html[dir="rtl"] .umayya-star-rating {
    direction: ltr;
    display: inline-flex;
}

/* Form elements */
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

/* Breadcrumbs separator */
html[dir="rtl"] .trail-items li::after {
    content: "\00bb";
    transform: scaleX(-1);
}

/* Navigation menus */
html[dir="rtl"] .main-navigation ul ul {
    left: auto;
    right: 0;
}

html[dir="rtl"] .main-navigation ul ul ul {
    left: auto;
    right: 100%;
}

/* ===================================================
   LearnDash RTL overrides (T058)
   =================================================== */

/* Lesson navigation arrows */
.learndash-wrapper .ld-nav-item .ld-nav-item-arrow {
    transform: scaleX(-1);
}

/* Lesson content container */
.learndash-wrapper .ld-lesson-topic-list {
    direction: rtl;
    text-align: right;
}

/* Course progress bar */
.learndash-wrapper .ld-progress-bar {
    direction: ltr; /* progress bars always LTR */
}

/* Topic list icons */
.learndash-wrapper .ld-item-list-item-preview {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Assignment upload area */
.learndash-wrapper .learndash_post_sfwd-assignment .entry-content {
    text-align: right;
}

/* Quiz navigation */
.learndash-wrapper .wpProQuiz_button_container {
    text-align: left; /* Keep quiz buttons LTR */
}

/* Mobile lesson nav (T058) */
@media (max-width: 768px) {
    .learndash-wrapper .ld-course-navigation {
        padding-right: 0;
        padding-left: 0;
    }
    .learndash-wrapper .ld-course-navigation-toggle {
        right: auto;
        left: 1rem;
    }
}

/* Focus mode sidebar — slides from right in RTL */
html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-sidebar {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-sidebar.is-open {
    transform: translateX(0);
}

/* Focus mode layout — sidebar on right, content on left in RTL */
html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-body {
    flex-direction: row-reverse;
}

/* Prev/Next nav arrows — flip direction in RTL */
html[dir="rtl"] .learndash-wrapper .ld-nav-previous .ld-icon,
html[dir="rtl"] .learndash-wrapper .ld-nav-next .ld-icon {
    transform: scaleX(-1);
}

/* Swap prev/next visual order in RTL */
html[dir="rtl"] .learndash-wrapper .ld-lesson-navigation,
html[dir="rtl"] .learndash-wrapper .ld-navigation {
    flex-direction: row-reverse;
}

/* Course navigation item indentation — RTL */
html[dir="rtl"] .learndash-wrapper .ld-item-list .ld-item-list-item .ld-item-list-item-preview {
    padding-right: 1.5rem;
    padding-left: 0;
}

html[dir="rtl"] .learndash-wrapper .ld-item-list .ld-item-list-item-preview .ld-icon {
    margin-right: 0;
    margin-left: 8px;
}

/* Lesson section heading chevron — flip in RTL */
html[dir="rtl"] .learndash-wrapper .ld-section-heading .ld-icon {
    transform: scaleX(-1);
}

/* Quiz answer labels — RTL padding */
html[dir="rtl"] .learndash-wrapper .wpProQuiz_questionList label {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .learndash-wrapper .wpProQuiz_questionList input[type="radio"],
html[dir="rtl"] .learndash-wrapper .wpProQuiz_questionList input[type="checkbox"] {
    margin-inline-end: 0;
    margin-inline-start: 10px;
}

/* Progress stats text alignment */
html[dir="rtl"] .learndash-wrapper .ld-progress .ld-progress-heading {
    text-align: right;
}

/* Assignment upload — RTL */
html[dir="rtl"] .learndash-wrapper .learndash-upload-assignment label {
    text-align: right;
    display: block;
}

/* Breadcrumb separator — flip chevron for RTL */
html[dir="rtl"] .learndash-wrapper .ld-breadcrumbs .ld-breadcrumbs-segments span.ld-icon {
    transform: scaleX(-1);
    display: inline-block;
}

/* Focus header title alignment */
html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-header .ld-focus-header-title {
    text-align: right;
}

/* Mobile RTL — sidebar slides from right */
@media (max-width: 767px) {
    html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-sidebar {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    html[dir="rtl"] .learndash-wrapper .ld-focus .ld-focus-sidebar.is-open {
        transform: translateX(0);
    }

    html[dir="rtl"] .learndash-wrapper .ld-course-navigation-toggle {
        left: auto;
        right: 1rem;
    }
}

/* LearnDash assignment upload UI — RTL alignment */
.rtl .learndash-wrapper .ld-assignment-upload-message,
.rtl .learndash-wrapper .ld-upload-status,
.rtl .learndash-wrapper .ld-assignment-list {
    direction: rtl;
    text-align: right;
}
