/* Player List UI - Scoreboard and Player Roster */

.player-list-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.92);
  border: 2px solid rgba(0, 217, 255, 0.4);
  border-radius: 12px;
  padding: 24px;
  min-width: 600px;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 9999; /* Above FPS panel (9998) but below persistent header (10000) */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 217, 255, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.player-list-container.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.player-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(0, 217, 255, 0.3);
}

.player-list-title {
  font-size: 24px;
  font-weight: 700;
  color: #00d9ff;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(0, 217, 255, 0.6);
}

.player-count {
  font-size: 14px;
  color: #888;
  font-weight: 600;
}

.player-count-number {
  color: #00d9ff;
  font-weight: 700;
}

/* Table */
.player-list-table {
  width: 100%;
  border-collapse: collapse;
}

.player-list-table thead {
  background: rgba(0, 217, 255, 0.1);
  border-bottom: 2px solid rgba(0, 217, 255, 0.3);
}

.player-list-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00d9ff;
}

.player-list-table th.center {
  text-align: center;
}

.player-list-table th.right {
  text-align: right;
}

/* Player Rows */
.player-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s ease;
}

.player-row:hover {
  background: rgba(0, 217, 255, 0.05);
}

.player-row.self {
  background: rgba(0, 217, 255, 0.15);
  border-left: 3px solid #00d9ff;
}

.player-row.self:hover {
  background: rgba(0, 217, 255, 0.2);
}

.player-list-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #ddd;
}

/* Rank Column */
.player-rank {
  font-weight: 700;
  color: #888;
  text-align: center;
  font-size: 16px;
}

.player-row:nth-child(1) .player-rank {
  color: #ffd700; /* Gold */
}

.player-row:nth-child(2) .player-rank {
  color: #c0c0c0; /* Silver */
}

.player-row:nth-child(3) .player-rank {
  color: #cd7f32; /* Bronze */
}

/* Name Column */
.player-name {
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-name-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-row.self .player-name-text {
  color: #00d9ff;
  font-weight: 700;
}

.player-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.player-badge.you {
  background: #00d9ff;
  color: black;
}

.player-badge.admin {
  background: #ff4444;
  color: white;
}

/* Stats Columns */
.player-kills {
  font-weight: 700;
  color: #00ff88;
  text-align: center;
}

.player-deaths {
  font-weight: 700;
  color: #ff6666;
  text-align: center;
}

.player-kd {
  font-weight: 700;
  color: #ffaa00;
  text-align: center;
}

.player-score {
  font-weight: 700;
  color: #00d9ff;
  text-align: right;
  font-size: 16px;
}

/* Ping Column */
.player-ping {
  text-align: center;
  font-weight: 600;
}

.ping-excellent {
  color: #00ff88;
}

.ping-good {
  color: #88ff00;
}

.ping-fair {
  color: #ffaa00;
}

.ping-poor {
  color: #ff6666;
}

/* Status Indicator */
.player-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.player-status.alive {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}

.player-status.dead {
  background: #666;
}

/* Footer */
.player-list-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
}

.player-list-hint {
  color: #00d9ff;
  font-weight: 600;
}

.player-list-footer-right {
  display: flex;
  gap: 16px;
}

.footer-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-stat-label {
  color: #888;
}

.footer-stat-value {
  color: white;
  font-weight: 700;
}

/* Empty State */
.player-list-empty {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.player-list-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.player-list-empty-text {
  font-size: 16px;
  color: #666;
}

/* Scrollbar */
.player-list-container::-webkit-scrollbar {
  width: 8px;
}

.player-list-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.player-list-container::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.3);
  border-radius: 4px;
}

.player-list-container::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 217, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
  .player-list-container {
    min-width: 0;
    width: 90vw;
    padding: 16px;
  }

  .player-list-title {
    font-size: 20px;
  }

  .player-list-table th,
  .player-list-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .player-rank {
    font-size: 14px;
  }

  .player-score {
    font-size: 14px;
  }

  /* Hide less important columns on mobile */
  .hide-mobile {
    display: none;
  }
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translate(-50%, -45%);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

.player-list-container.visible {
  animation: slideIn 0.3s ease-out;
}

@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.player-row {
  animation: rowFadeIn 0.3s ease-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .player-list-container,
  .player-row {
    animation: none;
  }

  .player-list-container {
    transition: none;
  }
}
