/* JIMS — Trending live-data card (replaces travel-time card) */

/* Hide the legacy travel card the traffic module renders */
#travelCard { display: none !important; }

#trendingCard{
  position: fixed;
  top: 68px; left: 12px; z-index: 600;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 96px);
  background: linear-gradient(180deg, rgba(8,30,18,.94), rgba(11,42,24,.94));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.15);
  color: #fff;
  display: flex; flex-direction: column;
  overflow: hidden;
  font: 13px/1.4 'Inter', system-ui, sans-serif;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.tr-head{
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #04250f, #0a3a1c);
  border-bottom: 1px solid rgba(255,255,255,.08);
  cursor: pointer; user-select: none;
}
.tr-head .tr-icon{font-size: 18px;}
.tr-head .tr-title{
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 14px; flex: 1; letter-spacing:.01em;
}
.tr-live{
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .92;
}
.tr-live .dot{
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74,222,128,.75);
  animation: trPulse 1.6s ease-out infinite;
}
@keyframes trPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.75); }
  70%  { box-shadow: 0 0 0 9px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
.tr-chev{transition: transform .2s; font-size: 12px;}
#trendingCard.collapsed .tr-chev{transform: rotate(-90deg);}
#trendingCard.collapsed .tr-body{display: none;}

.tr-body{
  overflow-y: auto; padding: 6px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.tr-body::-webkit-scrollbar{width: 6px}
.tr-body::-webkit-scrollbar-thumb{background: rgba(255,255,255,.20); border-radius: 6px}

.tr-row{
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 10px;
  margin: 4px 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-left: 3px solid var(--tr-col, #4ade80);
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .35s cubic-bezier(.2,.7,.3,1), opacity .25s;
  will-change: transform, opacity;
}
.tr-row:hover{background: rgba(255,255,255,.09);}
.tr-row.fresh{
  animation: trFresh 1.5s ease-out;
  background: rgba(74,222,128,.15);
}
@keyframes trFresh {
  0%   { background: rgba(74,222,128,.45); transform: scale(1.02); box-shadow: 0 0 0 0 rgba(74,222,128,.7); }
  60%  { background: rgba(74,222,128,.22); transform: scale(1.00); box-shadow: 0 0 0 8px rgba(74,222,128,0); }
  100% { background: rgba(255,255,255,.04); }
}

.tr-emoji{
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--tr-col, rgba(74,222,128,.20));
  font-size: 20px;
}
.tr-info{min-width: 0;}
.tr-name{
  font-weight: 700; font-size: 13px; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tr-sub{font-size: 11px; color: rgba(255,255,255,.62); margin-top: 2px;}
.tr-right{display: flex; flex-direction: column; align-items: flex-end; gap: 3px;}
.tr-count{
  font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800;
  font-size: 16px; color: #fff; line-height: 1;
}
.tr-ago{font-size: 10px; color: rgba(255,255,255,.55); white-space: nowrap;}
.tr-empty{font-size: 16px; color: rgba(255,255,255,.32); font-weight: 600;}

.tr-foot{
  padding: 8px 12px;
  font-size: 10.5px; color: rgba(255,255,255,.55);
  text-align: center; border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.18);
  letter-spacing: .03em;
}
.tr-foot b{color: rgba(255,255,255,.8); font-weight: 600;}

/* Brief shimmer on update */
.tr-row.fresh .tr-emoji::after{
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,.6) 0%, transparent 70%);
  border-radius: inherit; animation: trShim .9s ease-out;
}
.tr-emoji{position: relative; overflow: hidden;}
@keyframes trShim { from{opacity:1} to{opacity:0} }
