/* ============================================================
   iris-lang-selector — language selector dropdown component
   Reusable across all application contexts (login, header, etc.)
   ============================================================ */

/* ── Host wrapper ─────────────────────────────────────────── */
.iris-lang-selector {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
}

/* ── Toggle button ────────────────────────────────────────── */
.iris-lang-selector__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 8px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    cursor: pointer;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    white-space: nowrap;
    user-select: none;
}

.iris-lang-selector__toggle:hover,
.iris-lang-selector--open .iris-lang-selector__toggle {
    border-color: #008aff;
    box-shadow: 0 0 0 2px rgba(0, 138, 255, 0.15);
}

/* ── Flag (image) ─────────────────────────────────────────── */
.iris-lang-selector__flag {
    width: 20px;
    height: 15px;
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

/* ── Language code label (e.g. PT, EN, ES) ───────────────── */
.iris-lang-selector__code {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #444;
}

/* ── Chevron icon ─────────────────────────────────────────── */
.iris-lang-selector__chevron {
    font-size: 9px;
    color: #999;
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.iris-lang-selector--open .iris-lang-selector__chevron {
    transform: rotate(180deg);
}

/* ── Dropdown list — opens upward by default ──────────────── */
.iris-lang-selector__dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    min-width: 155px;
    background: #ffffff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.07);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    z-index: 9999;
}

/* ── Modifier: opens downward (for header / top-of-page use) */
.iris-lang-selector--down .iris-lang-selector__dropdown {
    top: calc(100% + 6px);
    bottom: auto;
}

/* ── Individual option row ────────────────────────────────── */
.iris-lang-selector__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    color: #495057;
    font-size: 12px;
    transition: background-color 0.15s, color 0.15s;
    list-style: none;
}

.iris-lang-selector__option:hover {
    background-color: rgba(0, 138, 255, 0.07);
    color: #008aff;
}

.iris-lang-selector__option--active {
    color: #008aff;
    font-weight: 600;
    background-color: rgba(0, 138, 255, 0.05);
}

/* ── Option description text ──────────────────────────────── */
.iris-lang-selector__desc {
    font-size: 12px;
    line-height: 1.3;
}

/* ── Layout helpers (context-agnostic) ────────────────────── */

/* Centers the selector horizontally — use in login card footer */
.iris-lang-selector-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Right-aligns the selector — use in application header/navbar */
.iris-lang-selector-wrap--right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
