/* Career Lab Dashboard v3 Insights */

.insights-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 18px;
}

.topology-panel {
  overflow: hidden;
}

.topology-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 328px;
}

.topology-map::before {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  opacity: .24;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(96,165,250,.42) 14% 15%, transparent 15% 48%, rgba(96,165,250,.42) 48% 49%, transparent 49% 82%, rgba(96,165,250,.42) 82% 83%, transparent 83%),
    linear-gradient(180deg, transparent 0 22%, rgba(96,165,250,.32) 22% 23%, transparent 23% 55%, rgba(96,165,250,.32) 55% 56%, transparent 56% 88%, rgba(96,165,250,.32) 88% 89%, transparent 89%);
  mask-image: radial-gradient(circle at 50% 50%, black, transparent 78%);
  animation: topologyFlow 4.4s linear infinite;
}

@keyframes topologyFlow {
  0% { filter: hue-rotate(0deg); opacity: .18; }
  50% { filter: hue-rotate(28deg); opacity: .34; }
  100% { filter: hue-rotate(0deg); opacity: .18; }
}

.topo-node {
  position: relative;
  z-index: 1;
  min-height: 88px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .16);
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(96,165,250,.14), transparent 42%),
    rgba(15, 23, 42, .72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
  transition: transform 180ms cubic-bezier(.22,1,.36,1), border-color 180ms ease, background 180ms ease;
}

.topo-node:hover {
  transform: translateY(-3px);
  border-color: rgba(147, 197, 253, .34);
  background:
    radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(96,165,250,.22), transparent 46%),
    rgba(15, 23, 42, .86);
}

.topo-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.topo-state.good {
  color: #86efac;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(134,239,172,.2);
}

.topo-state.warn {
  color: #fde68a;
  background: rgba(234,179,8,.1);
  border: 1px solid rgba(253,230,138,.2);
}

.topo-state.bad {
  color: #fca5a5;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(252,165,165,.2);
}

.topo-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
  animation: topoPulse 2.4s ease-out infinite;
}

@keyframes topoPulse {
  0% { transform: scale(.9); opacity: .85; }
  70% { transform: scale(1.7); opacity: .15; }
  100% { transform: scale(.9); opacity: .85; }
}

.topo-title {
  font-weight: 950;
  letter-spacing: -.02em;
}

.topo-sub {
  margin-top: 5px;
  color: #94a3b8;
  font-size: .82rem;
  line-height: 1.38;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, .16);
  background:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, .14), transparent 42%),
    rgba(15, 23, 42, .72);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 12px 14px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147,197,253,.52), transparent);
  opacity: .5;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.metric-label {
  color: #93c5fd;
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: -.04em;
}

.metric-sub {
  margin: 7px 0 0;
  color: #94a3b8;
  font-size: .82rem;
  min-height: 19px;
}

.metric-canvas {
  width: 100%;
  height: 72px;
  display: block;
}

.insights-updated {
  color: #94a3b8;
  font-size: .84rem;
}

@media (max-width: 980px) {
  .insights-grid {
    grid-template-columns: 1fr;
  }

  .topology-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .metric-grid,
  .topology-map {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topology-map::before,
  .topo-state::before {
    animation: none !important;
  }
}
