/* assets/global-lang.css (v7.1.0) - NERCIA 全サイト共通 31言語セレクターモーダル */

/* 旧簡易スイッチャー＆Google翻訳上部バナーの完全非表示 */
#nercia-lang-toggle,
.nav-lang-container,
#mobileLangSelector,
.cb-lang-toggle,
.ui-language-select,
.floating-lang-pill:not(.nercia-lang-pill),
.lang-switcher-wrap:not(.nercia-lang-wrapper) {
    display: none !important;
}
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover {
    display: none !important;
    visibility: hidden !important;
}
body {
    top: 0px !important;
    position: static !important;
}
#google_translate_element {
    position: fixed !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0.01 !important;
    pointer-events: none !important;
    z-index: -1 !important;
    display: block !important;
    visibility: visible !important;
}
#google_translate_element .skiptranslate,
#google_translate_element select.goog-te-combo {
    display: block !important;
    visibility: visible !important;
}
font {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* スイッチャーコンテナ */
.nercia-lang-wrapper {
    position: relative;
    display: inline-block;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}

.nercia-lang-floating {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 999990;
}

/* ヘッダーピルボタン */
.nercia-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(10, 16, 29, 0.95);
    border: 1.5px solid #0088cc;
    border-radius: 9999px;
    padding: 5px 14px;
    color: #ffffff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 136, 204, 0.25);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}
.nercia-lang-pill:hover {
    border-color: #38bdf8;
    background: rgba(15, 23, 42, 1);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}
.nercia-lang-pill .pill-code {
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    white-space: nowrap;
}
.nercia-lang-pill .pill-name {
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}
.nercia-lang-pill .pill-arrow {
    font-size: 8px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    margin-left: 2px;
    white-space: nowrap;
}
.nercia-lang-pill.active .pill-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   31言語 取引所スタイル・セレクターモーダル (#nerciaLangModalOverlay)
   ========================================================================== */
.nercia-lang-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 16, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
}
.nercia-lang-modal-overlay.show {
    display: flex;
    animation: nlmOverlayFade 0.16s ease-out forwards;
}
@keyframes nlmOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.nercia-lang-modal {
    width: 100%;
    max-width: 660px;
    max-height: min(86vh, 760px);
    background: #181c27;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #f8fafc;
    animation: nlmModalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes nlmModalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.nlm-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px 12px;
}
.nlm-tab-title {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.03em;
}
.nlm-tab-bar {
    display: block;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: #2563eb;
}
.nlm-close-btn {
    position: absolute;
    right: 16px;
    top: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 17px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.nlm-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nlm-search-wrap {
    margin: 0 20px 12px;
    position: relative;
    display: flex;
    align-items: center;
}
.nlm-search-ico {
    position: absolute;
    left: 13px;
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
}
.nlm-search-input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    border-radius: 10px;
    background: #262c3a;
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #f8fafc;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease;
}
.nlm-search-input::placeholder {
    color: #7c8698;
}
.nlm-search-input:focus {
    border-color: #3b82f6;
}

.nlm-body {
    padding: 4px 20px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
    -webkit-overflow-scrolling: touch;
}
.nlm-sec-title {
    font-size: 12px;
    font-weight: 700;
    color: #7c8698;
    margin: 4px 2px 10px;
    letter-spacing: 0.03em;
}
.nlm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.nlm-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 11px;
    background: transparent;
    border: 1px solid transparent;
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease;
}
.nlm-card:hover {
    background: rgba(255, 255, 255, 0.055);
}
.nlm-card.active {
    background: #282f40;
    border-color: rgba(148, 163, 184, 0.22);
}
.nlm-card-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.nlm-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nlm-card-code {
    font-size: 12px;
    font-weight: 600;
    color: #8590a3;
    line-height: 1.15;
}
.nlm-card-check {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    display: inline-flex;
}
.nlm-card-check svg {
    width: 19px;
    height: 19px;
}
.nlm-empty {
    text-align: center;
    padding: 32px 12px;
    color: #8590a3;
    font-size: 13.5px;
}

/* モバイル最適化（2列グリッド＋ボトムシート風で長文言語名も切れずに快適タップ） */
@media (max-width: 640px) {
    .nercia-lang-floating {
        top: 10px;
        right: 12px;
    }
    .nercia-lang-pill {
        padding: 4px 10px;
        font-size: 12px;
        gap: 5px;
    }
    .nercia-lang-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .nercia-lang-modal {
        max-width: 100%;
        max-height: 86dvh;
        border-radius: 22px 22px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .nlm-search-wrap {
        margin: 0 14px 10px;
    }
    .nlm-search-input {
        font-size: 16px;
    }
    .nlm-body {
        padding: 4px 14px 20px;
    }
    .nlm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }
    .nlm-card {
        padding: 10px 11px;
    }
    .nlm-card-name {
        font-size: 13.5px;
    }
}

/* NERCIA ORDERFLOW ヘッダー統合スタイル */
.bm-menubar-right .nercia-lang-wrapper {
    display: inline-flex;
    align-items: center;
    margin: 0 3px;
    vertical-align: middle;
}
.bm-menubar-right .nercia-lang-pill {
    padding: 2px 9px;
    height: 25px;
    font-size: 11px;
    border-radius: 4px;
    background: #091326;
    border: 1px solid rgba(56, 189, 248, 0.28);
    box-shadow: none;
    gap: 5px;
}
.bm-menubar-right .nercia-lang-pill:hover {
    border-color: #38bdf8;
    background: #0d1e3d;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
    transform: none;
}

/* ==========================================================================
   iOS Multi-Theme & White Mode (ios-light) High-Contrast Adaptation
   ========================================================================== */
html[data-theme^="ios-"] .nercia-lang-pill {
    background: var(--t-pill, rgba(44, 44, 46, 0.92));
    border: 0.5px solid var(--t-hairline, rgba(255, 255, 255, 0.12));
    box-shadow: var(--t-pill-shadow, none);
    color: var(--t-text, #ffffff);
    height: 34px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 600;
}
html[data-theme^="ios-"] .nercia-lang-pill:hover {
    background: var(--t-card-hover, rgba(58, 58, 60, 0.95));
    border-color: var(--t-blue, #0a84ff);
    box-shadow: var(--t-pill-shadow, none);
    transform: none;
}
html[data-theme^="ios-"] .nercia-lang-pill .pill-code {
    color: var(--t-blue, #0a84ff);
    font-weight: 700;
}
html[data-theme^="ios-"] .nercia-lang-pill .pill-name {
    color: var(--t-text, #ffffff);
    font-weight: 600;
}
html[data-theme^="ios-"] .nercia-lang-pill .pill-arrow {
    color: var(--t-sub, #8e8e93);
}

/* White Theme (ios-light) Crisp Light Modal & Header Pill */
html[data-theme="ios-light"] .nercia-lang-pill {
    background: #eef2f7 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="ios-light"] .nercia-lang-pill:hover,
html[data-theme="ios-light"] .nercia-lang-pill.active {
    background: #e2e8f0 !important;
    border-color: #94a3b8 !important;
}
html[data-theme="ios-light"] .nercia-lang-pill .pill-code {
    color: #0062cc !important;
}
html[data-theme="ios-light"] .nercia-lang-pill .pill-name {
    color: #0f172a !important;
}
html[data-theme="ios-light"] .nercia-lang-pill .pill-arrow {
    color: #475569 !important;
}

html[data-theme="ios-light"] .nercia-lang-modal-overlay {
    background: rgba(15, 23, 42, 0.42) !important;
}
html[data-theme="ios-light"] .nercia-lang-modal {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
}
html[data-theme="ios-light"] .nlm-tab-title {
    color: #0f172a !important;
}
html[data-theme="ios-light"] .nlm-close-btn {
    color: #475569 !important;
}
html[data-theme="ios-light"] .nlm-close-btn:hover {
    background: #f1f5f9 !important;
    color: #0f172a !important;
}
html[data-theme="ios-light"] .nlm-search-input {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
html[data-theme="ios-light"] .nlm-search-input::placeholder {
    color: #64748b !important;
}
html[data-theme="ios-light"] .nlm-search-input:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
}
html[data-theme="ios-light"] .nlm-sec-title {
    color: #64748b !important;
}
html[data-theme="ios-light"] .nlm-card:hover {
    background: #f8fafc !important;
}
html[data-theme="ios-light"] .nlm-card.active {
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}
html[data-theme="ios-light"] .nlm-card-name {
    color: #0f172a !important;
}
html[data-theme="ios-light"] .nlm-card.active .nlm-card-name {
    color: #0062cc !important;
}
html[data-theme="ios-light"] .nlm-card-code {
    color: #64748b !important;
}
