/* RTL Support */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
    /* Make overall font size smaller for Arabic/Kurdish */
    font-size: 87.5%; /* ~14px when browser default is 16px */
}

html[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

/* Hide/show directional elements */
html[dir="rtl"] .ltr-only {
    display: none !important;
}

html[dir="ltr"] .rtl-only {
    display: none !important;
}

/* Form controls */
html[dir="rtl"] input,
html[dir="rtl"] textarea {
    text-align: right;
}

html[dir="ltr"] input,
html[dir="ltr"] textarea {
    text-align: left;
}

/* Font families */
html[dir="rtl"] {
    font-family: 'Noto Kufi Arabic', system-ui, sans-serif;
}

html[dir="ltr"] {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Layout */
html[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

html[dir="ltr"] .flex-row {
    flex-direction: row;
}

/* Margins and paddings */
html[dir="rtl"] .ml-auto {
    margin-left: unset;
    margin-right: auto;
}

html[dir="rtl"] .mr-auto {
    margin-right: unset;
    margin-left: auto;
}

/* Transitions */
html {
    transition: all 0.2s ease-in-out;
}

/* Ensure content is visible */
body {
    opacity: 1 !important;
    visibility: visible !important;
    background-color: #fff;
}

/* Fix dropdown positioning */
html[dir="rtl"] .origin-top-right {
    right: auto;
    left: 0;
    transform-origin: top left;
}

html[dir="ltr"] .origin-top-right {
    left: auto;
    right: 0;
    transform-origin: top right;
}