/* ================================
 * LEADERBOARD MODAL STYLES
 * Extracted from leaderboard.js inline CSS
 * ================================ */

/* Modal Header */
.leaderboard-modal .modal-header {
  text-align: center;
  margin-bottom: 0.8rem;
  flex-shrink: 0;
}

.leaderboard-modal .leaderboard-title {
  color: #ffd700;
  margin: 0 0 0.6rem 0;
  font-size: 22px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}


/* Toggle Button */
.leaderboard-modal .toggle-container {
  margin: 0.6rem 0;
  text-align: center;
}

.leaderboard-modal #leaderboardModeToggle {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.leaderboard-modal #leaderboardModeToggle:hover {
  background: #2980b9;
}

/* Main Content */
.leaderboard-modal .main-content {
  flex: 1;
  min-height: 0;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.leaderboard-modal .leaderboard-content {
  height: 100%;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: #34495e #2c3e50;
  position: relative;
}

.leaderboard-modal .leaderboard-content::-webkit-scrollbar {
  width: 8px;
}

.leaderboard-modal .leaderboard-content::-webkit-scrollbar-track {
  background: #2c3e50;
}

.leaderboard-modal .leaderboard-content::-webkit-scrollbar-thumb {
  background: #34495e;
  border-radius: 4px;
}

/* Loading Spinner */
.leaderboard-modal .loading-spinner {
  text-align: center;
  padding: 40px;
}

.leaderboard-modal .loading-spinner div {
  font-size: 18px;
  color: white;
}

/* Modal Footer */
.leaderboard-modal .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid #34495e;
  padding-top: 0.75rem;
  text-align: center;
  position: sticky;
  bottom: 0;
  background: #2c3e50;
  z-index: 20;
}

.leaderboard-modal .footer-map-buttons {
  margin-bottom: 1rem;
  text-align: center;
  padding: 0 0.5rem;
}

.leaderboard-modal .footer-map-buttons .map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.4rem;
}

.leaderboard-modal .footer-map-btn {
  font-size: 11px;
  padding: 8px 6px;
  white-space: normal;
  overflow: hidden;
  max-width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.leaderboard-modal .close-modal-footer {
  font-size: 14px;
  padding: 8px 16px;
  min-width: 100px;
}

/* Leaderboard Tables */
.leaderboard-modal .leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.leaderboard-modal .leaderboard-table.solo-table {
  min-width: 400px;
}

.leaderboard-modal .leaderboard-table thead tr {
  background: #34495e;
  position: sticky;
  top: 0;
  z-index: 10;
}

.leaderboard-modal .leaderboard-table th {
  padding: 0.5rem;
  text-align: center;
  color: white;
  width: 50px;
  min-width: 50px;
  background: #34495e;
  border-bottom: 2px solid #2c3e50;
}

.leaderboard-modal .leaderboard-table th.rank-col {
  width: 50px;
  min-width: 50px;
}

.leaderboard-modal .leaderboard-table th.player-col {
  text-align: left;
  width: 40%;
  min-width: 120px;
}

.leaderboard-modal .leaderboard-table th.player-col.solo {
  width: 50%;
}

.leaderboard-modal .leaderboard-table th.winrate-col {
  width: 15%;
  min-width: 80px;
}

.leaderboard-modal .leaderboard-table th.wins-col {
  width: 15%;
  min-width: 60px;
}

.leaderboard-modal .leaderboard-table th.defeats-col {
  width: 15%;
  min-width: 70px;
}

.leaderboard-modal .leaderboard-table th.games-col {
  width: 15%;
  min-width: 80px;
}

.leaderboard-modal .leaderboard-table th.time-col,
.leaderboard-modal .leaderboard-table th.moves-col {
  width: 25%;
  min-width: 80px;
}

/* Table Rows */
.leaderboard-modal .leaderboard-table tbody tr {
  border-bottom: 1px solid #34495e;
  height: 42px;
}

.leaderboard-modal .leaderboard-table td {
  padding: 0.4rem 0.5rem;
  text-align: center;
  color: white;
  vertical-align: middle;
}

.leaderboard-modal .leaderboard-table td.rank-cell {
  width: 50px;
  min-width: 50px;
}

.leaderboard-modal .leaderboard-table td.player-cell {
  text-align: left;
  width: 40%;
  min-width: 120px;
  max-width: 200px;
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
  overflow: hidden;
}

.leaderboard-modal .leaderboard-table td.player-cell.solo {
  width: 50%;
  max-width: 250px;
}

.leaderboard-modal .leaderboard-table td.winrate-cell {
  width: 15%;
  min-width: 80px;
}

.leaderboard-modal .leaderboard-table td.wins-cell {
  width: 15%;
  min-width: 60px;
}

.leaderboard-modal .leaderboard-table td.defeats-cell {
  width: 15%;
  min-width: 70px;
}

.leaderboard-modal .leaderboard-table td.games-cell {
  width: 15%;
  min-width: 80px;
}

.leaderboard-modal .leaderboard-table td.time-cell,
.leaderboard-modal .leaderboard-table td.moves-cell {
  width: 25%;
  min-width: 80px;
}

/* Player Info in Table */
.leaderboard-modal .player-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  max-width: 100%;
  min-height: 42px;
}

.leaderboard-modal .player-name-container {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.leaderboard-modal .player-name {
  font-weight: 600;
  font-size: 0.9em;
}

.leaderboard-modal .player-character {
  font-size: 0.75em;
  opacity: 0.8;
}

/* Player Position Card */
.leaderboard-modal .player-position-card {
  background: linear-gradient(145deg, #34495e, #2c3e50);
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-modal .player-position-header {
  color: white;
  margin: 0 0 0.5rem 0;
  text-align: center;
  font-size: 1.1rem;
}

.leaderboard-modal .player-position-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaderboard-modal .player-position-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaderboard-modal .player-rank {
  font-weight: bold;
  font-size: 1.2rem;
  color: #ffd700;
}

.leaderboard-modal .player-position-name {
  font-weight: 600;
}

.leaderboard-modal .player-position-character {
  font-size: 0.85em;
  opacity: 0.8;
  margin-left: 8px;
}

.leaderboard-modal .player-position-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.leaderboard-modal .player-stat-value {
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
}

.leaderboard-modal .player-stat-label {
  color: #bdc3c7;
  font-size: 0.9rem;
}

/* Guest Actions */
.leaderboard-modal .guest-actions {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  border: 2px solid #e74c3c;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-modal .guest-actions .auth-prompt {
  margin-bottom: 0.5rem;
}

.leaderboard-modal .guest-actions .auth-button {
  background: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin: 0 4px;
  transition: background-color 0.3s;
}

.leaderboard-modal .guest-actions .auth-button:hover {
  background: #2980b9;
}

.leaderboard-modal .guest-actions .auth-title {
  color: #e74c3c;
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
}

.leaderboard-modal .guest-actions .auth-description {
  color: #ecf0f1;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Compact Guest Actions */
.leaderboard-modal .guest-actions.compact {
  background: linear-gradient(145deg, #e74c3c, #c0392b);
  border: 2px solid #e74c3c;
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-modal .guest-actions.compact .auth-prompt {
  margin-bottom: 0.5rem;
}

.leaderboard-modal .guest-actions.compact .auth-button {
  background: #3498db;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin: 0 3px;
  transition: background-color 0.3s;
}

.leaderboard-modal .guest-actions.compact .auth-button:hover {
  background: #2980b9;
}

.leaderboard-modal .guest-actions.compact .auth-title {
  color: #e74c3c;
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
}

.leaderboard-modal .guest-actions.compact .auth-description {
  color: #bdc3c7;
  margin: 0 0 0.5rem 0;
  font-size: 0.75rem;
  opacity: 0.9;
}

.leaderboard-modal .guest-actions.compact .auth-buttons {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* Connection Issues */
.leaderboard-modal .connection-issues {
  background: linear-gradient(145deg, #f39c12, #e67e22);
  border: 2px solid #f39c12;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leaderboard-modal .connection-issues .connection-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.leaderboard-modal .connection-issues .connection-icon {
  width: 20px;
  height: 20px;
  background: #e74c3c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.leaderboard-modal .connection-issues .connection-title {
  color: #f39c12;
  margin: 0;
  font-size: 0.9rem;
}

.leaderboard-modal .connection-issues .connection-description {
  color: #ecf0f1;
  margin: 0 0 0.5rem 0;
  font-size: 0.8rem;
  line-height: 1.3;
}

.leaderboard-modal .connection-issues .retry-button {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.leaderboard-modal .connection-issues .retry-button:hover {
  background: #c0392b;
}

/* Empty State */
.leaderboard-modal .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: white;
}

.leaderboard-modal .empty-state .empty-icon-container {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.leaderboard-modal .empty-state .empty-icon {
  width: 64px;
  height: 64px;
  background: #34495e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bdc3c7;
  font-size: 24px;
}

.leaderboard-modal .empty-state .empty-title {
  margin: 0 0 12px 0;
  color: #ffd700;
  font-size: 24px;
}

.leaderboard-modal .empty-state .empty-message {
  margin: 0;
  font-size: 16px;
  color: #ecf0f1;
  line-height: 1.5;
}

.leaderboard-modal .empty-state .empty-subtitle {
  margin-top: 16px;
  font-size: 14px;
  color: #bdc3c7;
  font-style: italic;
}

/* Error State */
.leaderboard-modal .error-state {
  text-align: center;
  padding: 60px 20px;
  color: #dc3545;
}

.leaderboard-modal .error-state .error-icon-container {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.leaderboard-modal .error-state .error-icon {
  width: 64px;
  height: 64px;
  background: #e74c3c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.leaderboard-modal .error-state .error-title {
  margin: 0 0 12px 0;
  color: #e74c3c;
  font-size: 24px;
}

.leaderboard-modal .error-state .error-message {
  margin: 0;
  font-size: 16px;
  color: #ecf0f1;
  line-height: 1.5;
}

.leaderboard-modal .error-state .error-subtitle {
  margin-top: 16px;
  font-size: 14px;
  color: #bdc3c7;
  font-style: italic;
}

/* Email Confirmation Component */
.leaderboard-modal .unconfirmed-user-message {
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .leaderboard-modal .main-content {
    max-height: 75vh;
  }
  
  .leaderboard-modal .leaderboard-content {
    max-height: 72vh;
  }
  
  .leaderboard-modal .leaderboard-title {
    font-size: 18px;
  }
  
  .leaderboard-modal .leaderboard-table {
    font-size: 14px;
    min-width: 350px;
  }
  
  .leaderboard-modal .leaderboard-table.solo-table {
    min-width: 300px;
  }
  
  .leaderboard-modal .leaderboard-table th,
  .leaderboard-modal .leaderboard-table td {
    padding: 0.3rem 0.4rem;
  }
  
  .leaderboard-modal .leaderboard-table tbody tr {
    height: 38px;
  }
  
  .leaderboard-modal .player-info {
    gap: 4px;
  }
  
  .leaderboard-modal .player-name {
    font-size: 0.85em;
  }
  
  .leaderboard-modal .player-character {
    font-size: 0.7em;
  }
}

@media (max-width: 480px) {
  .leaderboard-modal .main-content {
    max-height: 78vh;
  }
  
  .leaderboard-modal .leaderboard-content {
    max-height: 75vh;
  }
  
  .leaderboard-modal .leaderboard-title {
    font-size: 16px;
    margin: 0 0 0.4rem 0;
  }
  
  .leaderboard-modal .toggle-container {
    margin: 0.4rem 0;
  }
  
  .leaderboard-modal .leaderboard-table {
    font-size: 13px;
    min-width: 280px;
  }
  
  .leaderboard-modal .leaderboard-table.solo-table {
    min-width: 250px;
  }
  
  .leaderboard-modal .leaderboard-table th,
  .leaderboard-modal .leaderboard-table td {
    padding: 0.25rem 0.3rem;
  }
  
  .leaderboard-modal .leaderboard-table tbody tr {
    height: 34px;
  }
  
  .leaderboard-modal .player-position-card {
    padding: 0.8rem;
    margin-bottom: 0.8rem;
  }
  
  .leaderboard-modal .player-position-header {
    font-size: 1rem;
  }
  
  .leaderboard-modal .player-rank {
    font-size: 1.1rem;
  }
}

/* Animations (moved from inline JavaScript) */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}