/* ==========================================================
   1. プランバー（画面下部固定）
   ========================================================== */

#travel-plan-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border-top: 3px solid #e67e22;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    padding: 10px 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.tp-bar-inner {
    max-width: 900px;
    margin: 0 auto;
}

.tp-bar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tp-bar-title {
    font-weight: bold;
    font-size: 0.95rem;
    color: #e67e22;
}

.tp-bar-note {
    font-size: 0.75rem;
    color: #999;
}


/* ==========================================================
   2. スポット一覧（バー内、追加済みスポットの行）
   ========================================================== */

.tp-spots-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tp-spot-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff7f0;
    border: 1px solid #f0c08a;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
}

.tp-spot-num {
    font-weight: bold;
    color: #e67e22;
    min-width: 1em;
}

.tp-spot-name {
    color: #333;
}

/* スポット名クリックで地図フォーカス */
.tp-spot-link {
    cursor: pointer;
    text-decoration: underline dotted;
    color: #e67e22;
}

.tp-spot-link:hover {
    color: #cf6d17;
}

/* 並べ替え（◀▶）・削除（✕） */
.tp-move-btn,
.tp-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #aaa;
    font-size: 0.75rem;
    padding: 0 2px;
    line-height: 1;
}

.tp-move-btn:hover {
    color: #e67e22;
}

.tp-remove-btn:hover {
    color: #e74c3c;
}


/* ==========================================================
   3. バー下部アクション（ルート案内・クリア）
   ========================================================== */

.tp-bar-actions {
    display: flex;
    gap: 8px;
}

.tp-action-btn {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
}

.tp-btn-route {
    background: #e67e22;
    color: #fff;
}

.tp-btn-route:hover {
    background: #cf6d17;
}

.tp-btn-clear {
    background: #f0f0f0;
    color: #555;
}

.tp-btn-clear:hover {
    background: #ddd;
}


/* ==========================================================
   4. 吹き出し内「プランに追加」ボタン（injectPlanButton）
   ========================================================== */

.tp-add-btn {
    background: #27ae60;
    color: #fff;
    width: 100%;
    margin-top: 6px;
    text-align: center;
    border: none;
    cursor: pointer;
}

.tp-add-btn:hover {
    background: #219a52;
}

.tp-add-btn.tp-added {
    background: #95a5a6;
    cursor: default;
}

.tp-add-btn.tp-full {
    background: #bdc3c7;
    color: #777;
    cursor: default;
    font-size: 0.8rem;
}


/* ==========================================================
   5. マップ上のオーバーレイピン（追加済み番号表示）
   ========================================================== */

.tp-overlay-pin {
    width: 24px;
    height: 24px;
    background: #e67e22;
    color: #fff;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ==========================================================
   6. ヘルプボタン（？）と使い方ボックス
   ========================================================== */

.tp-help-btn {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #555;
    margin-left: 6px;
}

.tp-help-btn:hover {
    background: #ddd;
}

.tp-help-box {
    background: #fff7f0;
    border: 1px solid #f0c08a;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.8;
    margin-bottom: 6px;
}


/* ==========================================================
   7. マップ表示時のウェルカムヒント（3秒で消える）
   ========================================================== */

#tp-welcome-tip {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #333;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 1.1rem;
    font-weight: bold;
    z-index: 2000;
    pointer-events: none;
    transition: opacity 0.8s;
    white-space: nowrap;
    border-top: 3px solid #e67e22;
}

.tp-tip-fadeout {
    opacity: 0;
}


/* ==========================================================
   8. 前ページに戻るボタンの確認ダイアログ（tpConfirmBack）
   ========================================================== */

#tp-back-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
}

.tp-back-dialog {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.tp-back-msg {
    font-size: 1rem;
    color: #333;
    margin-bottom: 16px;
    line-height: 1.6;
}

.tp-back-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tp-back-btn {
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: bold;
}

.tp-back-btn-clear {
    background: #e74c3c;
    color: #fff;
}

.tp-back-btn-clear:hover {
    background: #c0392b;
}

.tp-back-btn-keep {
    background: #27ae60;
    color: #fff;
}

.tp-back-btn-keep:hover {
    background: #219a52;
}

.tp-back-btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.tp-back-btn-cancel:hover {
    background: #ddd;
}


/* ==========================================================
   9. カテゴリフィルタートグルボタン（filter-bar-containerの開閉）
   ========================================================== */

#tp-filter-toggle-btn {
    background: #fff;
    border: 2px solid #e67e22;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #e67e22;
    cursor: pointer;
}

#tp-filter-toggle-btn:hover {
    background: #fff7f0;
}


/* ==========================================================
   10. ルート案内＆プラン保存モーダル（showRoutePlanModal）
   ========================================================== */

.tp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tp-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.tp-modal-box h3 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: #333;
}

.tp-modal-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tp-modal-url-row input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #333;
}

.tp-modal-url-row button {
    padding: 6px 12px;
    background: #e67e22;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    white-space: nowrap;
}

#tp-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.tp-modal-hint {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 16px;
    text-align: left;
}

.tp-modal-sub-hint {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.6;
    margin: 4px 0 12px;
    text-align: left;
}

.tp-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}


/* ==========================================================
   11. マップ内スポット検索（setupMapSearch）
   ========================================================== */

.map-search-box {
    position: relative;
    display: inline-block;
}

#map-search-input {
    padding: 6px 16px;
    border: 2px solid #3498db;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    width: 220px;
    outline: none;
    background: #fff;
}

#map-search-input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.3);
}

#map-search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    min-width: 260px;
    max-height: 300px;
    overflow-y: auto;
}

.map-search-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.88rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-search-item:hover {
    background: #fff7f0;
}

.map-search-distance {
    color: #999;
    font-size: 0.8rem;
}

.map-search-empty {
    color: #999;
    cursor: default;
}

.map-search-badge {
    font-size: 0.72rem;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.map-search-badge-assoc {
    background: #d6eaf8;
    color: #1a5276;
}

.map-search-badge-spot {
    background: #d5f5e3;
    color: #1e8449;
}

/* ↓↓↓ ここに追加 ↓↓↓ */
.map-search-badge-station {
    background: #e8daef;
    color: #6c3483;
}

.map-search-badge-airport {
    background: #d7bde2;
    color: #4a235a;
}

.map-search-badge-hotel {
    background: #fdebd0;
    color: #9c640c;
}
/* ↑↑↑ ここまで追加 ↑↑↑ */

/* 検索ボックスと戻るボタンを含む、全画面マップ上部の行レイアウト */
.top-control-row1 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-control-row2 {
    margin-top: 4px;
}


/* ==========================================================
   12. PC向け：プランバーの可視性を強化（モバイルは変更なし）
   ========================================================== */

@media (min-width: 1000px) {
    #travel-plan-bar {
        padding: 16px 24px;
    }

    .tp-bar-inner {
        max-width: 1100px;
    }

    .tp-bar-title {
        font-size: 1.25rem;
    }

    .tp-bar-note {
        font-size: 0.9rem;
    }

    .tp-spot-item {
        font-size: 1rem;
        padding: 6px 12px;
    }

    .tp-spot-num {
        font-size: 1.05rem;
    }

    .tp-action-btn {
        padding: 10px 24px;
        font-size: 1rem;
    }

    .tp-btn-clear {
        border: 1px solid #ccc;
    }

    .tp-help-box {
        font-size: 0.95rem;
        padding: 12px 16px;
    }
}


/* --- ルート案内ボタンのローディングスピナー --- */
.tp-btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tp-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 4px;
}
@keyframes tp-spin {
    to { transform: rotate(360deg); }
}