/* ============================================
   EL OLFATO — Chart-specific Styles
   ============================================ */

/* ── Chart Container ── */

.chart-container {
  position: relative;
  width: 100%;
  padding: var(--space-4);
}

.chart-container canvas {
  width: 100% !important;
}

.chart-container-sm {
  height: 200px;
}

.chart-container-md {
  height: 320px;
}

.chart-container-lg {
  height: 420px;
}

/* ── Chart Header ── */

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-primary);
}

.chart-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chart-title svg {
  width: 20px;
  height: 20px;
  color: var(--accent-primary);
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ── Chart Time Range Selector ── */

.chart-range-selector {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  padding: 2px;
  border-radius: var(--radius-md);
}

.chart-range-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chart-range-btn:hover {
  color: var(--text-secondary);
}

.chart-range-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ── Chart Legend ── */

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-primary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.legend-item.dimmed {
  opacity: 0.3;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ── Podium (for ranking) ── */

.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-4) var(--space-4);
  min-height: 280px;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  max-width: 180px;
}

.podium-avatar {
  margin-bottom: var(--space-3);
  position: relative;
}

.podium-medal {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-md);
}

.podium-medal-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

.podium-medal-silver {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #1f2937;
}

.podium-medal-bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #fff;
}

.podium-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.podium-stat {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-bottom: var(--space-3);
}

.podium-bar {
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
}

/* nth-child(1) = 2º clasificado (izquierda) — plata */
.podium-place:nth-child(1) .podium-bar {
  height: 120px;
  background: linear-gradient(180deg, rgba(156, 163, 175, 0.12), rgba(156, 163, 175, 0.03));
  border: 1px solid rgba(156, 163, 175, 0.2);
  border-bottom: none;
  color: #9ca3af;
}

/* nth-child(2) = 1º clasificado (centro) — oro, el más alto */
.podium-place:nth-child(2) .avatar {
  width: 60px;
  height: 60px;
  font-size: 1.1rem;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.35), 0 0 20px rgba(251, 191, 36, 0.15);
}

.podium-place:nth-child(2) .podium-bar {
  height: 160px;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.03));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-bottom: none;
  color: #fbbf24;
}

/* nth-child(3) = 3º clasificado (derecha) — bronce */
.podium-place:nth-child(3) .podium-bar {
  height: 90px;
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.12), rgba(217, 119, 6, 0.03));
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-bottom: none;
  color: #d97706;
}

/* ── Risk/Reward Indicator ── */

.risk-reward-bar {
  display: flex;
  align-items: center;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.risk-reward-risk {
  height: 100%;
  background: var(--danger);
}

.risk-reward-reward {
  height: 100%;
  background: var(--success);
}

.risk-reward-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* ── Heatmap Colors ── */

.heat-very-negative { background: rgba(239, 68, 68, 0.3); color: var(--danger); }
.heat-negative { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.heat-neutral { background: var(--neutral-soft); color: var(--text-secondary); }
.heat-positive { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.heat-very-positive { background: rgba(16, 185, 129, 0.3); color: var(--success); }
