/* Metrics Card - Top of Right Column */
#metrics-card {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 360px;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 12px 14px;
  display: none;
  flex-direction: column;
  gap: 6px;
  z-index: 999;
  pointer-events: auto;
  box-sizing: border-box;
}

.metrics-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(18, 20, 24, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.metric-item:hover {
  background: rgba(27, 31, 37, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}

.metric-label {
  font-size: 11px;
  color: #4ED9D9;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
  text-transform: uppercase;
}

.metric-sublabel {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 200;
  margin-top: 1px;
}

.metric-value-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.metric-count {
  font-size: 16px;
  font-weight: 600;
  color: #FFFFFF;
  transition: all 0.3s ease;
}

.metric-percentage-wrapper {
  display: flex;
  align-items: center;
}

.metric-percentage {
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.metric-percentage.positive {
  color: #22c55e;
}

.metric-percentage.negative {
  color: #ef4444;
}

.metric-percentage.neutral {
  color: rgba(255, 255, 255, 0.6);
}

/* Update animation */
.updating {
  opacity: 0.3;
  transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 1100px) {
  #metrics-card {
    width: 300px;
  }
}

/* Compact layout: the two metrics become one slim row under the title, so the globe keeps
   the middle of the screen. */
@media (max-width: 820px) {
  #metrics-card {
    top: 96px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: min(440px, calc(100% - 24px));
    padding: 0;
  }

  .metrics-content {
    flex-direction: row;
  }

  .metric-item {
    flex: 1;
    min-width: 0;
    padding: 6px 9px;
  }

  .metric-label {
    font-size: 9.5px;
  }

  .metric-sublabel {
    display: none;
  }

  .metric-count {
    font-size: 13px;
  }

  .metric-percentage {
    font-size: 10px;
  }
}

/* Short landscape screens: tuck the metrics into the top-right corner, beside the title */
@media (max-height: 520px) and (min-width: 821px) {
  #metrics-card {
    top: 12px;
    right: 64px;
    width: 230px;
    padding: 0;
  }

  .metric-item {
    padding: 5px 9px;
  }

  .metric-sublabel {
    display: none;
  }

  .metric-count {
    font-size: 13px;
  }
}
