/* ============================================================
   Language Switcher Component
   ============================================================ */

.language-switcher {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.language-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    background: #ffffff;
    border: 1px solid #d8dde3;
    border-radius: 999px;
    color: #111111;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.language-switcher__toggle:hover {
    background: #f8fafc;
    border-color: #bcc7d4;
    box-shadow: 0 10px 22px rgba(17, 17, 17, 0.08);
}

.language-switcher__toggle:focus {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.language-switcher__globe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4a5565;
}

.language-switcher__current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    min-height: 1.45rem;
    padding: 0;
    border-radius: 999px;
    color: #111111;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
}

.language-switcher__text {
    color: #4a5565;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.language-switcher__icon {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.language-switcher__toggle[aria-expanded="true"] .language-switcher__icon {
    transform: rotate(180deg);
}

.language-switcher__menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 120px;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    background: #ffffff;
    border: 1px solid #dfe5ec;
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(17, 17, 17, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.language-switcher__toggle[aria-expanded="true"] ~ .language-switcher__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-switcher__item {
    margin: 0;
}

.language-switcher__link {
    display: flex;
    align-items: center;
    padding: 0.7rem 0.8rem;
    color: #1f2933;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.language-switcher__link:hover {
    background: #f5f8fb;
}

.language-switcher__link:focus {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.language-switcher__link--active {
    color: #111111;
    background: #eef3f8;
}

.language-switcher__label {
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .language-switcher__toggle {
        min-height: 34px;
        padding: 0.375rem 0.65rem;
        gap: 0.4rem;
    }

    .language-switcher__current {
        min-width: 1.75rem;
        min-height: 1.35rem;
    }

    .language-switcher__menu {
        right: 0;
        left: auto;
        min-width: 112px;
    }
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .language-switcher__toggle,
    .language-switcher__icon,
    .language-switcher__menu,
    .language-switcher__link {
        transition: none;
    }
}
