/**
 * Investor Metrics - Professional Data Visualization
 * Part of the Earth-Tech Design System
 */

.investor-metric {
  position: relative;
  padding: 1.5rem;
  background: transparent;
  border: 1px solid rgba(71, 85, 105, 0.3); /* Subdued Slate Grey */
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.investor-metric:hover {
  border-color: rgba(148, 163, 184, 0.5);
}

.investor-metric__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.investor-metric__label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.investor-metric__trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.investor-metric__trend--up {
  color: #10b981;
  /* Emerald-500 */
  background: rgba(16, 185, 129, 0.1);
}

.investor-metric__value {
  font-family: 'Oswald', sans-serif;
  font-size: 2.125rem;
  font-weight: 700;
  color: var(--text-primary, #f8fafc);
  line-height: 1;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.investor-metric__legend {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: -0.25rem;
  opacity: 0.8;
}

/* CHART ENHANCEMENTS */
.investor-metric__chart {
  position: relative;
  width: 100%;
  height: 90px;
  margin-top: 1rem;
  padding-bottom: 10px;
}

.investor-metric__chart svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.revealed .chart-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-chart 2.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  filter: drop-shadow(0 0 8px currentColor);
}

.chart-line-bg {
  opacity: 0.1;
  stroke-width: 5;
}

@keyframes draw-chart {
  to {
    stroke-dashoffset: 0;
  }
}

.revealed .chart-area {
  opacity: 0;
  animation: fade-in 1.5s ease-out 1s forwards;
}

@keyframes fade-in {
  to {
    opacity: 0.2;
  }
}

.chart-grid {
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 0.5;
}

.chart-axis {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.revealed .chart-point {
  fill: var(--navy-900);
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  animation: point-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes point-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.investor-metric:hover .chart-point {
  r: 3.5;
  filter: none;
}

/* Secondary "Hidden" Data for Detail */
.chart-detail-line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

/* Tooltip Simulation (Visual Only) */
.investor-metric__pulse {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 20px #fff;
  animation: pulse-ring 2s infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  }

  70% {
    transform: scale(1.5);
    opacity: 0;
    box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
  }

  100% {
    transform: scale(0.8);
    opacity: 0;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* Scanning Line Effect on Hover */
.investor-metric__scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent);
  left: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.investor-metric:hover .investor-metric__scan {
  opacity: 0.1;
  /* Super Light */
  animation: scan-move 6s linear infinite;
  /* Slower */
}

@keyframes scan-move {
  0% {
    left: 0%;
  }

  100% {
    left: 100%;
  }
}

/* AXIS LABELS */
.chart-labels {
  font-size: 9px;
  fill: var(--text-secondary, #cbd5e1);
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
