/**
 * Language Switcher
 * Стили для ls-* классов, генерируемых lang-switcher.js.
 * Поддерживает data-lang-switcher="compact" для компактного вида (только флаг).
 */

/* Wrap */
.ls-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Current (toggle button) */
.ls-current {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    min-width: 120px;
    transition: all 0.2s ease;
    user-select: none;
}

.ls-current:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.35);
}

/* Flag icon inside button */
.ls-current .fi {
    flex-shrink: 0;
}

/* Language name */
.ls-name {
    white-space: nowrap;
}

/* Arrow */
.ls-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.ls-current[aria-expanded="true"] .ls-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.ls-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    transform: translateX(-20px);
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card, #1a1e4d);
    border: 1px solid var(--border-dim, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    padding: 4px 0;
    margin: 0;
    list-style: none;
}

.ls-dropdown.ls-open {
    display: block;
}

/* Dropdown item */
.ls-option,
.ls-option:hover,
.ls-option:focus,
.ls-option:visited {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none !important;
}

.ls-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Compact mode: only flag, no name/arrow */
[data-lang-switcher="compact"] .ls-current {
    min-width: auto;
    padding: 6px 10px;
    background: transparent;
    border: none;
}

[data-lang-switcher="compact"] .ls-current:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Scrollbar */
.ls-dropdown::-webkit-scrollbar {
    width: 4px;
}
.ls-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.ls-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
