/* Import base styles from main.css */
@import url('./main.css');

/* Leaderboard-specific animations */
@keyframes crown-spin {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-5deg) scale(1.1);
  }
  50% {
    transform: rotate(0deg) scale(1);
  }
  75% {
    transform: rotate(5deg) scale(1.1);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes champion-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.3);
  }
}

@keyframes silver-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.3), 0 0 40px rgba(192, 192, 192, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.6), 0 0 60px rgba(192, 192, 192, 0.3);
  }
}

@keyframes bronze-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.3), 0 0 40px rgba(205, 127, 50, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(205, 127, 50, 0.6), 0 0 60px rgba(205, 127, 50, 0.3);
  }
}

/* Podium Styles */
.podium-container {
  perspective: 1000px;
}

.podium-position {
  animation: podium-rise 0.8s ease-out;
  margin-right: 10px;
  margin-left: 10px;
}

.podium-position:nth-child(1) { /* 2nd place */
  animation-delay: 0.2s;
  /* transform: translateY(20px); */
}

.podium-position:nth-child(2) { /* 1st place */
  animation-delay: 0.4s;
  /* transform: scale(1.1); */
  z-index: 10;
}

.podium-position:nth-child(3) { /* 3rd place */
  animation-delay: 0.6s;
  /* transform: translateY(40px); */
}

/* First Place - Gold */
.podium-position:nth-child(2) .podium-player {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
  border: 2px solid rgba(255, 215, 0, 0.5);
  animation: champion-glow 3s ease-in-out infinite;
}

.podium-position:nth-child(2) .podium-base {
  height: 120px;
  background: linear-gradient(to bottom, #ffd700, #ffed4e, #d4af37);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.podium-position:nth-child(2) .podium-crown {
  color: #ffd700;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.podium-position:nth-child(2) .podium-avatar {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #1a1a1a;
  border: 3px solid rgba(255, 215, 0, 0.8);
}

/* Second Place - Silver */
.podium-position:nth-child(1) .podium-player {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05));
  border: 2px solid rgba(192, 192, 192, 0.5);
  animation: silver-glow 3s ease-in-out infinite;
}

.podium-position:nth-child(1) .podium-base {
  height: 90px;
  background: linear-gradient(to bottom, #c0c0c0, #e5e5e5, #a8a8a8);
  box-shadow: 0 8px 25px rgba(192, 192, 192, 0.4);
}

.podium-position:nth-child(1) .podium-crown {
  color: #c0c0c0;
  filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.8));
}

.podium-position:nth-child(1) .podium-avatar {
  background: linear-gradient(135deg, #c0c0c0, #e5e5e5);
  color: #1a1a1a;
  border: 3px solid rgba(192, 192, 192, 0.8);
}

/* Third Place - Bronze */
.podium-position:nth-child(3) .podium-player {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05));
  border: 2px solid rgba(205, 127, 50, 0.5);
  animation: bronze-glow 3s ease-in-out infinite;
}

.podium-position:nth-child(3) .podium-base {
  height: 60px;
  background: linear-gradient(to bottom, #cd7f32, #daa520, #b8860b);
  box-shadow: 0 6px 20px rgba(205, 127, 50, 0.4);
}

.podium-position:nth-child(3) .podium-crown {
  color: #cd7f32;
  filter: drop-shadow(0 0 6px rgba(205, 127, 50, 0.8));
}

.podium-position:nth-child(3) .podium-avatar {
  background: linear-gradient(135deg, #cd7f32, #daa520);
  color: #1a1a1a;
  border: 3px solid rgba(205, 127, 50, 0.8);
}

/* Ranking Items */
.ranking-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ranking-item:hover {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.2);
}

.ranking-item .rank-number {
  min-width: 3rem;
  text-align: center;
}

.ranking-item .player-avatar {
  background: linear-gradient(135deg, #00d4ff, #8b5cf6);
  color: white;
  transition: all 0.3s ease;
}

.ranking-item:hover .player-avatar {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

/* Special styling for top ranks in the extended list */
.ranking-item[data-rank="4"] {
  background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(138, 43, 226, 0.05));
  border-color: rgba(138, 43, 226, 0.3);
}

.ranking-item[data-rank="5"] {
  background: linear-gradient(135deg, rgba(75, 0, 130, 0.1), rgba(75, 0, 130, 0.05));
  border-color: rgba(75, 0, 130, 0.3);
}

/* Stats Cards */
.stats-card {
  transition: all 0.3s ease;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* Loading Animation */
.loading-champions {
  position: relative;
  overflow: hidden;
}

.loading-champions::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

/* Expand/Collapse Button Animations */
.expand-btn {
  position: relative;
  overflow: hidden;
}

.expand-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.expand-btn:hover::before {
  left: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .podium-container {
    flex-direction: column;
    align-items: center;
    space-y: 4;
  }
  
  .podium-position {
    transform: none !important;
    margin-bottom: 2rem;
    margin-right: 0px;
    margin-left: 0px;
  }
  
  .podium-position:nth-child(2) {
    order: -1;
    transform: scale(1.05) !important;
  }
  
  .podium-base {
    display: none;
  }
  
  .ranking-item {
    padding: 1rem;
  }
  
  .ranking-item .rank-number {
    font-size: 1.25rem;
  }
  
  .ranking-item .player-avatar {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .podium-player {
    border-width: 3px;
  }
  
  .ranking-item {
    border-width: 2px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .podium-position {
    animation: none;
  }
  
  .podium-crown {
    animation: none;
  }
  
  .champion-glow,
  .silver-glow,
  .bronze-glow {
    animation: none;
  }
}

/* Custom scrollbar for extended rankings */
#extended-rankings {
  max-height: 600px;
  overflow-y: auto;
}

::-webkit-scrollbar {
  display: none;
}