/* Leaderboard Table Styling */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Table header */
.leaderboard-table thead th {
  background-color: white;
  color: #333;
  padding: 10px 12px;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

.leaderboard-table thead tr:first-child th {
  border-bottom: none;
}

/* Table body */
.leaderboard-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

/* Bold total column */
.leaderboard-table td:last-child {
  font-weight: bold;
}


/* Skeleton base style */
.skeleton-text,
.skeleton-bar,
.skeleton-circle-text,
.skeleton-img-placeholder,
.skeleton-grade-box,
.skeleton-divider,
/* .progress-bar, */
.skeleton-row .skeleton-problem-num,
.skeleton-problem-name,
.skeleton-label,
.skeleton-value,
.skeleton-xp-circle {
  background-color: #e0e0e0;
  border-radius: 4px;
  animation: skeleton-loading 1.5s infinite ease-in-out;
}

@keyframes skeleton-loading {
  0% {
    background-color: #e0e0e0;
  }
  50% {
    background-color: #f0f0f0;
  }
  100% {
    background-color: #e0e0e0;
  }
}

.table-wrapper {
  max-width: 100%;
}

.scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (min-width: 768px) {
  .scroll-wrapper {
    overflow-x: visible;
  }
}

/* Prevent scroll from hiding sticky columns */
.leaderboard-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  box-shadow: 0px 0px black;
}

.leaderboard-table td {
  word-wrap: break-word;
  overflow: hidden;
}

/* Sticky rank column */
.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 5;
}

.skeleton-text.tiny {
  width: 40px;
  height: 16px;
}

.skeleton-text.short {
  width: 60px;
  height: 16px;
}

.skeleton-text.medium {
  width: 100px;
  height: 16px;
}

.skeleton-grade-box {
  width: 28px;
  height: 28px;
  margin: auto;
}


.skeleton-leaderboard-table td,
.skeleton-leaderboard-table th {
  padding: 4px 8px;
  height: 10px !important;
  line-height: 1.2;
  text-align: center;
}

.skeleton-row {
  height: 50px !important;
}

/* username */
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  width: 80px;
  text-align: left;
  padding-left: 10px;
  padding-right: 5px;
  margin-right: 15px;
  background-color: transparent;
}

/*Rating columns*/
.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3),
.leaderboard-table th:nth-child(4), 
.leaderboard-table td:nth-child(4),
.leaderboard-table th:nth-child(5),
.leaderboard-table td:nth-child(5) {
  width: 30px;
  text-align: center;
  padding: 8px 1px;
  white-space: nowrap;
  font-size: 12px;
  margin-right: 15px;
}

.leaderboard-table th:nth-child(6),
.leaderboard-table td:nth-child(6) {
  padding-left: 90px;
}

/* problem columns*/
.leaderboard-table th:nth-child(n+6),
.leaderboard-table td:nth-child(n+6) {
  width: 30px;
  text-align: right;
  padding-right: 10px;
}

/* Table header */
.leaderboard-table thead th {
  background-color: white;
  color: #333;
  padding: 10px 12px;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid #ccc;
}

.leaderboard-table thead tr:first-child th {
  border-bottom: none;
}

/* Table body */
.leaderboard-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

/* Bold total column */
.leaderboard-table td:last-child {
  font-weight: bold;
}


/* Skeleton base style */
.skeleton-text,
.skeleton-bar,
.skeleton-circle-text,
.skeleton-img-placeholder,
.skeleton-grade-box,
.skeleton-divider,
/* .progress-bar, */
.skeleton-row .skeleton-problem-num,
.skeleton-problem-name,
.skeleton-label,
.skeleton-value,
.skeleton-xp-circle {
  background-color: #e0e0e0;
  border-radius: 4px;
  animation: skeleton-loading 1.5s infinite ease-in-out;
}

@keyframes skeleton-loading {
  0% {
    background-color: #e0e0e0;
  }
  50% {
    background-color: #f0f0f0;
  }
  100% {
    background-color: #e0e0e0;
  }
}

.table-wrapper {
  max-width: 100%;
}

.scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

@media (min-width: 768px) {
  .scroll-wrapper {
    overflow-x: visible;
  }
}

/* Prevent scroll from hiding sticky columns */
.leaderboard-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  box-shadow: 0px 0px black;
}

.leaderboard-table td {
  word-wrap: break-word;
  overflow: hidden;
}

/* Sticky username column */
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  position: sticky;
  left: 40px;
  z-index: 5;
}

.skeleton-text.tiny {
  width: 40px;
  height: 16px;
}

.skeleton-text.short {
  width: 60px;
  height: 16px;
}

.skeleton-text.medium {
  width: 100px;
  height: 16px;
}

.skeleton-grade-box {
  width: 28px;
  height: 28px;
  margin: auto;
}


.skeleton-leaderboard-table td,
.skeleton-leaderboard-table th {
  padding: 4px 8px;
  height: 10px !important;
  line-height: 1.2;
  text-align: center;
}

.skeleton-row {
  height: 50px !important;
}

/* rank column */
.leaderboard-table th:nth-child(1),
.leaderboard-table td:nth-child(1) {
  width: 40px;
  text-align: center;
  padding-left: 25px;
  background-color: white;
}

/* username */
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  width: 80px;
  text-align: left;
  padding-left: 10px;
  padding-right: 5px;
  margin-right: 15px;
  background-color: white;
}

/*Rating columns*/
.leaderboard-table th:nth-child(3),
.leaderboard-table td:nth-child(3),
.leaderboard-table th:nth-child(4), 
.leaderboard-table td:nth-child(4),
.leaderboard-table th:nth-child(5),
.leaderboard-table td:nth-child(5) {
  width: 30px;
  text-align: center;
  padding: 8px 1px;
  white-space: nowrap;
  font-size: 12px;
  margin-right: 15px;
  background-color: white;
}

.leaderboard-table th:nth-child(6),
.leaderboard-table td:nth-child(6) {
  padding-left: 90px;
  background-color: white;
}

/* problem columns*/
.leaderboard-table th:nth-child(n+6),
.leaderboard-table td:nth-child(n+6) {
  width: 30px;
  text-align: right;
  padding-right: 10px;
  background-color: white;
}

@media (min-width: 768px) {
  .leaderboard-table td:last-child,
  .leaderboard-table th:last-child {
    text-align: right;
    padding-right: 17px;
  }
}

.loading-spinner {
  width: 35px; /* Increased size to fit timer */
  height: 35px; /* Match width */
  border: 3px solid rgba(0, 0, 0, 0.2); /* Subtle inactive border */
  border-radius: 50%; /* Circular shape */
  border-top: 3px solid var(--primary-color); /* Keep the primary color for the spinner */
  animation: popupSpin 0.6s linear infinite; /* Smooth and slightly faster spin */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner.big {
  width: 50px; /* Increased size */
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Parent block */
.centered-transp-block_wrapper {
  display: block !important;
  align-items: start  !important;
}

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

.leaderboard-table tbody tr {
  background: white !important;
  transition: all 300ms ease !important;
}

.leaderboard-table tbody tr:hover {
  background: var(--very-light-blue) !important;
  cursor: pointer;
  transform: scale(1.01);
  box-shadow: 
    0 -4px 4px rgba(0, 0, 0, 0.1),
    0 4px 4px rgba(0, 0, 0, 0.1);
}

.leaderboard-table tbody tr:hover td {
  background: var(--very-light-blue) !important;
  transition: background-color 300ms ease !important;
}

/* .leaderboard-table tbody tr:nth-child(even) td:nth-child(1),
.leaderboard-table tbody tr:nth-child(even) td:nth-child(2) {
  background-color: #e6e6e6;
}

.leaderboard-table tbody tr:nth-child(odd) td:nth-child(1),
.leaderboard-table tbody tr:nth-child(odd) td:nth-child(2) {
  background-color: white;
} */

.leaderboard-table tbody tr:hover td:nth-child(1),
.leaderboard-table tbody tr:hover td:nth-child(2) {
  background: var(--very-light-blue) !important;
  transition: background-color 300ms ease !important;
}

.regular-rank {
  color: black; 
  border-radius: 50%; 
  font-weight: 600; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
  margin: 0 auto;
}

.gold-medal, .silver-medal, .bronze-medal {
  margin: 0 auto;
}

.gold-medal{
  background-color: var(--gold); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

.silver-medal {
  background-color: var(--silver); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

.bronze-medal {
  background-color: var(--bronze); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

@media (min-width: 768px) {
  .leaderboard-table td:last-child,
  .leaderboard-table th:last-child {
    text-align: right;
    padding-right: 17px;
  }
}

.loading-spinner {
  width: 35px; /* Increased size to fit timer */
  height: 35px; /* Match width */
  border: 3px solid rgba(0, 0, 0, 0.2); /* Subtle inactive border */
  border-radius: 50%; /* Circular shape */
  border-top: 3px solid var(--primary-color); /* Keep the primary color for the spinner */
  animation: popupSpin 0.6s linear infinite; /* Smooth and slightly faster spin */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner.big {
  width: 50px; /* Increased size */
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Parent block */
.centered-transp-block_wrapper {
  display: block !important;
  align-items: start  !important;
}

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

.leaderboard-table tbody tr {
  background: white !important;
  transition: all 300ms ease !important;
}

.leaderboard-table tbody tr:hover {
  background: var(--very-light-blue) !important;
  cursor: pointer;
  transform: scale(1.01);
}

.leaderboard-table tbody tr:hover td {
  background: var(--very-light-blue) !important;
  transition: background-color 300ms ease !important;
}

/* .leaderboard-table tbody tr:nth-child(even) td:nth-child(1),
.leaderboard-table tbody tr:nth-child(even) td:nth-child(2) {
  background-color: #e6e6e6;
}

.leaderboard-table tbody tr:nth-child(odd) td:nth-child(1),
.leaderboard-table tbody tr:nth-child(odd) td:nth-child(2) {
  background-color: white;
} */

.leaderboard-table tbody tr:hover td:nth-child(1),
.leaderboard-table tbody tr:hover td:nth-child(2) {
  background: var(--very-light-blue) !important;
  transition: background-color 300ms ease !important;
}

.regular-rank {
  color: black; 
  border-radius: 50%; 
  font-weight: 600; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
  margin: 0 auto;
}

.gold-medal, .silver-medal, .bronze-medal {
  margin: 0 auto;
}

.gold-medal{
  background-color: var(--gold); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

.silver-medal {
  background-color: var(--silver); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}

.bronze-medal {
  background-color: var(--bronze); 
  color: black; 
  border-radius: 50%; 
  font-weight: bold; 
  width: 32px; 
  height: 32px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 14px;
}