/* Charts Section Styles */
.charts-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.charts-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      circle at 20% 50%,
      rgba(251, 189, 76, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 50%,
      rgba(251, 189, 76, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.charts-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.charts-title {
  text-align: center;
  margin-bottom: 60px;
}

.charts-title span {
  display: inline-block;
  background: linear-gradient(90deg, #fbbd4c, #e9a03d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}

.charts-title h2 {
  color: #fff;
  font-size: 42px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  font-family: "Montserrat", sans-serif;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.chart-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(251, 189, 76, 0.2);
  border-radius: 20px;
  padding: 30px;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible; /* Changed from hidden to visible */
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fbbd4c, #e9a03d);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.chart-card:hover {
  transform: translateY(-5px);
  border-color: rgba(251, 189, 76, 0.5);
  box-shadow: 0 10px 40px rgba(251, 189, 76, 0.2);
}

.chart-card:hover::before {
  transform: scaleX(1);
}

.chart-card h3 {
  color: #fbbd4c;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 25px 0;
  text-align: center;
  font-family: "Montserrat", sans-serif;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 400px; /* Changed from fixed height to min-height */
  height: auto; /* Allow height to grow */
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Changed from center */
  padding-bottom: 20px;
}

.chart-wrapper canvas {
  max-width: 100%;
  height: auto !important; /* Allow canvas to resize */
}

.loading-chart {
  text-align: center;
  color: #fbbd4c;
  font-size: 16px;
  padding: 40px;
}

.loading-chart::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

.error-chart {
  text-align: center;
  color: #f06956;
  font-size: 14px;
  padding: 20px;
}

.stats-summary {
  background: rgba(251, 189, 76, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-top: 30px;
  text-align: center;
}

.stats-summary p {
  color: #fff;
  margin: 5px 0;
  font-size: 14px;
}

.stats-summary strong {
  color: #fbbd4c;
  font-size: 24px;
  display: block;
  margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  .charts-section {
    padding: 60px 0;
  }

  .charts-title h2 {
    font-size: 32px;
  }

  .charts-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .chart-wrapper {
    min-height: 350px;
  }
}

/* Chart Legend Active States */
.chart-wrapper canvas {
  max-width: 100%;
  height: auto !important;
}

/* Style for Chart.js legend items */
:root {
  --legend-transition: all 0.3s ease;
}

/* Legend item hover effect */
.chart-card .chartjs-legend li {
  cursor: pointer !important;
  transition: var(--legend-transition);
  opacity: 1;
  padding: 5px 8px;
  border-radius: 5px;
  margin: 3px;
}

.chart-card .chartjs-legend li:hover {
  background-color: rgba(251, 189, 76, 0.1);
  transform: scale(1.05);
}

/* Hidden/inactive legend state */
.chart-card .chartjs-legend li.legend-hidden {
  opacity: 0.3;
  text-decoration: line-through;
}

.chart-card .chartjs-legend li.legend-hidden:hover {
  opacity: 0.5;
  background-color: rgba(255, 107, 107, 0.1);
}

/* Active state - when item is visible in chart */
.chart-card .chartjs-legend li:not(.legend-hidden) {
  opacity: 1;
  font-weight: 500;
}



