/* Phase 1 i18n — language switcher + RTL basics */

.lang-switcher {
    position: relative;
    display: inline-block;
    font-size: 14px;
    margin: 8px 0;
}
.lang-switcher-current {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: inherit;
    user-select: none;
}
.lang-switcher-current::-webkit-details-marker { display: none; }
.lang-switcher[open] .lang-caret { transform: rotate(180deg); }
.lang-caret { transition: transform 0.2s ease; opacity: 0.7; }

.lang-flag {
    border-radius: 2px;
    flex: 0 0 auto;
    object-fit: cover;
}

.lang-switcher-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    max-height: 340px;
    overflow-y: auto;
    background: #15151f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px;
    z-index: 1000;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lang-option:hover { background: rgba(255, 255, 255, 0.08); }
.lang-option.active { background: rgba(79, 110, 247, 0.25); font-weight: 600; }

/* RTL: flip the switcher menu origin and let the document direction handle text */
html[dir="rtl"] .lang-switcher-menu { left: auto; right: 0; }

@media (max-width: 600px) {
    .lang-switcher-menu { grid-template-columns: 1fr; min-width: 180px; }
}
