/* ==========================================================================
   Marketing Health Score Card
   ========================================================================== */

.health-score-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.health-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.health-score-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin: 0;
}

.health-score-trend {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.health-score-trend--improving {
  background: var(--color-green-light);
  color: var(--color-green);
}

.health-score-trend--declining {
  background: var(--color-red-light);
  color: var(--color-red);
}

.health-score-trend--stable {
  background: var(--color-orange-light);
  color: var(--color-orange);
}

.health-score-body {
  display: flex;
  gap: var(--space-8);
  align-items: flex-start;
}

.health-score-gauge {
  flex-shrink: 0;
  text-align: center;
  min-width: 120px;
}

.health-score-number {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: 1;
}

.health-score-grade {
  display: inline-block;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  margin-top: var(--space-2);
  color: var(--color-text-inverse);
}

.health-score-grade--a { background: var(--color-green); }
.health-score-grade--b { background: var(--color-blue); }
.health-score-grade--c { background: var(--color-orange); }
.health-score-grade--d { background: var(--color-red); }
.health-score-grade--f { background: var(--color-red); }

.health-score-targets-summary {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

.health-score-components {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.health-score-component-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.health-score-component-name {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.health-score-component-value {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-semibold);
}

.health-score-bar {
  position: relative;
  height: 8px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  overflow: visible;
}

.health-score-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.health-score-bar--excellent { background: var(--color-green); }
.health-score-bar--good { background: var(--color-blue); }
.health-score-bar--needs_work { background: var(--color-orange); }
.health-score-bar--poor { background: var(--color-red); }

.health-score-bar-target {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  background: var(--color-text-primary);
  border-radius: 1px;
  opacity: 0.4;
}

/* Attention Section */
.health-score-attention {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-light);
}

.health-score-attention-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-3) 0;
}

.health-score-attention-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.health-score-attention-item + .health-score-attention-item {
  border-top: 1px solid var(--color-border-light);
}

.health-score-attention-status {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  flex-shrink: 0;
}

.health-score-attention-status--excellent { background: var(--color-green); }
.health-score-attention-status--good { background: var(--color-blue); }
.health-score-attention-status--needs_work { background: var(--color-orange); }
.health-score-attention-status--poor { background: var(--color-red); }

.health-score-attention-content strong {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.health-score-attention-content p {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin: var(--space-1) 0;
}

.health-score-actions-list {
  margin: var(--space-2) 0 0 var(--space-4);
  padding: 0;
  list-style: disc;
}

.health-score-actions-list li {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-1);
}

/* Coverage info */
.health-score-coverage {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-2);
}

.health-score-cap {
  color: var(--color-orange);
  font-weight: var(--font-weight-medium);
}

/* Disconnected/not-connected state */
.health-score-component--disconnected {
  opacity: 0.55;
}

.health-score-not-connected {
  font-size: var(--font-size-xs);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-normal);
  margin-left: var(--space-2);
}

.health-score-component-insight {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  margin: var(--space-1) 0 0 0;
}

/* New trend style */
.health-score-trend--new {
  background: var(--color-border-light);
  color: var(--color-text-secondary);
}

/* Fair status bar color */
.health-score-bar--fair { background: var(--color-orange); }
.health-score-attention-status--fair { background: var(--color-orange); }

/* Responsive */
@media (max-width: 640px) {
  .health-score-body {
    flex-direction: column;
    align-items: center;
  }

  .health-score-gauge {
    margin-bottom: var(--space-4);
  }
}
