/* Language Switcher — universal component for all tenants */
.lang-switcher {
    position: relative;
    display: inline-flex;
    z-index: 1000;
}

.lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(128, 128, 128, 0.25);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lang-switcher__toggle:hover {
    border-color: rgba(128, 128, 128, 0.5);
    background: rgba(128, 128, 128, 0.06);
}

.lang-switcher__chevron {
    transition: transform 0.2s ease;
}

.lang-switcher.open .lang-switcher__chevron {
    transform: rotate(180deg);
}

.lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .lang-switcher__dropdown {
        background: #1a1a2e;
        border-color: rgba(255, 255, 255, 0.1);
    }

    .lang-switcher__item {
        color: #e0e0e0;
    }

    .lang-switcher__item:hover {
        background: rgba(255, 255, 255, 0.06);
    }
}

/* Force dark dropdown on dark-themed sites */
[data-theme="dark"] .lang-switcher__dropdown,
body[style*="background:#0"] .lang-switcher__dropdown,
body[class*="dark"] .lang-switcher__dropdown {
    background: #1a1a2e;
    border-color: rgba(255, 255, 255, 0.1);
}

.lang-switcher.open .lang-switcher__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: #333;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.15s ease;
}

.lang-switcher__item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.lang-switcher__item--active {
    font-weight: 600;
    opacity: 0.6;
    pointer-events: none;
}

.lang-switcher__code {
    font-weight: 600;
    font-size: 0.7rem;
    min-width: 22px;
    opacity: 0.5;
}

.lang-switcher__name {
    flex: 1;
}

/* Scrollbar styling for dropdown */
.lang-switcher__dropdown::-webkit-scrollbar {
    width: 4px;
}

.lang-switcher__dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.lang-switcher__dropdown::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 4px;
}