@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

html[lang="ja"] body {
    font-family: 'Noto Sans JP', 'Inter', system-ui, sans-serif;
}

.lang-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.lang-switcher--top {
    top: 20px;
    bottom: auto;
}

.lang-switcher-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-family: inherit;
    transition: background 0.2s ease, transform 100ms ease-out;
}

.lang-switcher-toggle:hover {
    background: #ffffff;
}

.lang-switcher-toggle:active {
    transform: scale(0.97);
}

.lang-switcher-chevron {
    display: block;
    transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

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

.lang-switcher-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 148px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transform-origin: 100% 100%;
    opacity: 0;
    transform: scale(0.96) translateY(8px);
    pointer-events: none;
    transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.lang-switcher--top .lang-switcher-menu {
    top: calc(100% + 8px);
    bottom: auto;
    transform-origin: 100% 0;
    transform: scale(0.96) translateY(-8px);
}

.lang-switcher.is-open .lang-switcher-menu {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #333333;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 10px;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}

.lang-option:hover {
    background: rgba(0, 0, 0, 0.06);
}

.lang-option[aria-selected="true"] {
    background: #333333;
    color: #ffffff;
}

.lang-option[aria-selected="true"]:hover {
    background: #333333;
    color: #ffffff;
}

@media (max-width: 768px) {
    .lang-switcher {
        bottom: 10px;
        right: 10px;
    }

    .lang-switcher--top {
        top: 10px;
        bottom: auto;
    }

    .lang-switcher-toggle {
        padding: 6px 12px;
        font-size: 12px;
    }

    .lang-option {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lang-switcher-toggle,
    .lang-switcher-chevron,
    .lang-switcher-menu,
    .lang-option {
        transition: none;
    }

    .lang-switcher-menu {
        transform: none;
    }
}
