/* Players Styles */
.players-container {
  min-height: 100vh;
  background: #ffffff;
  position: relative;
}

.players-header {
  background: linear-gradient(135deg, #c8102e 0%, #13294b 100%);
  color: #ffffff;
  padding: 10px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.players-main {
  padding: 40px 0;
}

.players-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.players-header-section {
  text-align: center;
  margin-bottom: 40px;
}

.players-header-section h2 {
  color: #13294b;
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.players-header-section p {
  color: #b1b3b3;
  font-size: 1.2rem;
  margin: 0;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-label {
  color: #13294b;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.sort-select {
  background: #ffffff;
  color: #13294b;
  border: 2px solid #b1b3b3;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
}

.sort-select:hover {
  border-color: #c8102e;
}

.sort-select:focus {
  outline: none;
  border-color: #c8102e;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.sort-direction-button,
.sort-button {
  background: #ffffff;
  color: #13294b;
  border: 2px solid #b1b3b3;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.sort-direction-button:hover,
.sort-button:hover {
  border-color: #c8102e;
  color: #c8102e;
  background: #fff5f5;
}

.sort-direction-button:active,
.sort-button:active {
  transform: scale(0.95);
}

.view-mode-label {
  color: #13294b;
  font-size: 1rem;
  font-weight: 600;
}

.view-button {
  background: #ffffff;
  color: #13294b;
  border: 2px solid #b1b3b3;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-button:hover {
  border-color: #c8102e;
  color: #c8102e;
}

.view-button.active {
  background: #c8102e;
  color: #ffffff;
  border-color: #c8102e;
}

.players-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.stat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #c8102e;
}

.stat-card h3 {
  color: #c8102e;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.stat-card p {
  color: #13294b;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.player-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #b1b3b3;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.player-card.clickable {
  cursor: pointer;
}

.player-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.player-card.clickable:hover {
  border-color: #c8102e;
}

.player-card.admin-player {
  border: 2px solid #c8102e;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.player-avatar {
  text-align: center;
  margin-bottom: 20px;
  font-size: 3rem;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #f8f9fa;
  margin: 0 auto 20px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #c8102e;
  position: relative;
  overflow: hidden;
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.player-avatar-fallback {
  font-size: 3rem;
}

.player-avatar-fallback.hidden {
  display: none;
}

.player-info {
  text-align: center;
}

.player-name {
  color: #13294b;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.player-username {
  color: #b1b3b3;
  font-size: 0.85rem;
  font-style: italic;
  margin: 0 0 4px 0;
}

.player-email {
  color: #b1b3b3;
  font-size: 0.9rem;
  margin: 0 0 15px 0;
}

.player-stats-preview {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.stat-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
    min-width: 60px;
}

.stat-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: #c8102e;
    line-height: 1;
    text-align: center;
    display: block;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: #b1b3b3;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    display: block;
}

.player-status {
  margin-bottom: 15px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.admin {
  background: rgba(200, 16, 46, 0.2);
  color: #c8102e;
  border: 1px solid rgba(200, 16, 46, 0.3);
}

.status-badge.player {
  background: rgba(19, 41, 75, 0.2);
  color: #13294b;
  border: 1px solid rgba(19, 41, 75, 0.3);
}

.player-joined {
  font-size: 0.85rem;
  color: #b1b3b3;
}

.current-user-indicator {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #c8102e;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.role-badge-card {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-align: center;
}

/* Table View Styles */
.players-table-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.players-table {
  width: 100%;
  border-collapse: collapse;
}

.players-table thead tr {
  background: linear-gradient(135deg, #c8102e 0%, #13294b 100%);
}

.players-table th {
  background: none;
  color: #ffffff;
  padding: 15px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  border: none;
  position: relative;
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  position: relative;
}

.sortable-header:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sortable-header:active {
  background: rgba(255, 255, 255, 0.2);
}

.players-table th:first-child {
  border-top-left-radius: 12px;
}

.players-table th:last-child {
  border-top-right-radius: 12px;
}

.players-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  color: #000000;
}

.players-table tbody tr:hover {
  background: #f8f9fa;
}

.current-user-row {
  background: rgba(200, 16, 46, 0.05);
}

.current-user-row:hover {
  background: rgba(200, 16, 46, 0.1);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar-small {
  font-size: 1.2rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #c8102e;
  position: relative;
  overflow: hidden;
}

.player-avatar-small-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.player-avatar-small-fallback {
  font-size: 1.2rem;
}

.player-avatar-small-fallback.hidden {
  display: none;
}

.player-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-name-table {
  font-weight: 600;
  color: #13294b;
}

.player-username-table {
  font-size: 0.8rem;
  color: #b1b3b3;
  font-style: italic;
}

.status-badge-small {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-badge-small.admin {
  background: rgba(200, 16, 46, 0.2);
  color: #c8102e;
  border: 1px solid rgba(200, 16, 46, 0.3);
}

.status-badge-small.player {
  background: rgba(19, 41, 75, 0.2);
  color: #13294b;
  border: 1px solid rgba(19, 41, 75, 0.3);
}

.role-badge-small {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #ffffff;
  text-align: center;
  min-width: 60px;
}

/* Player Profile View Styles */
.player-profile-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.profile-info-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.profile-picture-area {
  flex-shrink: 0;
}

.profile-picture-container {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid #c8102e;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.profile-picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-placeholder {
  font-size: 3rem;
  color: #b1b3b3;
}

.profile-placeholder.hidden {
  display: none;
}

.profile-basic-info {
  flex-grow: 1;
}

.profile-name {
  color: #13294b;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.profile-username {
  color: #888;
  font-size: 1rem;
  margin: 0 0 8px 0;
}

.profile-email {
  color: #888;
  font-size: 1rem;
  margin: 0 0 15px 0;
}

.profile-role {
  margin-top: 15px;
}

.role-badge-large {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.role-badge-large.admin {
  background: #c8102e;
}

.role-badge-large.player {
  background: #13294b;
}

.player-stats-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.player-stats-section h2 {
  color: #13294b;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 30px 0;
}

.primary-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.primary-stat-card {
  background: linear-gradient(135deg, #c8102e 0%, #13294b 100%);
  color: #ffffff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
}

.primary-stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.primary-stat-label {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.95;
}

.detailed-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.stat-value {
  color: #c8102e;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 8px 0;
}

.stat-name {
  color: #666;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
  line-height: 1.3;
}

.player-details-section {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
}

.player-details-section h2 {
  color: #13294b;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 25px 0;
}

.details-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e9ecef;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #13294b;
  font-size: 1rem;
}

.detail-value {
  color: #888;
  font-size: 1rem;
  font-weight: 500;
}

.profile-actions {
  text-align: left;
  margin-bottom: 30px;
}

.back-button {
  background: none;
  color: #13294b;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.back-button:hover {
  color: #c8102e;
  transform: translateX(-3px);
}

.no-players {
  text-align: center;
  padding: 60px 20px;
}

.no-players h3 {
  color: #13294b;
  font-size: 1.5rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.no-players p {
  color: #b1b3b3;
  font-size: 1rem;
  margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .players-content {
    padding: 0 15px;
  }
  
  .players-header-section h2 {
    font-size: 2rem;
  }

  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .view-controls,
  .sort-controls {
    justify-content: center;
  }

  .sort-select {
    min-width: 140px;
  }
  
  .players-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .stat-card {
    padding: 20px;
  }
  
  .stat-card h3 {
    font-size: 2rem;
  }
  
  .players-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .player-card {
    padding: 20px;
  }
  
  .player-avatar {
    font-size: 2.5rem;
  }

  /* Player Profile Mobile */
  .player-profile-view {
    padding: 0 15px;
  }

  .profile-info-section {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 25px;
  }

  .profile-picture-container {
    width: 100px;
    height: 100px;
  }

  .profile-placeholder {
    font-size: 2.5rem;
  }

  .profile-name {
    font-size: 1.6rem;
  }

  .player-stats-section,
  .player-details-section {
    padding: 25px;
  }

  .primary-stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .detailed-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .stat-item {
    padding: 15px;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .players-header-section h2 {
    font-size: 1.8rem;
  }
  
  .players-header-section p {
    font-size: 1rem;
  }

  .sort-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sort-label {
    font-size: 0.9rem;
  }

  .sort-select {
    font-size: 0.8rem;
    padding: 6px 10px;
    min-width: 120px;
  }

  .sort-direction-button {
    padding: 6px 10px;
    font-size: 1rem;
    min-width: 35px;
    height: 35px;
  }
  
  .stat-card h3 {
    font-size: 1.8rem;
  }
  
  .player-stats-preview {
    flex-direction: column;
    gap: 10px;
  }

  /* Profile Mobile Optimizations */
  .detailed-stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .player-stats-section h2,
  .player-details-section h2 {
    font-size: 1.5rem;
  }

  .primary-stat-value {
    font-size: 2rem;
  }
}