/* ====================================================
   GSAC i18n  —  Language switcher + RTL support
==================================================== */

/* ---------- Wrapper ---------- */

.lang-switcher {
    position: relative;
    display: inline-block;
    margin-top: 40px;
    margin-left: 12px;
    z-index: 500;
}

/* ---------- Toggle button ---------- */

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 14px;
    background: #fff;
    border: 1.5px solid #35383f;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1c2530;
    transition: .2s;
    white-space: nowrap;
}

.lang-btn:hover {
    background: #f5f8fc;
}

.lang-btn.open {
    border-color: #1f6f8b;
}

/* ---------- Dropdown menu ---------- */

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.lang-menu.open {
    display: flex;
}

.lang-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #1c2530;
    text-align: left;
    transition: .15s;
}

.lang-menu button:hover {
    background: #eef4fb;
}

.lang-menu button.active {
    background: #e3f0fb;
    color: #1f6f8b;
    font-weight: 700;
}


/* ====================================================
   RESPONSIVE
==================================================== */

@media (max-width: 1100px) {

    .lang-switcher {
        margin-left: auto;
        margin-right: 8px;
    }
}

@media (max-width: 900px) {

    .lang-switcher {
        margin-top: 0;
        margin-left: 0;
        order: 2;
    }

    .lang-btn {
        height: 40px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    .lang-btn {
        height: 34px;
        padding: 0 8px;
        font-size: 12px;
    }

    .lang-menu {
        min-width: 150px;
    }

    .lang-menu button {
        padding: 8px 10px;
        font-size: 13px;
    }
}


/* ====================================================
   RTL SUPPORT  (Arabic)
==================================================== */

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Flip directional icons / arrows */
html[dir="rtl"] .arrow-icon svg,
html[dir="rtl"] .confirm-arrow svg {
    transform: scaleX(-1);
}

/* Navbar auto-reverse */
html[dir="rtl"] .topbar,
html[dir="rtl"] .navrow {
    flex-direction: row-reverse;
}

/* Dropdown stays anchored left in RTL */
html[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

/* Text inputs inside forms align to the right */
html[dir="rtl"] input,
html[dir="rtl"] select,
html[dir="rtl"] textarea {
    text-align: right;
}

/* Keep the language switcher itself LTR so flags/order look right */
html[dir="rtl"] .lang-switcher {
    direction: ltr;
}

/* ====================================================
   MOBILE LANGUAGE SWITCHER — collapsible row
   (lives inside the hamburger menu)
==================================================== */

.lang-switcher-mobile {
    display: none;                    /* hidden on desktop */
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .15);
    margin-bottom: 8px;
}

/* ---------- the "Language" toggle row ---------- */

.lang-switcher-mobile .lang-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 16px 10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
}

.lang-switcher-mobile .lang-mobile-toggle .label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher-mobile .lang-mobile-toggle .current {
    color: #ffd055;
    font-weight: 700;
}

.lang-switcher-mobile .lang-mobile-toggle .caret {
    display: inline-block;
    transition: transform .25s ease;
    color: #ffd055;
    font-size: 14px;
}

.lang-switcher-mobile .lang-mobile-toggle.open .caret {
    transform: rotate(180deg);
}

/* ---------- the list of languages (collapsed by default) ---------- */

.lang-switcher-mobile .lang-mobile-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 10px;
}

.lang-switcher-mobile .lang-mobile-list.open {
    max-height: 320px;                 /* enough for 5 items */
    padding: 6px 10px 16px;
}

.lang-switcher-mobile .lang-mobile-list button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: .15s;
}

.lang-switcher-mobile .lang-mobile-list button:hover,
.lang-switcher-mobile .lang-mobile-list button.active {
    background: rgba(255, 208, 85, .18);
    border-color: #ffd055;
    color: #ffd055;
}


/* ------------------------------------------------
   On screens < 900px: hide topbar switcher,
   show the mobile one
----------------------------------------------- */

@media (max-width: 900px) {

    .lang-switcher {
        margin-top: 0;
        margin-left: 0;
        margin-right: -5px;
        order: 2;
    }

    .lang-btn {
        height: 40px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    .lang-btn {
        height: 34px;
        padding: 0 5px;
        font-size: 10px;
    }
}
