.completion-race-container {
  width: 100%;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  gap: 1rem;

  .chart-title {
    flex: 1;

    h3 {
      color: var(--text-color, #ffffff);
      font-size: 1.25rem;
      font-weight: 500;
      margin: 0 0 0.5rem 0;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .chart-description {
      color: var(--text-secondary-color);
      font-size: 0.9rem;
      margin: 0;
      line-height: 1.4;
    }
  }
}

.completion-race-icon {
  font-size: 1.5rem;
  color: #4caf50;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;

  .year-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.6rem;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.3);
      transform: translateY(-1px);
    }

    i {
      font-size: 0.875rem;
    }
  }

  .current-year {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    min-width: 4.5rem;
    text-align: center;
  }
}

.stats-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;

  .stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    min-width: 80px;
    flex: 1;

    .stat-value {
      font-size: 1.5rem;
      font-weight: 600;
      color: #4caf50;
    }

    .stat-subtitle {
      font-size: 0.75rem;
      color: var(--text-secondary-color);
      text-align: center;
      line-height: 1.3;
      max-width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .stat-label {
      font-size: 0.75rem;
      color: var(--text-secondary-color);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-top: 0.25rem;
    }

    &.fastest .stat-value {
      color: #4caf50;
    }

    &.slowest .stat-value {
      color: #ff9800;
    }
  }
}

.chart-wrapper {
  position: relative;
  height: 400px;
  width: 100%;
}

.no-data-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-secondary-color);

  i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
  }

  p {
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-color, #ffffff);
  }

  small {
    font-size: 0.85rem;
    opacity: 0.7;
  }
}

@media (max-width: 768px) {
  .chart-header {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-row {
    .stat-card {
      min-width: 70px;
    }
  }

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

@media (max-width: 480px) {
  .chart-header {
    .chart-title h3 {
      font-size: 1rem;
    }

    .chart-description {
      font-size: 0.8rem;
    }
  }

  .stats-row {
    gap: 0.5rem;

    .stat-card {
      padding: 0.4rem 0.5rem;

      .stat-value {
        font-size: 1.2rem;
      }
    }
  }
}
