/* microsys/static/main/css/language.css
 * ======================================
 * Styles for the language picker on the options page
 * and any LTR/RTL override utilities.
 */

/* ─── Language Picker ─── */
.lang-option {
    transition: all 0.2s ease;
    background: var(--bs-light, rgba(0,0,0,0.02));
    border: 2px solid transparent !important;
}

.lang-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
    border-color: var(--bs-primary, #0d6efd) !important;
}

.lang-option.lang-active {
    border-color: var(--bs-primary, #0d6efd) !important;
    background: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb, 13, 110, 253), 0.15);
}

/* ─── Direction Utilities ─── */
/* Use these to force direction on specific elements regardless of page dir */
.dir-ltr {
    direction: ltr;
    text-align: left;
}

.dir-rtl {
    direction: rtl;
    text-align: right;
}

/* Keep LTR content while aligning it to the page's inline end */
.dir-ltr-inline-end {
    direction: ltr;
}

[dir="ltr"] .dir-ltr-inline-end {
    text-align: right;
}

[dir="rtl"] .dir-ltr-inline-end {
    text-align: left;
}

[dir="ltr"] .dir-ltr-inline-end.d-flex {
    justify-content: flex-end !important;
}

[dir="rtl"] .dir-ltr-inline-end.d-flex {
    justify-content: flex-start !important;
}

/* ─── LTR-specific adjustments ─── */
/* Fix any custom CSS that uses physical properties instead of logical ones */
[dir="ltr"] .sidebar-toggle {
    margin-left: 0;
    margin-right: 0.5rem;
}

[dir="ltr"] .dropdown-menu-start {
    /* Bootstrap handles this via RTL/LTR CSS, but just in case */
    right: auto;
    left: 0;
}

/* ─── Emoji Flag Web Font Polyfill for Windows ─── */
@font-face {
    font-family: 'Twemoji Country Flags';
    unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065-E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
    src: url('../../fonts/TwemojiCountryFlags.woff2') format('woff2');
    font-display: swap;
}

.emoji-flag,
.lang-option span {
    font-family: 'Twemoji Country Flags', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif !important;
}
