/* ========================================
   TOP CREATORS LEADERBOARD STYLES
   ======================================== */

/* ========== HERO SECTION ========== */
.leaderboard-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  border: 1px solid rgba(102, 126, 234, 0.3);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.1) 0%, transparent 60%);
  pointer-events: none;
  animation: hero-pulse 4s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.leaderboard-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffd700 0%, #ffec8b 30%, #ffffff 50%, #ffec8b 70%, #ffd700 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gold-shine 5s linear infinite;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

@keyframes gold-shine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.leaderboard-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary, #b3b3b3);
  margin: 0;
}

/* ========== CATEGORY TABS ========== */
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.leaderboard-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: 12px;
  color: var(--text-secondary, #b3b3b3);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.leaderboard-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #fff);
  transform: translateY(-2px);
}

.leaderboard-tab.active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border-color: var(--primary-color, #667eea);
  color: var(--text-primary, #fff);
}

.leaderboard-tab .tab-icon {
  display: flex;
  align-items: center;
}

.leaderboard-tab .tab-icon svg {
  transition: transform 0.3s ease;
}

.leaderboard-tab.active .tab-icon svg {
  transform: scale(1.1);
}

/* ========== LOADING STATE ========== */
.leaderboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  color: var(--text-secondary, #b3b3b3);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color, #667eea);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== PODIUM SECTION ========== */
.leaderboard-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  padding: 2rem 1rem 3rem;
  min-height: 420px;
  margin-bottom: 2rem;
}

/* Base podium position */
.podium-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg, #1e1e1e 0%, #141414 100%);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  text-decoration: none;
  border: 2px solid transparent;
}

/* 3rd Place - Smallest */
.podium-third {
  order: 3;
  transform: scale(0.85);
  margin-top: 80px;
  border-color: #cd7f32;
  box-shadow: 0 0 20px rgba(205, 127, 50, 0.2), inset 0 1px 0 rgba(205, 127, 50, 0.1);
}

.podium-third .podium-avatar-container {
  width: 90px;
  height: 90px;
}

.podium-third .podium-rank-badge {
  background: linear-gradient(135deg, #cd7f32, #e6a860);
}

/* 2nd Place - Medium */
.podium-second {
  order: 1;
  transform: scale(0.95);
  margin-top: 50px;
  border-color: #c0c0c0;
  box-shadow: 0 0 20px rgba(192, 192, 192, 0.2), inset 0 1px 0 rgba(192, 192, 192, 0.1);
}

.podium-second .podium-avatar-container {
  width: 110px;
  height: 110px;
}

.podium-second .podium-rank-badge {
  background: linear-gradient(135deg, #a8a8a8, #e8e8e8);
  color: #333;
}

/* 1st Place - LARGEST & Most Prominent */
.podium-first {
  order: 2;
  transform: scale(1.1);
  z-index: 10;
  border-color: #ffd700;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 215, 0, 0.15);
}

.podium-first .podium-avatar-container {
  width: 140px;
  height: 140px;
}

.podium-first .podium-rank-badge {
  background: linear-gradient(135deg, #b8860b, #ffd700);
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
}

/* Crown for 1st place */
.podium-crown {
  position: absolute;
  top: -45px;
  filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
  animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

/* Glow behind 1st place */
.podium-glow {
  position: absolute;
  width: 250%;
  height: 250%;
  top: -75%;
  left: -75%;
  background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.15) 0%, transparent 60%);
  animation: glow-pulse 4s ease-in-out infinite;
  pointer-events: none;
  z-index: -2;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Medal/Category Icon styling */
.podium-medal {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.podium-medal svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.podium-first .podium-medal {
  width: 40px;
  height: 40px;
  color: #ffd700;
}

.podium-first .podium-medal svg {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
}

.podium-second .podium-medal {
  width: 32px;
  height: 32px;
  color: #c0c0c0;
}

.podium-second .podium-medal svg {
  filter: drop-shadow(0 0 6px rgba(192, 192, 192, 0.4));
}

.podium-third .podium-medal {
  width: 28px;
  height: 28px;
  color: #cd7f32;
}

.podium-third .podium-medal svg {
  filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.4));
}

/* Avatar styling */
.podium-avatar-link {
  text-decoration: none;
}

.podium-avatar-container {
  position: relative;
  border-radius: 50%;
  overflow: visible;
  margin-bottom: 0.75rem;
}

.podium-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
}

.podium-position:hover .podium-avatar {
  transform: scale(1.05);
}

/* Default avatar icon (when no profile image) */
.podium-avatar-default {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 3px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.podium-avatar-default svg {
  width: 50%;
  height: 50%;
  color: rgba(255, 255, 255, 0.5);
}

.podium-position:hover .podium-avatar-default {
  transform: scale(1.05);
}

.podium-rank-badge {
  position: absolute;
  bottom: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  border: 2px solid #1a1a1a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Username */
.podium-username {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.podium-username:hover {
  color: var(--primary-color, #667eea);
}

.podium-first .podium-username {
  font-size: 1.3rem;
  color: #ffd700;
}

.podium-second .podium-username {
  color: #e0e0e0;
}

.podium-third .podium-username {
  color: #e6a860;
}

/* Stats */
.podium-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.podium-first .podium-stat-value {
  font-size: 1.75rem;
  color: #ffd700;
}

.podium-second .podium-stat-value {
  color: #e0e0e0;
}

.podium-third .podium-stat-value {
  color: #e6a860;
}

.podium-stat-label {
  font-size: 0.8rem;
  color: #999999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.podium-videos {
  font-size: 0.75rem;
  color: #777777;
  margin-top: 0.5rem;
}

/* Hover effects */
.podium-first:hover {
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: scale(1.1) translateY(-8px);
}

.podium-second:hover {
  box-shadow: 0 0 30px rgba(192, 192, 192, 0.3), 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.95) translateY(-8px);
}

.podium-third:hover {
  box-shadow: 0 0 30px rgba(205, 127, 50, 0.3), 0 12px 40px rgba(0, 0, 0, 0.5);
  transform: scale(0.85) translateY(-8px);
}

/* Entry animations */
.podium-position {
  opacity: 0;
  animation: podium-enter 0.6s ease-out forwards;
}

.podium-second { animation-delay: 0.3s; }
.podium-first { animation-delay: 0.1s; }
.podium-third { animation-delay: 0.5s; }

@keyframes podium-enter {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.8);
  }
  to {
    opacity: 1;
  }
}

.podium-first {
  animation: podium-enter-first 0.6s ease-out forwards;
  animation-delay: 0.1s;
}

@keyframes podium-enter-first {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

.podium-second {
  animation: podium-enter-second 0.6s ease-out forwards;
  animation-delay: 0.3s;
}

@keyframes podium-enter-second {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(0.95);
  }
}

.podium-third {
  animation: podium-enter-third 0.6s ease-out forwards;
  animation-delay: 0.5s;
}

@keyframes podium-enter-third {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(0.85);
  }
}

/* ========== LEADERBOARD LIST (4-20) ========== */
.leaderboard-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  opacity: 0;
  animation: row-enter 0.4s ease-out forwards;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
  border-color: rgba(102, 126, 234, 0.3);
}

@keyframes row-enter {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.row-rank {
  min-width: 40px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary, #888);
  text-align: center;
}

/* Special styling for ranks 4-10 */
.leaderboard-row[data-rank="4"] .row-rank,
.leaderboard-row[data-rank="5"] .row-rank {
  color: var(--primary-color, #667eea);
}

.row-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.row-avatar-default {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.row-avatar-default svg {
  width: 24px;
  height: 24px;
  color: rgba(255, 255, 255, 0.5);
}

.row-info {
  flex: 1;
  min-width: 0;
}

.row-username {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
  text-decoration: none;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-username:hover {
  color: var(--primary-color, #667eea);
}

.row-videos {
  font-size: 0.8rem;
  color: var(--text-secondary, #888);
}

.row-stat {
  text-align: right;
}

.row-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
}

.row-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
  .leaderboard-title {
    font-size: 2rem;
  }

  .leaderboard-subtitle {
    font-size: 0.95rem;
  }

  .leaderboard-tabs {
    gap: 0.5rem;
  }

  .leaderboard-tab {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  .leaderboard-tab .tab-label {
    display: none;
  }

  .leaderboard-tab .tab-icon svg {
    width: 24px;
    height: 24px;
  }

  .leaderboard-podium {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    min-height: auto;
  }

  .podium-position {
    width: 100%;
    max-width: 280px;
    margin-top: 0 !important;
  }

  .podium-first {
    order: 1;
    transform: scale(1) !important;
  }

  .podium-second {
    order: 2;
    transform: scale(0.95) !important;
  }

  .podium-third {
    order: 3;
    transform: scale(0.9) !important;
  }

  .podium-first .podium-avatar-container,
  .podium-second .podium-avatar-container,
  .podium-third .podium-avatar-container {
    width: 100px;
    height: 100px;
  }

  .podium-crown {
    top: -35px;
  }

  .podium-crown svg {
    width: 36px;
    height: 36px;
  }

  /* Override entry animations for mobile */
  .podium-first {
    animation: podium-enter-mobile 0.5s ease-out forwards;
    animation-delay: 0.1s;
  }

  .podium-second {
    animation: podium-enter-mobile 0.5s ease-out forwards;
    animation-delay: 0.2s;
  }

  .podium-third {
    animation: podium-enter-mobile 0.5s ease-out forwards;
    animation-delay: 0.3s;
  }

  @keyframes podium-enter-mobile {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .leaderboard-row {
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .row-rank {
    min-width: 32px;
    font-size: 1rem;
  }

  .row-avatar,
  .row-avatar-default {
    width: 40px;
    height: 40px;
  }

  .row-avatar-default svg {
    width: 20px;
    height: 20px;
  }

  .row-username {
    font-size: 0.9rem;
  }

  .row-stat-value {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .leaderboard-hero {
    padding: 2rem 1rem;
  }

  .leaderboard-title {
    font-size: 1.75rem;
  }

  .podium-position {
    max-width: 240px;
    padding: 1rem;
  }

  .leaderboard-row {
    flex-wrap: wrap;
  }

  .row-info {
    flex: 1 1 calc(100% - 100px);
  }

  .row-stat {
    flex: 1 1 100%;
    text-align: left;
    margin-top: 0.5rem;
    padding-left: 52px;
  }
}
