/* JIMS — crowd-sourced traffic UI */
:root {
  --t-green:  #16a34a;
  --t-yellow: #eab308;
  --t-orange: #f97316;
  --t-red:    #dc2626;
  --t-none:   #9aa6b2;
}

/* ---- Travel-time card (left) ---- */
#travelCard {
  position: fixed; top: 68px; left: 12px; z-index: 600;
  width: min(320px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  background: #fff; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  font-size: 13px;
}
#travelCard .tc-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #04250f, #0a3a1c);
  color: #fff; cursor: pointer;
}
#travelCard .tc-head .tc-title {
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 14px; flex: 1;
}
#travelCard .tc-head .tc-live {
  display: flex; align-items: center; gap: 5px; font-size: 10px;
  text-transform: uppercase; letter-spacing: .5px; opacity: .9;
}
#travelCard .tc-live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: tcpulse 2s infinite;
}
@keyframes tcpulse { 70%{box-shadow:0 0 0 7px rgba(74,222,128,0)} 100%{box-shadow:0 0 0 0 rgba(74,222,128,0)} }
#travelCard .tc-chevron { transition: transform .2s; font-size: 12px; }
#travelCard.collapsed .tc-chevron { transform: rotate(-90deg); }
#travelCard.collapsed .tc-body { display: none; }
#travelCard .tc-body { overflow-y: auto; }

/* route search */
.tc-route { padding: 12px 13px; border-bottom: 1px solid var(--line); display: grid; gap: 7px; }
.tc-route .tc-field { display: flex; align-items: center; gap: 7px; }
.tc-route .tc-pin { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.tc-route .tc-pin.from { background: var(--coral); }
.tc-route .tc-pin.to   { background: var(--ink); }
.tc-route input {
  flex: 1; width: 100%; padding: 8px 10px; font: inherit; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--paper-2); color: var(--ink);
}
.tc-route input:focus { outline: none; border-color: var(--coral); background: #fff; }
.tc-route-actions { display: flex; gap: 6px; }
.tc-route-actions .btn { flex: 1; justify-content: center; padding: 8px; font-size: 12.5px; }
.tc-myloc { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 0 10px; cursor: pointer; }
.tc-myloc:hover { background: var(--paper-2); }

/* route result */
.tc-result { padding: 12px 13px; border-bottom: 1px solid var(--line); display: none; }
.tc-result.show { display: block; }
.tc-result .tc-eta { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 26px; color: var(--ink); }
.tc-result .tc-eta small { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.tc-result .tc-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.tc-result .tc-reroute {
  margin-top: 8px; font-size: 11.5px; font-weight: 700; color: #166534;
  background: #dcfce7; border-radius: 8px; padding: 6px 9px; display: none;
}
.tc-result .tc-reroute.show { display: block; }
.tc-result .tc-clear { margin-top: 8px; font-size: 12px; }

/* corridor list */
.tc-list-head {
  padding: 9px 13px 4px; font-size: 10px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--ink-soft);
}
.tc-corridor {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px;
  border-bottom: 1px solid var(--paper-2); cursor: pointer;
}
.tc-corridor:hover { background: var(--paper-2); }
.tc-corridor.selected { background: var(--paper-2); box-shadow: inset 3px 0 0 var(--coral); }
.tc-corridor .tc-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--t-none); }
.tc-corridor.green  .tc-bar { background: var(--t-green); }
.tc-corridor.yellow .tc-bar { background: var(--t-yellow); }
.tc-corridor.orange .tc-bar { background: var(--t-orange); }
.tc-corridor.red    .tc-bar { background: var(--t-red); }
.tc-corridor .tc-c-name { flex: 1; font-weight: 600; color: var(--ink); line-height: 1.25; }
.tc-corridor .tc-c-name small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 11px; }
.tc-corridor .tc-c-eta { text-align: right; }
.tc-corridor .tc-c-eta b { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; }
.tc-corridor .tc-c-eta span { display: block; font-size: 10.5px; }
.tc-c-eta .delay-up   { color: var(--t-red); }
.tc-c-eta .delay-none { color: var(--t-green); }

/* legend + probe footer */
.tc-legend {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  padding: 10px 13px; border-bottom: 1px solid var(--line);
}
.tc-legend span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-soft); }
.tc-legend i { width: 16px; height: 4px; border-radius: 2px; display: inline-block; }
.tc-probe {
  display: flex; align-items: center; gap: 8px; padding: 10px 13px;
  font-size: 11.5px; color: var(--ink-soft);
}
.tc-probe .tc-probe-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--t-none); flex-shrink: 0; }
.tc-probe.live .tc-probe-dot { background: var(--t-green); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.tc-probe.denied .tc-probe-dot { background: var(--t-red); }
.tc-probe b { color: var(--ink); }
.tc-probe .tc-probe-toggle { margin-left: auto; cursor: pointer; color: var(--coral); font-weight: 700; }

@media (max-width: 760px) {
  #travelCard {
    top: 62px; left: 8px;
    width: min(330px, calc(100vw - 16px));
    max-height: 76vh;
  }
  #travelCard.collapsed { width: auto; }
}
@media (max-width: 380px) {
  #travelCard { left: 6px; }
  #travelCard:not(.collapsed) { width: calc(100vw - 12px); }
}
