/* ============================================================
 * AncientFit — tachy-route-pins.css   (T-3, Session 42)
 * Run / Cycle pin card, route search panel, search button and
 * the active-route chip on the Tachydronics WebApp tracker map.
 * ============================================================ */

/* ----- search button: same family as Locate / Theme / Fullscreen ----- */
.route-search-btn {
    position: absolute !important;
    right: 188px !important;
    bottom: 20px !important;
    z-index: 600 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid var(--t-green-border, rgba(0, 184, 148, 0.35)) !important;
    color: var(--t-green-light, #00d6a8) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}
.route-search-btn:active { transform: scale(0.94); }

/* ----- pin card ----- */
.tachy-pin-card {
    position: absolute;
    z-index: 650;
    width: 220px;
    box-sizing: border-box;
    padding: 12px 12px 10px;
    border-radius: 16px;
    background: rgba(19, 26, 36, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    color: #F3F7FF;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.tachy-pin-card .tpc-close {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px; border-radius: 50%;
    border: none; background: transparent; color: #93A4BD; cursor: pointer; font-size: 13px;
}
.tachy-pin-card .tpc-head { display: flex; gap: 10px; align-items: center; padding-right: 22px; margin-bottom: 8px; }
.tachy-pin-card .tpc-icon {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #0B0F14; font-size: 15px; background: #D39D55;   /* T-5: popups are Tachydronics gold */
}
.tachy-pin-card .tpc-titles { min-width: 0; }
.tachy-pin-card .tpc-name {
    font-weight: 700; font-size: 13px; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere;
}
.tachy-pin-card .tpc-kind { color: #93A4BD; font-size: 11px; margin-top: 2px; }
.tachy-pin-card .tpc-row { display: flex; justify-content: space-between; padding: 3px 0; color: #93A4BD; }
.tachy-pin-card .tpc-row b { color: #F3F7FF; font-weight: 600; }
.tachy-pin-card .tpc-actions { display: flex; gap: 8px; margin-top: 10px; }
.tachy-pin-card .tpc-btn {
    flex: 1; padding: 8px 10px; border-radius: 50px; cursor: pointer;
    font-weight: 700; font-size: 12px; border: 1px solid rgba(211, 157, 85, 0.7);
    background: rgba(211, 157, 85, 0.25); color: #E8C97A;
}
.tachy-pin-card .tpc-back { background: transparent; border-color: rgba(255, 255, 255, 0.18); color: #93A4BD; }
.tachy-pin-card .tpc-confirm { margin-top: 8px; color: #c9d3e2; line-height: 1.35; overflow-wrap: anywhere; }
.tachy-pin-card .tpc-note { margin-top: 10px; color: #D39D55; font-size: 11px; }
/* T-5: weather check at the pin */
.tachy-pin-card .tpc-wx { margin-top: 6px; font-size: 11px; line-height: 1.35; }
.tachy-pin-card .tpc-wx-muted { color: #93A4BD; }
.tachy-pin-card .tpc-wx-sum { color: #F3F7FF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tachy-pin-card .tpc-wx-check { font-weight: 700; }
.tachy-pin-card .tpc-wx-check.ok { color: #D39D55; }
.tachy-pin-card .tpc-wx-check.caution { color: #F0A13A; }
.tachy-pin-card .tpc-wx-check.stop { color: #E74C3C; }

/* ----- search panel ----- */
.tachy-route-search {
    position: absolute;
    z-index: 660;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, calc(100% - 24px));
    box-sizing: border-box;
    padding: 10px;
    border-radius: 18px;
    background: rgba(14, 20, 28, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    color: #F3F7FF;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.tachy-route-search .trs-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tachy-route-search .trs-seg { display: flex; background: rgba(255, 255, 255, 0.06); border-radius: 50px; padding: 3px; }
.tachy-route-search .trs-seg button {
    border: none; background: transparent; color: #93A4BD; cursor: pointer;
    padding: 6px 14px; border-radius: 50px; font-size: 12px; font-weight: 600;
}
.tachy-route-search .trs-seg button.on { background: rgba(211, 157, 85, 0.30); color: #E8C97A; }
.tachy-route-search .trs-close {
    width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255, 255, 255, 0.06); color: #93A4BD;
}
.tachy-route-search .trs-field {
    display: flex; align-items: center; gap: 8px; padding: 0 12px;
    border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08);
    color: #93A4BD;
}
.tachy-route-search input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    color: #F3F7FF; font-size: 14px; padding: 10px 0;
}
.tachy-route-search .trs-results { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.tachy-route-search .trs-row {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 8px 6px; border: none; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent; color: inherit; cursor: pointer; border-radius: 10px;
}
.tachy-route-search .trs-row:hover { background: rgba(255, 255, 255, 0.05); }
.tachy-route-search .trs-icon {
    flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #0B0F14; font-size: 12px; background: #D39D55;
}
.tachy-route-search .trs-text { display: flex; flex-direction: column; min-width: 0; }
.tachy-route-search .trs-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tachy-route-search .trs-sub { font-size: 11px; color: #93A4BD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tachy-route-search .trs-msg { padding: 10px 6px; font-size: 12px; color: #93A4BD; }

/* ----- active route chip (only when the session started on a pin) ----- */
.tachy-route-chip {
    position: absolute;
    z-index: 640;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 160px);
    padding: 6px 14px;
    border-radius: 50px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(211, 157, 85, 0.45);
    color: #D39D55;
    font: 600 12px system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* ----- history: route line ----- */
.history-route-name {
    display: flex; align-items: center; gap: 6px;
    margin: 4px 0 2px; font-size: 0.8rem; color: #D39D55;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .route-search-btn {
        width: 38px !important;
        height: 38px !important;
        right: 124px !important;
        bottom: 16px !important;
        font-size: 0.85rem !important;
    }
    .tachy-pin-card { width: 200px; }
    .tachy-route-chip { max-width: calc(100% - 120px); }
}