/* 사이드바 리더보드 애니메이션 CSS */

/* 기본 리스트 아이템 스타일 */
.list-items {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateZ(0); /* 하드웨어 가속 */
}

.list-item {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
    opacity: 1;
    animation: slideInUp 0.6s ease-out both;
}

/* 각 아이템에 순차적 딜레이 적용 */
.list-item:nth-child(1) { animation-delay: 0.1s; }
.list-item:nth-child(2) { animation-delay: 0.15s; }
.list-item:nth-child(3) { animation-delay: 0.2s; }
.list-item:nth-child(4) { animation-delay: 0.25s; }
.list-item:nth-child(5) { animation-delay: 0.3s; }

/* 페이지 전환 시 페이드 아웃 애니메이션 */
.list-items.fade-out {
    animation: fadeOut 0.15s ease-in-out forwards;
}

.list-items.fade-out .list-item {
    animation: slideOutDown 0.2s ease-in-out forwards;
}

/* 페이지 전환 시 페이드 인 애니메이션 */
.list-items.fade-in {
    animation: fadeIn 0.3s ease-in-out forwards;
}

/* 상위 3위 특별 효과 */
.list-item.top-rank {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-left: 3px solid transparent;
    border-image: linear-gradient(45deg, #FFD700, #FFA500) 1;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
}

.list-item.top-rank:nth-child(1) {
    border-image: linear-gradient(45deg, #FFD700, #FFE55C) 1;
    box-shadow: 0 2px 12px rgba(255, 215, 0, 0.3);
}

.list-item.top-rank:nth-child(2) {
    border-image: linear-gradient(45deg, #C0C0C0, #E5E5E5) 1;
    box-shadow: 0 2px 10px rgba(192, 192, 192, 0.25);
}

.list-item.top-rank:nth-child(3) {
    border-image: linear-gradient(45deg, #CD7F32, #DAA520) 1;
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.2);
}

/* 호버 효과 */
.list-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: rgba(39, 174, 96, 0.05);
    cursor: pointer;
}

.list-item.top-rank:hover {
    transform: translateY(-3px) scale(1.03);
}

/* 포인트 스타일 애니메이션 */
.list-item span:last-child {
    font-weight: 600;
    color: #27AE60;
    transition: all 0.3s ease;
}

.list-item:hover span:last-child {
    color: #229954;
    transform: scale(1.1);
}

/* 빈 슬롯 스타일 */
.list-item.empty-slot {
    opacity: 0.4;
    animation: none;
    transform: none;
}

.list-item.empty-slot:hover {
    transform: none;
    box-shadow: none;
    background: none;
    cursor: default;
}

/* 페이지 인디케이터 애니메이션 */
.page-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 0;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.page-dot.active {
    background: #27AE60;
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(39, 174, 96, 0.5);
}

.page-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

/* 키프레임 애니메이션 정의 */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(-15px);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 숫자 카운트업 애니메이션 */
@keyframes countUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 순위 변경 시 하이라이트 효과 */
.list-item.rank-changed {
    animation: rankHighlight 1s ease-in-out;
}

@keyframes rankHighlight {
    0%, 100% {
        background: transparent;
    }
    50% {
        background: rgba(39, 174, 96, 0.15);
        transform: scale(1.05);
    }
}

/* 새 진입자 특별 효과 */
.list-item.new-entry {
    animation: newEntryGlow 2s ease-in-out;
}

@keyframes newEntryGlow {
    0%, 100% {
        box-shadow: none;
    }
    50% {
        box-shadow: 0 0 15px rgba(39, 174, 96, 0.4);
        background: rgba(39, 174, 96, 0.1);
    }
}

/* 로딩 애니메이션 */
.list-item.loading {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.1) 25%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 반응형 애니메이션 조정 */
@media (max-width: 768px) {
    .list-item {
        animation-duration: 0.4s;
    }
    
    .list-item:hover {
        transform: translateY(-1px) scale(1.01);
    }
    
    .page-dot {
        width: 10px;
        height: 10px;
    }
}

/* 접근성을 위한 애니메이션 비활성화 */
@media (prefers-reduced-motion: reduce) {
    .list-items,
    .list-item,
    .page-dot {
        animation: none !important;
        transition: none !important;
    }
    
    .list-item:hover {
        transform: none !important;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .list-item.top-rank {
        background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 255, 255, 0.03) 100%);
    }
    
    .page-dot {
        background: rgba(255, 255, 255, 0.2);
    }
    
    .page-dot:hover:not(.active) {
        background: rgba(255, 255, 255, 0.4);
    }
}