/* Challenge Arena 2.5.4459 — Global RTL/LTR UI normalization
 * Canonical bidirectional layer for Bootstrap LTR builds used by Admin + Frontend.
 * Country/Select2-specific styling stays in country-selects; general direction rules live here.
 */

/* Direction-aware text utilities and common document behavior. */
html[dir="rtl"] body{text-align:right}
html[dir="rtl"] .text-start{text-align:right!important}
html[dir="rtl"] .text-end{text-align:left!important}
html[dir="ltr"] .text-start{text-align:left!important}
html[dir="ltr"] .text-end{text-align:right!important}
html[dir="rtl"] .float-start{float:right!important}
html[dir="rtl"] .float-end{float:left!important}
html[dir="rtl"] .start-0{left:auto!important;right:0!important}
html[dir="rtl"] .end-0{right:auto!important;left:0!important}

/* Bootstrap logical spacing compatibility when only bootstrap.min.css (LTR) is loaded. */
html[dir="rtl"] .me-0{margin-right:0!important;margin-left:0!important}
html[dir="rtl"] .me-1{margin-right:0!important;margin-left:.25rem!important}
html[dir="rtl"] .me-2{margin-right:0!important;margin-left:.5rem!important}
html[dir="rtl"] .me-3{margin-right:0!important;margin-left:1rem!important}
html[dir="rtl"] .me-4{margin-right:0!important;margin-left:1.5rem!important}
html[dir="rtl"] .me-5{margin-right:0!important;margin-left:3rem!important}
html[dir="rtl"] .me-auto{margin-right:0!important;margin-left:auto!important}
html[dir="rtl"] .ms-0{margin-left:0!important;margin-right:0!important}
html[dir="rtl"] .ms-1{margin-left:0!important;margin-right:.25rem!important}
html[dir="rtl"] .ms-2{margin-left:0!important;margin-right:.5rem!important}
html[dir="rtl"] .ms-3{margin-left:0!important;margin-right:1rem!important}
html[dir="rtl"] .ms-4{margin-left:0!important;margin-right:1.5rem!important}
html[dir="rtl"] .ms-5{margin-left:0!important;margin-right:3rem!important}
html[dir="rtl"] .ms-auto{margin-left:0!important;margin-right:auto!important}
html[dir="rtl"] .pe-0{padding-right:0!important;padding-left:0!important}
html[dir="rtl"] .pe-1{padding-right:0!important;padding-left:.25rem!important}
html[dir="rtl"] .pe-2{padding-right:0!important;padding-left:.5rem!important}
html[dir="rtl"] .pe-3{padding-right:0!important;padding-left:1rem!important}
html[dir="rtl"] .pe-4{padding-right:0!important;padding-left:1.5rem!important}
html[dir="rtl"] .pe-5{padding-right:0!important;padding-left:3rem!important}
html[dir="rtl"] .ps-0{padding-left:0!important;padding-right:0!important}
html[dir="rtl"] .ps-1{padding-left:0!important;padding-right:.25rem!important}
html[dir="rtl"] .ps-2{padding-left:0!important;padding-right:.5rem!important}
html[dir="rtl"] .ps-3{padding-left:0!important;padding-right:1rem!important}
html[dir="rtl"] .ps-4{padding-left:0!important;padding-right:1.5rem!important}
html[dir="rtl"] .ps-5{padding-left:0!important;padding-right:3rem!important}

/* Direction-safe borders and rounded logical edges. */
html[dir="rtl"] .border-start{border-left:0!important;border-right:var(--bs-border-width,1px) var(--bs-border-style,solid) var(--bs-border-color,#dee2e6)!important}
html[dir="rtl"] .border-end{border-right:0!important;border-left:var(--bs-border-width,1px) var(--bs-border-style,solid) var(--bs-border-color,#dee2e6)!important}
html[dir="rtl"] .rounded-start{border-top-left-radius:0!important;border-bottom-left-radius:0!important;border-top-right-radius:var(--bs-border-radius,.375rem)!important;border-bottom-right-radius:var(--bs-border-radius,.375rem)!important}
html[dir="rtl"] .rounded-end{border-top-right-radius:0!important;border-bottom-right-radius:0!important;border-top-left-radius:var(--bs-border-radius,.375rem)!important;border-bottom-left-radius:var(--bs-border-radius,.375rem)!important}

/* Select arrows: same down-chevron in both languages; only its physical position changes. */
.form-select{background-position:right .9rem center!important;padding-right:2.6rem!important}
html[dir="rtl"] .form-select{direction:rtl;text-align:right;background-position:left .9rem center!important;padding-right:.9rem!important;padding-left:2.6rem!important}
html[dir="ltr"] .form-select{direction:ltr;text-align:left;background-position:right .9rem center!important;padding-left:.9rem!important;padding-right:2.6rem!important}
.form-select[multiple],.form-select[size]:not([size="1"]){background-image:none!important;padding-inline-end:.9rem!important}

/* Bootstrap input-group geometry when the document direction is RTL. */
html[dir="rtl"] .input-group{direction:rtl}
html[dir="rtl"] .input-group>:not(:first-child){margin-left:0!important;margin-right:-1px!important}
html[dir="rtl"] .input-group>:first-child{border-top-left-radius:0!important;border-bottom-left-radius:0!important;border-top-right-radius:var(--bs-border-radius,.375rem)!important;border-bottom-right-radius:var(--bs-border-radius,.375rem)!important}
html[dir="rtl"] .input-group>:last-child{border-top-right-radius:0!important;border-bottom-right-radius:0!important;border-top-left-radius:var(--bs-border-radius,.375rem)!important;border-bottom-left-radius:var(--bs-border-radius,.375rem)!important}
html[dir="ltr"] .input-group{direction:ltr}

/* Form controls and checks. */
html[dir="rtl"] .form-control,html[dir="rtl"] textarea,html[dir="rtl"] select{text-align:start}
html[dir="rtl"] input[type="email"],html[dir="rtl"] input[type="url"],html[dir="rtl"] input[type="tel"]{direction:ltr;text-align:left}
html[dir="rtl"] .form-check{padding-right:1.5em;padding-left:0;text-align:right}
html[dir="rtl"] .form-check .form-check-input{float:right;margin-right:-1.5em;margin-left:0}
html[dir="rtl"] .form-switch{padding-right:2.5em;padding-left:0}
html[dir="rtl"] .form-switch .form-check-input{margin-right:-2.5em;margin-left:0;background-position:right center}
html[dir="rtl"] .form-switch .form-check-input:checked{background-position:left center}
html[dir="rtl"] .form-floating>label{right:0;left:auto;width:100%;text-align:right;transform-origin:100% 0}

/* Modal, offcanvas, alert and dropdown physical controls. */
html[dir="rtl"] .modal-header .btn-close,
html[dir="rtl"] .offcanvas-header .btn-close,
html[dir="rtl"] .toast-header .btn-close{margin:-.5rem auto -.5rem -.5rem}
html[dir="rtl"] .alert-dismissible{padding-right:1rem!important;padding-left:3rem!important}
html[dir="rtl"] .alert-dismissible .btn-close{right:auto!important;left:0!important}
html[dir="rtl"] .dropdown-menu-end{right:auto!important;left:0!important;text-align:right}
html[dir="rtl"] .dropdown-toggle::after{margin-left:0!important;margin-right:.255em!important}
html[dir="ltr"] .dropdown-toggle::after{margin-right:0!important;margin-left:.255em!important}

/* Directional icons: flip once at glyph level. Up/down/dropdown icons are intentionally untouched. */
html[dir="rtl"] body:not(.live-tv-public):not(.player-lobby):not(.coordinator-page):not(.tournament-public-display) :is([class*="bi-arrow-right"],[class*="bi-arrow-left"],[class*="bi-chevron-right"],[class*="bi-chevron-left"],[class*="bi-caret-right"],[class*="bi-caret-left"],[class*="bi-box-arrow-right"],[class*="bi-box-arrow-left"])::before{
  display:inline-block!important;transform:scaleX(-1)!important
}

/* Canonical icon + text wrappers. `gap` is safe in both directions. */
.arena-icon-label{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:.5rem!important;min-width:0}
.arena-icon-message{display:flex!important;align-items:flex-start!important;gap:.55rem!important;min-width:0}
.arena-icon-label>.bi,.arena-icon-message>.bi{flex:0 0 auto!important;margin:0!important}
.arena-icon-message>span,.arena-icon-label>span{min-width:0}
.alert>.bi:first-child:not([class*="me-"]):not([class*="ms-"]),
.form-text>.bi:first-child:not([class*="me-"]):not([class*="ms-"]),
.invalid-feedback>.bi:first-child:not([class*="me-"]):not([class*="ms-"]){display:inline-block;margin-inline-end:.5rem!important}

/* Keep semantic alignment with the selected document language. */
html[dir="rtl"] :is(.modal-title,.dropdown-item,.list-group-item,.form-label){text-align:right}
html[dir="ltr"] :is(.modal-title,.dropdown-item,.list-group-item,.form-label){text-align:left}

@media(max-width:575.98px){
  .form-select{background-position:right .75rem center!important;padding-right:2.45rem!important}
  html[dir="rtl"] .form-select{background-position:left .75rem center!important;padding-right:.8rem!important;padding-left:2.45rem!important}
}
