/* サイドメニュー用操作画面 (透過表示) */
#map-side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* 透過表示 */
    z-index: 1001; /* マップと切替ボタンより前面に表示 */
    display: none; /* 初期状態では非表示 */
}

/* ホバー時のデザイン */
#map-side-menu-open-btn:hover {
    color: #007B8A; /* ホバー時に薄い青色の背景 */
}

/* サイドメニューボタン */
#map-side-menu-open-btn {
    position: fixed; /* 常に画面内で固定 */
    top: 10px;
    left: 10px;
    background: rgba(247, 247, 247, 1.0);
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000; /* ボタンがマップの上に表示されるように (※レイヤー切替ボタンはデフォルトで[z-index: 1000]) */
    display: none; /* 挿入直後は非表示。Box/VR ログイン後に body.app-map-side-menu-enabled で表示 */
}

/* A-Frameコンテナ */
#map-side-menu-container {
    position: relative;
    width: 100%;
    display: block;
}

/* サイドメニュー */
#map-side-menu {
    position: fixed;
    top: 0;
    left: -300px; /* 画面外に表示 */
    width: 300px;
    height: 100%;
    background: white;
    z-index: 1001; /* サイドメニューを最前面に表示 */
    transition: left 0.3s; /* スライド表示アニメーション */
}

/* サイドメニューのヘッダー */
#map-side-menu-header {
    background: none;
    color: gray;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
}

/* サイドメニューのコンテンツ */
#map-side-menu-content {
    padding: 20px;
    border-bottom: 1px solid #d1d1d1;
}

/* サイドメニューの管理コンテンツ */
#map-side-menu-management-content {
    padding: 20px;
    border-bottom: 1px solid #d1d1d1;
}

/* サイドメニューの設定コンテンツ */
#map-side-menu-setting-content {
    padding: 20px;
    border-bottom: 1px solid #d1d1d1;
}

#map-side-menu-content ul,
#map-side-menu-management-content ul,
#map-side-menu-setting-content ul {
    list-style-type: none;
    padding: 0;
}

#map-side-menu-content ul li,
#map-side-menu-management-content ul li,
#map-side-menu-setting-content ul li {
    margin-bottom: 10px;
}

/* ホバー時のデザイン */
#map-side-menu-content ul li a:hover,
#map-side-menu-management-content ul li a:hover,
#map-side-menu-setting-content ul li a:hover {
    color: #007B8A; /* ホバー時に薄い青色の背景 */
}

/* ホバー時のデザイン */
#map-side-menu-content ul li a,
#map-side-menu-management-content ul li a,
#map-side-menu-setting-content ul li a {
    text-decoration: none;
    color: #333;
}

/* ホバー時のデザイン */
#map-side-menu-close-btn:hover {
    color: #007B8A; /* ホバー時に薄い青色の背景 */
}

/* サイドメニューの閉じるボタン */
#map-side-menu-close-btn {
    background: none;
    border: none;
    color: gray;
    font-size: 20px;
    cursor: pointer;
}

/* ---- マップ検索 + ルート検索（折り畳み一体） ---- */
#map-search-combined {
    position: fixed;
    top: 10px;
    left: 10px; /* サイドメニュー非表示時の既定。Box/VR は body.app-map-side-menu-enabled で右寄せ */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-family: Arial, sans-serif;
}

/* Box / VR ログイン済み: サイドメニュー表示・検索バーをメニュー右に配置 */
body.app-map-side-menu-enabled #map-side-menu-open-btn {
    display: block;
}

body.app-map-side-menu-enabled #map-search-combined {
    left: 80px;
}

.map-search-combined-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* 展開時：ツールバー直下の検索パネル間隔を詰める */
#map-search-combined.map-search-combined--expanded {
    gap: 6px;
}

/* 折り畳み時のピル型トグル（検索アイコン + シェブロン） */
.map-search-combined-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px 18px;
    min-height: 44px;
    border: none;
    border-radius: 999px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font: inherit;
    color: #555;
}

.map-search-combined-toggle:hover {
    color: #007B8A;
}

.map-search-combined-display-setting-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    min-height: 44px;
    border: none;
    border-radius: 999px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
}

.map-search-combined-display-setting-btn:hover {
    color: #007B8A;
}

.map-search-combined-display-setting-btn:focus-visible {
    outline: 2px solid #007B8A;
    outline-offset: 2px;
}

.map-search-combined-toggle-search img {
    display: block;
}

/* 折りたたみ時は下向き、展開時は 180° 回転で上向き（閉じる操作の目印） */
.map-search-combined-toggle-chevron {
    display: block;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #666;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

#map-search-combined.map-search-combined--expanded .map-search-combined-toggle-chevron {
    transform: rotate(180deg);
}

/* 展開パネル：マップ検索 + ルート検索を縦積み（左端はトグルと揃える） */
.map-search-combined-expanded {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(60vw, 300px);
}

.map-search-combined-expanded[hidden] {
    display: none !important;
}

/* 検索ボックスのスタイル（パネル内・従来デザインを維持） */
#map-search-box {
    position: relative;
    left: auto;
    top: auto;
    font-family: Arial, sans-serif;
    align-items: center;
    width: 100%;
    max-width: 300px;
    border: none;
    border-radius: 30px;
    background-color: #ffffff;
    padding: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
}

/* 検索フィールド（入力） */
#map-search-box-input {
    flex: 1; /* 横幅を最大化 */
    border: none; /* フォーカス時に青い下線 */
    outline: none;
    padding: 10px 40px;
    font-size: 14px;
    border-radius: 30px; /* 丸みを合わせる */
}

/* 検索アイコン */
#map-search-box-btn {
    border: none;
    background: none;
    font-size: 20px; /* アイコンサイズ */
    padding: 5px 20px 1px 0px;
    cursor: pointer;
    color: #555; /* アイコンの色 */
}

/* アイコン表示用トグルボタンデザイン */
/* 全体の位置を設定 */
#map-maker-disp-toggle {
    position: fixed;
    /* 固定表示 */
    bottom: 65px;
    /* 左下のレイヤーボタンの上部に表示 */
    width: 115px;
    /* トグルボタンの横幅 */
    right: 55px;
    /* 画面右端からの距離 */
    z-index: 1000;
    /* 前面に表示するための設定 */
    display: flex;
    /* 横並びにする */
    align-items: center;
    /* 垂直方向の中央揃え */
    font-family: 'Arial', sans-serif;
    /* フォント設定 */
    font-size: 12px;
    /* テキストサイズ */
    color: #333;
    /* テキスト色 */
    background: white;
    /* 背景を白にする */
    padding: 8px 10px;
    /* 内側の余白を設定 */
    border-radius: 8px;
    /* 角を丸くする */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* 影で立体感を追加 */
    cursor: pointer;
    /* クリック可能に見せる */
}

/* ラベル内を横並びにする */
.maker-disp-label {
    display: flex;
    align-items: center;
}

/* チェックボックスを非表示にしてカスタムスタイルで置き換える */
.maker-disp-label input[type="checkbox"] {
    display: none;
    /* 標準のチェックボックスを非表示にする */
}

/* トグルスイッチの見た目を設定 */
.maker-disp-toggle-slider {
    position: relative;
    width: 30px;
    /* トグルスイッチの幅 */
    height: 15px;
    /* トグルスイッチの高さ */
    border-radius: 12px;
    /* 丸みを付ける */
    background: #ccc;
    /* オフ時の背景色 */
    margin-left: 10px;
    /* テキストとスイッチ間の余白 */
    transition: background 0.3s ease;
    /* 背景色の変更を滑らかに */
}

/* トグルスイッチの丸いスライダー部分 */
.maker-disp-toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    /* スライダーの幅 */
    height: 10px;
    /* スライダーの高さ */
    background: white;
    /* スライダーの背景色 */
    border-radius: 50%;
    /* セミ円を作成 */
    transition: transform 0.3s ease;
    /* スライダーの動きを滑らかにする */
}

/* チェックオン時のトグルスイッチスタイル */
.maker-disp-label input[type="checkbox"]:checked+.maker-disp-toggle-slider {
    background: #339cff;
    /* チェック時の背景色 */
}

.maker-disp-label input[type="checkbox"]:checked+.maker-disp-toggle-slider::before {
    transform: translateX(15px);
    /* 丸部分を右に移動 */
}

/* 検索アイコン用の画像スタイル */
#map-search-box-image {
    width: 20px; /* アイコンの幅 */
    height: 20px; /* アイコンの高さ */
    display: inline-block; /* アイコンをインラインで表示 */
}

/* ルート検索ボックスのスタイル（マップ検索の直下に縦積み） */
#map-route-search-box {
    position: relative;
    left: auto;
    top: auto;
    font-family: Arial, sans-serif;
    align-items: center;
    width: 100%;
    max-width: 300px;
    border: none;
    border-radius: 30px;
    background-color: #ffffff;
    padding: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: flex;
}

/* ルート検索フィールド（入力） */
#map-route-search-box-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 40px;
    font-size: 14px;
    border-radius: 30px;
    /* Firefox: datalist のドロップマーカーを抑止（Chromium は下記疑似要素） */
    -moz-appearance: textfield;
}

/* datalist 付きで表示されるブラウザ標準の▼を非表示（候補は入力・datalist により従来どおり） */
#map-route-search-box-input::-webkit-calendar-picker-indicator {
    display: none !important;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

#map-route-search-box-input::-webkit-list-button {
    display: none !important;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* ルート検索ボタン */
#map-route-search-box-btn {
    border: none;
    background: none;
    font-size: 20px;
    padding: 5px 20px 1px 0px;
    cursor: pointer;
    color: #555;
}

/* ルート検索ボタンのアイコン画像 */
#map-route-search-box-image {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* ルート検索の入力ハイライト（未一致時に赤枠でフィードバック） */
#map-route-search-box.is-not-found {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), inset 0 0 0 1.5px #c0392b;
}

/* 計測距離用トグルボタンデザイン */
/* 全体の位置を設定 */
#map-distance-mode-toggle {
    position: fixed; /* 固定表示 */
    bottom: 25px; /* 左下のレイヤーボタンの上部に表示 */
    right: 55px; /* 画面右端からの距離 */
    width: 110px; /* トグルボタンの横幅 */
    z-index: 1000; /* 前面に表示するための設定 */
    display: flex; /* 横並びにする */
    align-items: center; /* 垂直方向の中央揃え */
    font-family: 'Arial', sans-serif; /* フォント設定 */
    font-size: 12px; /* テキストサイズ */
    color: #333; /* テキスト色 */
    background: white; /* 背景を白にする */
    padding: 8px 12px; /* 内側の余白を設定 */
    border-radius: 8px; /* 角を丸くする */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); /* 影で立体感を追加 */
    cursor: pointer; /* クリック可能に見せる */
}

/* ラベル内を横並びにする */
.distance-mode-label {
    display: flex;
    align-items: center;
}

/* チェックボックスを非表示にしてカスタムスタイルで置き換える */
.distance-mode-label input[type="checkbox"] {
    display: none; /* 標準のチェックボックスを非表示にする */
}

/* トグルスイッチの見た目を設定 */
.toggle-slider {
    position: relative;
    width: 30px; /* トグルスイッチの幅 */
    right: -20px; /* 画面右端からの距離 */
    height: 15px; /* トグルスイッチの高さ */
    border-radius: 12px; /* 丸みを付ける */
    background: #ccc; /* オフ時の背景色 */
    margin-left: 10px; /* テキストとスイッチ間の余白 */
    transition: background 0.3s ease; /* 背景色の変更を滑らかに */
}

/* トグルスイッチの丸いスライダー部分 */
.toggle-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px; /* スライダーの幅 */
    height: 10px; /* スライダーの高さ */
    background: white; /* スライダーの背景色 */
    border-radius: 50%; /* セミ円を作成 */
    transition: transform 0.3s ease; /* スライダーの動きを滑らかにする */
}

/* チェックオン時のトグルスイッチスタイル */
.distance-mode-label input[type="checkbox"]:checked + .toggle-slider {
    background: #339cff; /* チェック時の背景色 */
}

.distance-mode-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(15px); /* 丸部分を右に移動 */
}
