/* =====================================
   RTL Base Setup for Plugin
   ===================================== */

/* الحاوية العامة لكل البلغ-إن */
body.rtl .my-plugin-wrapper {
    direction: rtl;
    text-align: right;
}

/* الحقول */
body.rtl .my-plugin-wrapper input,
body.rtl .my-plugin-wrapper textarea,
body.rtl .my-plugin-wrapper select {
    direction: rtl;
    text-align: right;
}

/* استثناءات مهمة (تبقى LTR) */
body.rtl .my-plugin-wrapper input[type="email"],
body.rtl .my-plugin-wrapper input[type="url"],
body.rtl .my-plugin-wrapper input[type="number"] {
    direction: ltr;
    text-align: left;
}

/* الأرقام داخل العناصر */
body.rtl .my-plugin-wrapper .number,
body.rtl .my-plugin-wrapper .count,
body.rtl .my-plugin-wrapper .price {
    direction: ltr;
    unicode-bidi: isolate;
}

/* العناصر التي غالبًا تستخدم flex */
body.rtl .my-plugin-wrapper .flex-row {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}

/* محاذاة عامة للأزرار */
body.rtl .my-plugin-wrapper .button-group {
    text-align: right;
}

body.rtl .ia-tx-summary {
    text-align: right;
}

body.rtl .ia-tx-summary-main {
    flex: 1 1 auto;
}

body.rtl .ia-tx-meta {
    text-align: right;
    margin-right: 0;
    margin-left: auto;
}

body.rtl .ia-tx-type,
body.rtl .ia-tx-date {
    text-align: right;
}

/* =====================================
   Deposit Form RTL Fix
   ===================================== */

body.rtl .ia-deposit-form {
    direction: rtl;
    text-align: right;
}

body.rtl .ia-deposit-form h3 {
    text-align: right;
}

body.rtl .ia-field label {
    text-align: right;
}

body.rtl .ia-note {
    text-align: right;
}

body.rtl .ia-message {
    text-align: right;
}

body.rtl .ia-error-box,
body.rtl .ia-copy-success {
    text-align: right;
}

body.rtl .ia-field input,
body.rtl .ia-field select,
body.rtl .ia-wallet-address {
    text-align: right;
}

body.rtl .ia-actions {
    justify-content: flex-start;
}

body.rtl .ia-deposit-steps {
    justify-content: flex-start;
}

body.rtl .ia-wallet-box {
    text-align: right;
}

body.rtl .ia-wallet-top {
    flex-direction: row-reverse;
}

body.rtl .ia-wallet-title {
    text-align: right;
}

body.rtl .ia-confirm {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .ia-confirm label {
    text-align: right;
}

body.rtl .ia-confirm input[type="checkbox"] {
    margin-top: 3px;
}

/* الحقول التي الأفضل أن تبقى LTR */
body.rtl #ia_amount,
body.rtl #ia_tx_hash,
body.rtl .ia-wallet-address {
    direction: ltr;
    text-align: left;
}

/* select يبقى نصه بمحاذاة اليمين */
body.rtl #ia_currency,
body.rtl #ia_network {
    direction: rtl;
    text-align: right;
}

@media (max-width: 767px) {
    body.rtl .ia-deposit-form h3,
    body.rtl .ia-field label,
    body.rtl .ia-note,
    body.rtl .ia-message,
    body.rtl .ia-error-box,
    body.rtl .ia-copy-success,
    body.rtl .ia-wallet-title {
        text-align: right;
    }
}

/* =====================================
   Transfer Profit / Invest Profit /
   Invest Uninvested / Stop Investment RTL Fix
   ===================================== */

body.rtl .ia-transfer-profit-form,
body.rtl .ia-invest-profit-form,
body.rtl .ia-invest-uninvested-form,
body.rtl .ia-stop-investment-form {
    direction: rtl;
    text-align: right;
}

/* العناوين الرئيسية */
body.rtl .ia-transfer-profit-form h3,
body.rtl .ia-invest-profit-form h3,
body.rtl .ia-invest-uninvested-form h3,
body.rtl .ia-stop-investment-form h3 {
    text-align: right;
}

/* الرسائل */
body.rtl .ia-transfer-profit-message,
body.rtl .ia-invest-profit-message,
body.rtl .ia-invest-uninvested-message,
body.rtl .ia-stop-investment-message {
    text-align: right;
}

/* الصناديق العلوية */
body.rtl .ia-transfer-profit-info,
body.rtl .ia-invest-profit-info,
body.rtl .ia-invest-uninvested-info,
body.rtl .ia-stop-investment-info {
    justify-content: flex-start;
}

/* الشارات */
body.rtl .ia-transfer-profit-badge,
body.rtl .ia-invest-profit-badge,
body.rtl .ia-invest-uninvested-badge,
body.rtl .ia-stop-investment-badge {
    text-align: right;
}

/* النصوص التوضيحية */
body.rtl .ia-transfer-profit-note,
body.rtl .ia-invest-profit-note,
body.rtl .ia-invest-uninvested-note,
body.rtl .ia-stop-investment-note,
body.rtl .ia-transfer-profit-help,
body.rtl .ia-invest-profit-help,
body.rtl .ia-invest-uninvested-help,
body.rtl .ia-stop-investment-help {
    text-align: right;
}

/* الحقول والعناوين */
body.rtl .ia-transfer-profit-field label,
body.rtl .ia-invest-profit-field label,
body.rtl .ia-invest-uninvested-field label,
body.rtl .ia-stop-investment-field label {
    text-align: right;
}

body.rtl .ia-transfer-profit-field,
body.rtl .ia-invest-profit-field,
body.rtl .ia-invest-uninvested-field,
body.rtl .ia-stop-investment-field {
    text-align: right;
}

/* رسائل الخطأ */
body.rtl .ia-transfer-profit-error,
body.rtl .ia-invest-profit-error,
body.rtl .ia-invest-uninvested-error,
body.rtl .ia-stop-investment-error {
    text-align: right;
}

/* الأزرار */
body.rtl .ia-transfer-profit-actions,
body.rtl .ia-invest-profit-actions,
body.rtl .ia-invest-uninvested-actions,
body.rtl .ia-stop-investment-actions {
    justify-content: flex-start;
}

/* الحقول الرقمية تظل LTR */
body.rtl #ia_transfer_profit_amount,
body.rtl #ia_invest_profit_amount,
body.rtl #ia_invest_uninvested_amount,
body.rtl #ia_stop_investment_amount {
    direction: ltr;
    text-align: left;
}

@media (max-width: 767px) {
    body.rtl .ia-transfer-profit-form h3,
    body.rtl .ia-invest-profit-form h3,
    body.rtl .ia-invest-uninvested-form h3,
    body.rtl .ia-stop-investment-form h3,
    body.rtl .ia-transfer-profit-note,
    body.rtl .ia-invest-profit-note,
    body.rtl .ia-invest-uninvested-note,
    body.rtl .ia-stop-investment-note,
    body.rtl .ia-transfer-profit-help,
    body.rtl .ia-invest-profit-help,
    body.rtl .ia-invest-uninvested-help,
    body.rtl .ia-stop-investment-help,
    body.rtl .ia-transfer-profit-message,
    body.rtl .ia-invest-profit-message,
    body.rtl .ia-invest-uninvested-message,
    body.rtl .ia-stop-investment-message,
    body.rtl .ia-transfer-profit-error,
    body.rtl .ia-invest-profit-error,
    body.rtl .ia-invest-uninvested-error,
    body.rtl .ia-stop-investment-error,
    body.rtl .ia-transfer-profit-field label,
    body.rtl .ia-invest-profit-field label,
    body.rtl .ia-invest-uninvested-field label,
    body.rtl .ia-stop-investment-field label {
        text-align: right;
    }
}

/* =====================================
   Transaction History Mobile RTL Fix
   ===================================== */

@media (max-width: 767px) {
    body.rtl .ia-tx-summary {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        grid-template-areas:
            "main chevron"
            "amount status" !important;
        align-items: start !important;
        gap: 12px 10px !important;
        padding: 16px !important;
        text-align: right !important;
    }

    body.rtl .ia-tx-summary-main {
        grid-area: main !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    body.rtl .ia-tx-meta {
        min-width: 0 !important;
        text-align: right !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    body.rtl .ia-tx-type {
        font-size: 15px !important;
        line-height: 1.4 !important;
        word-break: break-word !important;
        text-align: right !important;
        margin: 0 !important;
    }

    body.rtl .ia-tx-date {
        margin-top: 4px !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        word-break: break-word !important;
        text-align: right !important;
    }

    body.rtl .ia-tx-icon {
        display: none !important;
    }

    body.rtl .ia-tx-summary-right {
        display: contents !important;
    }

    body.rtl .ia-tx-amount {
        grid-area: amount !important;
        min-width: 0 !important;
        text-align: left !important;
        direction: ltr !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-self: start !important;
        align-self: center !important;
    }

    body.rtl .ia-tx-amount-value {
        font-size: 14px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
    }

    body.rtl .ia-tx-amount-currency {
        font-size: 11px !important;
        white-space: nowrap !important;
        margin-top: 3px !important;
    }

    body.rtl .ia-tx-status {
        grid-area: status !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        justify-self: end !important;
        align-self: center !important;
    }

    body.rtl .ia-tx-chevron {
        grid-area: chevron !important;
        flex: 0 0 auto !important;
        justify-self: end !important;
        align-self: start !important;
        margin-top: 2px !important;
    }
}



