/* Premium language selector and suggestion banner */

.language-switcher {
    position: relative;
}

.language-switcher-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: Inter, "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", "Segoe UI", Arial, sans-serif;
    background: #ffffff;
    border: 1px solid rgba(0, 102, 204, 0.22);
    border-radius: 999px;
    color: #123a5f;
    font-weight: 700;
    font-size: 0.86rem;
    line-height: 1;
    min-height: 40px;
    padding: 0 0.8rem;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.language-switcher-toggle:hover {
    border-color: rgba(0, 102, 204, 0.4);
    background: #f4f9ff;
}

.language-switcher-toggle:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
}

.language-switcher-flag {
    font-size: 1rem;
    line-height: 1;
}

.language-switcher-code {
    letter-spacing: 0.02em;
}

.language-switcher-chevron {
    font-size: 0.8rem;
    color: #325777;
    transition: transform 150ms ease;
}

.language-switcher-toggle[aria-expanded="true"] .language-switcher-chevron {
    transform: rotate(180deg);
}

.language-switcher-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(7, 22, 39, 0.4);
    opacity: 0;
    transition: opacity 200ms ease;
    z-index: 1240;
}

.language-switcher-backdrop.open {
    opacity: 1;
}

.language-switcher-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.65rem);
    font-family: Inter, "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Devanagari", "Segoe UI", Arial, sans-serif;
    width: 300px;
    max-height: min(680px, calc(100vh - 32px));
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(0, 102, 204, 0.14);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(5, 37, 68, 0.18);
    padding: 12px 12px 16px;
    z-index: 1260;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
    scrollbar-gutter: stable;
}

.language-switcher-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.language-switcher-sheet-header {
    display: none;
}

.language-switcher-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.language-switcher-menu li {
    margin: 0;
}

.language-switcher-menu + .language-switcher-menu {
    margin-top: 2px;
}

.language-switcher-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 12px;
    color: #123a5f;
    font-size: 0.96rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}

.language-switcher-item:hover,
.language-switcher-item:focus-visible {
    background: rgba(0, 102, 204, 0.09);
}

.language-switcher-item:focus-visible {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
}

.language-switcher-item[aria-current="true"] {
    background: rgba(0, 102, 204, 0.13);
    color: #0f4f85;
}

.language-item-flag {
    width: 1.5rem;
    min-width: 1.5rem;
    text-align: center;
    line-height: 1;
    font-size: 1.08rem;
}

.language-item-name {
    flex: 1;
    line-height: 1.32;
}

.language-item-check {
    width: 1rem;
    min-width: 1rem;
    text-align: center;
    font-weight: 800;
    color: #0066cc;
}

.language-switcher-divider {
    position: sticky;
    top: -12px;
    z-index: 1;
    margin: 10px 4px 8px;
    padding-top: 10px;
    padding-bottom: 8px;
    border-top: 1px solid rgba(0, 102, 204, 0.14);
    background: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #557a9b;
}

.language-suggestion-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1300;
    background: #0f2e4a;
    color: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(0, 212, 255, 0.25);
    box-shadow: 0 14px 34px rgba(5, 25, 44, 0.35);
    padding: 1rem;
}

.language-suggestion-banner p {
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    line-height: 1.45;
}

.language-suggestion-actions {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.language-suggestion-actions button {
    border: 0;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 150ms ease, opacity 150ms ease;
}

.language-suggestion-actions button:hover {
    transform: translateY(-1px);
}

.language-suggestion-actions button:focus-visible {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.language-suggestion-accept {
    background: #00d4ff;
    color: #0a1f33;
}

.language-suggestion-dismiss {
    background: #1e466b;
    color: #d9ebff;
}

@media (max-width: 768px) {
    .language-switcher {
        width: 100%;
        order: -1;
    }

    .language-switcher-toggle {
        width: calc(100% - 2.6rem);
        margin: 0.85rem 1.3rem;
        justify-content: space-between;
        min-height: 44px;
    }

    .language-switcher-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: auto;
        max-height: min(78vh, 620px);
        border-radius: 20px 20px 0 0;
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        padding: 14px 12px 16px;
        transform: translateY(105%);
    }

    .language-switcher-panel.open {
        transform: translateY(0);
    }

    .language-switcher-sheet-header {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px 0 10px;
    }

    .language-switcher-sheet-title {
        margin: 0;
        font-size: 1rem;
        font-weight: 800;
        color: #113f65;
    }

    .language-switcher-item {
        min-height: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-switcher-toggle,
    .language-switcher-chevron,
    .language-switcher-panel,
    .language-switcher-backdrop,
    .language-switcher-item,
    .language-suggestion-actions button {
        transition: none;
    }
}
