/* Styles for the leaderboard interface */

#leaderboard-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100% - 80px); /* Full height minus tabs height */
  background-color: #0a0a2a;
  z-index: 990;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

/* Leaderboard header with title and period tabs */
.leaderboard-header {
  padding: 15px;
  text-align: center;
  background-color: #0a0a2a;
  border-bottom: 2px solid #5050ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.leaderboard-header h2 {
  margin: 0 0 10px 0;
  font-size: 22px;
  color: white;
  text-shadow: 0 0 10px #5050ff;
}

/* Period tabs (today, week, month) */
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.leaderboard-tab {
  padding: 5px 15px;
  border-radius: 15px;
  background-color: #1a1a4a;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.leaderboard-tab:hover {
  background-color: #2a2a5a;
  color: #ddd;
}

.leaderboard-tab.active {
  background-color: #5050ff;
  color: white;
}

/* Content area with scrollable list */
.leaderboard-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: #5050ff #0a0a2a;
}

/* Custom scrollbar */
.leaderboard-content::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-content::-webkit-scrollbar-track {
  background: #0a0a2a;
}

.leaderboard-content::-webkit-scrollbar-thumb {
  background-color: #5050ff;
  border-radius: 10px;
}

/* Loading indicator */
.leaderboard-loading {
  text-align: center;
  color: #aaa;
  padding: 20px;
  font-style: italic;
}

/* Empty state message */
.leaderboard-empty {
  text-align: center;
  color: #aaa;
  padding: 30px;
  font-style: italic;
}

/* List of leaderboard entries */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 15px;
}

/* Individual leaderboard entry */
.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background-color: #1a1a4a;
  border-radius: 10px;
  border-left: 4px solid #5050ff;
  transition: transform 0.2s ease;
  gap: 15px; /* Equal spacing between all elements */
}

.leaderboard-item:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(80, 80, 255, 0.2);
}

/* Rank number - fixed width for alignment */
.leaderboard-rank {
  font-size: 18px;
  font-weight: bold;
  min-width: 30px;
  text-align: center;
}

/* Styling for avatars */
.leaderboard-avatar {
  position: relative;
  width: 50px;
  height: 50px;
  min-width: 40px; /* Prevent shrinking */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 16px;
}

.leaderboard-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%; 
  object-fit: cover;
  display: block;
}

.leaderboard-avatar .online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background-color: #00ff00; /* Или любой зелёный */
  border-radius: 50%;
  box-sizing: border-box;
}

/* Player information adjustments */
.leaderboard-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 50px;
}

.leaderboard-player-name {
  font-weight: bold;
  font-size: 16px;
  line-height: 1.2;
}

.leaderboard-player-info {
  font-size: 12px;
  color: #aaa;
  line-height: 1.2;
}

/* Style for "Вы" badge */
.current-player-badge {
  color: #50ffff;
  font-weight: normal;
  font-size: 14px;
}

/* Score display */
.leaderboard-score {
  font-weight: bold;
  font-size: 18px;
  color: #ffffff;
  min-width: 40px;
  text-align: right;
}

/* Special styling for top 3 places */
.leaderboard-item.rank-1 {
  border-left: 4px solid gold;
  background-color: rgba(255, 215, 0, 0.1);
}

.leaderboard-item.rank-2 {
  border-left: 4px solid silver;
  background-color: rgba(192, 192, 192, 0.1);
}

.leaderboard-item.rank-3 {
  border-left: 4px solid #cd7f32; /* bronze */
  background-color: rgba(205, 127, 50, 0.1);
}

.leaderboard-item.rank-1 .leaderboard-rank::before {
  content: "👑 ";
}

/* Styling for current player */
.leaderboard-item.current-player {
  background-color: rgba(80, 80, 255, 0.15);
  border-left: 4px solid #50ffff;
  box-shadow: 0 0 10px rgba(80, 255, 255, 0.3);
  border: 1px solid #50ffff; /* Добавляем бордер вокруг всей карточки игрока */
}

/* Divider between top players and current player */
.leaderboard-divider {
  text-align: center;
  color: #aaa;
  padding: 10px 0;
  font-size: 20px;
  letter-spacing: 5px;
}
