/* ================================
   랭킹 화면 스타일
   랭킹 카드, 랭크 배지, 트레이너 리스트
================================ */

.trainers-list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  grid-template-columns: none !important;
}

.ranking-card {
  background: white;
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
  width: 100%;
  position: relative;
  border: 1px solid #eee;
}

.ranking-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--pokemon-blue);
}

.rank-badge {
  min-width: 50px;
  text-align: center;
}

.rank-number {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  display: inline-block;
}

.rank-number.gold {
  font-size: 24px;
  color: var(--gold-primary);
}

.rank-number.silver {
  font-size: 22px;
  color: #c0c0c0;
}

.rank-number.bronze {
  font-size: 20px;
  color: #cd7f32;
}

.rank-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 250px;
}

.rank-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #eee;
  background: #f5f5f5;
  flex-shrink: 0;
}

.rank-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-nickname {
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

.rank-cp {
  font-size: 12px;
  color: #666;
  font-weight: 500;
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.rank-team {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: flex-start;
}

.rank-team-slot {
  width: 44px;
  height: 44px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #ddd;
  background: #333;
}

.rank-team-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-star {
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 9px;
  color: #FFD700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
  line-height: 1;
  z-index: 2;
}

.rank-team-slot.rarity-common {
  border-color: #bebebe;
}

.rank-team-slot.rarity-rare {
  border-color: #007bff;
}

.rank-team-slot.rarity-epic {
  border-color: #800080;
}

.rank-team-slot.rarity-legendary {
  border-color: #ffd700;
  box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.rank-team-slot.rarity-mythical {
  border-color: #ff00ff;
  box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
}

.enchanted-glow-red {
  position: relative !important;
  border-color: #ff0000 !important;
  box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5) !important;
  animation: redGlowPulse 1.5s infinite ease-in-out !important;
}

.enchanted-glow-red::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 6px;
  background: transparent;
  box-shadow: 0 0 15px #ff0000;
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

@keyframes redGlowPulse {
  0% {
    box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 20px #ff3333, inset 0 0 15px rgba(255, 50, 50, 0.7);
    filter: brightness(1.2);
  }
  100% {
    box-shadow: 0 0 8px #ff0000, inset 0 0 10px rgba(255, 0, 0, 0.5);
    filter: brightness(1);
  }
}

.rank-visit-btn {
  padding: 8px 16px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.rank-visit-btn:hover {
  background: var(--pokemon-blue);
  color: white;
  border-color: var(--pokemon-blue);
}

/* 미디어 쿼리 */
@media (max-width: 768px) {
  .trainers-list {
    gap: 10px !important;
    padding: 0 4px;
  }

  .ranking-card {
    flex-wrap: wrap;
    padding: 12px;
    gap: 10px;
  }

  .rank-badge {
    min-width: 36px;
  }

  .rank-number {
    font-size: 18px;
  }

  .rank-number.gold {
    font-size: 24px;
  }

  .rank-number.silver {
    font-size: 22px;
  }

  .rank-number.bronze {
    font-size: 20px;
  }

  .rank-profile {
    width: auto;
    flex: 1;
    gap: 10px;
    min-width: 0;
  }

  .rank-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .rank-info {
    min-width: 0;
    overflow: hidden;
  }

  .rank-nickname {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .rank-cp {
    font-size: 11px;
    padding: 2px 5px;
  }

  .rank-team {
    flex: 1 1 100%;
    order: 10;
    justify-content: center;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    margin-top: 4px;
  }

  .rank-team-slot {
    width: 36px;
    height: 36px;
  }

  .rank-star {
    font-size: 7px;
  }

  .rank-visit-btn {
    padding: 6px 10px;
    font-size: 11px;
    flex-shrink: 0;
  }
}

@media (max-width: 480px) {
  .ranking-card {
    padding: 10px;
    gap: 8px;
  }

  .rank-badge {
    min-width: 30px;
  }

  .rank-number {
    font-size: 16px;
  }

  .rank-number.gold {
    font-size: 20px;
  }

  .rank-number.silver {
    font-size: 18px;
  }

  .rank-number.bronze {
    font-size: 17px;
  }

  .rank-avatar {
    width: 36px;
    height: 36px;
  }

  .rank-nickname {
    font-size: 13px;
  }

  .rank-team-slot {
    width: 32px;
    height: 32px;
  }

  .rank-star {
    font-size: 6px;
  }

  .rank-visit-btn {
    padding: 5px 8px;
    font-size: 10px;
  }
}
