/* Leaderboard Component Styles */
.leaderboard-container {
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
}

.leaderboard-tabs {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.leaderboard-tab-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  flex: 1;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 12px 0;
  text-align: center;
}

.leaderboard-table th {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background-color: black;
  position: sticky;
  top: 0;
  z-index: 10; /* Ensure header stays on top */
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s;
}

.leaderboard-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.player-column {
  text-align: left !important;
  width: 40%;
  padding-left: 5px !important;
}

.player-header-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reload-button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reload-button img {
  filter: brightness(0) saturate(100%) invert(70%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.7) contrast(1);
  transition: filter 0.2s ease;
}

.reload-button:hover {
  color: rgba(255, 255, 255, 0.9);
  background-color: rgba(255, 255, 255, 0.1);
}

.reload-button:hover img {
  filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.9) contrast(1);
}

.reload-button:active {
  transform: scale(0.95);
}

.reload-button.loading {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar-container {
  position: relative;
  width: 36px;
  height: 36px;
}

.player-avatar,
.player-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
}

.player-rank {
  position: absolute;
  top: -8px;
  left: 22px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.rating-column {
  width: 15%;
  color: #4CAF50;
  font-weight: 600;
}

.wins-column {
  width: 15%;
  color: #3498db;
  font-weight: 600;
}

.kd-column {
  width: 15%;
  color: #3498db;
  font-weight: 600;
}

.leaderboard-loading,
.leaderboard-error,
.leaderboard-empty {
  text-align: center;
  padding: 25px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 15px;
}

.leaderboard-loading-more {
  text-align: center;
  padding: 15px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  position: relative;
}

.leaderboard-loading-more::after {
  content: "...";
  animation: loading-dots 1.5s infinite;
}

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

.leaderboard-error {
  color: #e74c3c;
}

/* Highlight top 3 players */
.leaderboard-table tbody tr:nth-child(1) .player-rank {
  background-color: gold;
  color: #333;
}

.leaderboard-table tbody tr:nth-child(2) .player-rank {
  background-color: silver;
  color: #333;
}

.leaderboard-table tbody tr:nth-child(3) .player-rank {
  background-color: #cd7f32; /* bronze */
  color: #fff;
}