/* AlAhleia - Arabic / right-to-left overrides.
   Loaded after app.css, and only when the UI culture is Arabic (see App.razor).
   Bootstrap's own RTL build (bootstrap.rtl.min.css) already mirrors its utilities (ms-/me-, text-start, offcanvas, ...). */

/* ---- Font: Poppins has no Arabic letters, so use Cairo (also for Radzen components) */
:root {
    --rz-text-font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ".rzi" = Radzen icon buttons (e.g. the dropdown clear button): they must keep the icon font, otherwise the icon name shows as text */
html[dir="rtl"] body,
html[dir="rtl"] button:not(.rzi),
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ---- Direction arrows (Next / Previous icons) point the other way */
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-left,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .bi-arrow-left,
html[dir="rtl"] .bi-arrow-right,
html[dir="rtl"] .bi-chevron-left,
html[dir="rtl"] .bi-chevron-right {
    display: inline-block;
    transform: scaleX(-1);
}

/* ---- Wizard progress: the filled part grows from the right edge */
html[dir="rtl"] .journey-progress {
    transform-origin: right center;
}

/* ---- Values that are always read left-to-right (numbers, e-mail, IDs, plates) */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[inputmode="numeric"],
html[dir="rtl"] .ltr,
html[dir="rtl"] .otp-box {
    direction: ltr;
}

html[dir="rtl"] .otp-input-group {
    direction: ltr; /* the six code boxes stay in typing order */
}

/* ---- Mobile "stacked" tables: label on one side, value on the other */
html[dir="rtl"] .stacked-table td {
    text-align: left;
}

html[dir="rtl"] .stacked-table td::before {
    float: right;
}

/* ---- Misc physical-direction rules from app.css */
html[dir="rtl"] .traveler-card .card-actions {
    text-align: left;
}

html[dir="rtl"] .has-value.form-select {
    padding-right: 0.75rem;
    padding-left: 2.2rem;
}

html[dir="rtl"] .validation-errors ul {
    padding-left: 0;
    padding-right: 1.5rem;
}

html[dir="rtl"] .validation-summary-errors {
    border-left: 0;
    border-right: 4px solid #dc3545;
}

/* ---- Motor New / Renew / Add-Ons toggle: the sliding highlight is positioned from the right edge and moves leftwards */
html[dir="rtl"] .mode-toggle-slider {
    left: auto;
    right: 4px;
}

html[dir="rtl"] .mode-toggle-slider.is-right {
    transform: translateX(-100%);
}

html[dir="rtl"] .mode-toggle-slider.is-addons {
    transform: translateX(-200%);
}

/* ---- Language switch in the header (also used in LTR, see app.css) */
html[dir="rtl"] .lang-switch-btn {
    letter-spacing: 0;
}
