/* ===== TREND GRAPH SECTION ===== */

/* Adjust this variable to change the chart height */
:root {
  --trend-chart-width: 80%;
  --trend-chart-height: 380px;
}

.trend-section {
  margin: 0 0 2rem;
}

.trend-container {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  max-width: var(--trend-chart-width);
  margin: 0 auto;
  border-radius: 10px;
  padding: 24px;
  display: flex;
  gap: 24px;
}

.trend-chart-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* .trend-title and .trend-subtitle styling is now controlled
   by style.css via the shared sub-header rules.
   Do NOT redefine font-size/weight/color here. */

.trend-canvas-wrapper {
  position: relative;
  width: 100%;
  height: var(--trend-chart-height);
  min-height: 320px;
}

.trend-canvas-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Legend */
.trend-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
}

.trend-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.trend-legend-swatch {
  width: 24px;
  height: 3px;
  border-radius: 2px;
}

.trend-legend-swatch.year-2025 {
  background: #ff9800;
}

.trend-legend-swatch.year-2026 {
  background: #4caf50;
}

/* Metric selector panel (right side) */
.trend-metric-selector {
  width: 260px;
  min-width: 220px;
  border-left: 1px solid var(--bg-card-border);
  padding-left: 24px;
  display: flex;
  flex-direction: column;
}

.trend-selector-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.trend-metric-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 360px;
}

.trend-metric-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  color: var(--text-secondary);
}

.trend-metric-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

.trend-metric-option.active {
  background: rgba(33, 150, 243, 0.1);
  color: var(--text-primary);
}

.trend-metric-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.trend-metric-option.active .trend-metric-radio {
  border-color: var(--accent-blue);
}

.trend-metric-radio-inner {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.15s;
}

.trend-metric-option.active .trend-metric-radio-inner {
  background: var(--accent-blue);
}

.trend-metric-label {
  line-height: 1.3;
}

/* Responsive */
@media (max-width: 900px) {
  .trend-container {
    flex-direction: column;
  }

  .trend-metric-selector {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 1px solid var(--bg-card-border);
    padding-left: 0;
    padding-top: 16px;
  }

  .trend-metric-list {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: unset;
  }

  .trend-metric-option {
    flex: 0 0 auto;
  }
}
