/* =====================================================
   LEADERBOARD STYLES
   排行榜统一样式文件
   
   供所有页面使用，避免样式重复
   ===================================================== */

/* Modal enter animation */
.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Leaderboard item slide-in animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced tab transitions */
.leaderboard-tab {
    transition: all 0.2s ease-out;
    transform: translateY(0);
}

.leaderboard-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.15);
}

.leaderboard-tab.active {
    transform: translateY(0);
    transition: all 0.2s ease-out;
}

/* Haptic feedback cursor effect */
.leaderboard-tab:active {
    transform: scale(0.98);
    transition: transform 0.1s ease-out;
}

/* Loading spinner enhancement */
.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced leaderboard items */
.leaderboard-item {
    transition: all 0.2s ease-out;
    border-radius: 12px;
}

.leaderboard-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
    background: rgba(44, 90, 160, 0.02);
}

/* Pet leaderboard specific styles */
.pet-leaderboard-item {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border: 1px solid rgba(255, 154, 158, 0.3);
}

.pet-leaderboard-item:hover {
    background: linear-gradient(135deg, #ff8a8e 0%, #febfbf 100%);
    transform: translateX(6px) scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 154, 158, 0.2);
}

.pet-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.pet-emoji {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.pet-name {
    font-weight: 600;
    color: #d63384;
    font-size: 14px;
}

.pet-level {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    margin-left: 4px;
}

.pet-stats {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.stat {
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #495057;
    border: 1px solid rgba(0,0,0,0.1);
}

/* Update notification animation */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.leaderboard-update-notification {
    pointer-events: none;
    user-select: none;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .modal-enter,
    .leaderboard-item,
    .leaderboard-tab,
    .loading-spinner {
        animation: none;
        transition: none;
        transform: none;
    }
    
    .leaderboard-item:hover {
        transform: none;
    }
}

/* Mobile-optimized touch targets */
@media (max-width: 480px) {
    .leaderboard-tab {
        min-height: 54px;
        /* Ensure 44px minimum touch target */
    }
    
    .leaderboard-item {
        padding: 12px 8px;
        /* Extra padding for easier touch */
    }
}

/* =====================================================
   STANDALONE LEADERBOARD PAGE STYLES
   独立排行榜页面专用样式
   ===================================================== */

/* Base Styles for Standalone Page */
.main-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Styles */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.back-btn, .refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #4a5568;
}

.back-btn:hover, .refresh-btn:hover {
    background: rgba(103, 126, 234, 0.1);
    transform: translateY(-1px);
}

.back-icon, .refresh-icon {
    font-size: 1.2rem;
}

.refresh-btn.spinning .refresh-icon {
    animation: spin 1s linear infinite;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.trophy-icon {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Tab Navigation for Standalone Page */
.leaderboard-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    margin: 1rem;
    border-radius: 16px;
    padding: 0.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #718096;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.tab-icon {
    font-size: 1.5rem;
}

/* Main Content */
.leaderboard-content {
    padding: 0 1rem 2rem;
    max-width: 100%;
    margin: 0 auto;
}

/* Introduction Section */
.leaderboard-intro {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.intro-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 0.75rem 0;
}

.title-icon {
    font-size: 1.5rem;
}

.intro-desc {
    color: #718096;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* User Stats Card */
.user-stats-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    color: white;
}

.stats-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.avatar-placeholder {
    filter: brightness(0) invert(1);
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.user-rank {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.user-score {
    text-align: right;
}

.score-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

/* Leaderboard List Section */
.leaderboard-list-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.list-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.last-update {
    font-size: 0.8rem;
    color: #a0aec0;
}

/* Enhanced Leaderboard Items for Standalone Page */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
}

.leaderboard-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.leaderboard-item:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.rank-medal {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.rank-count {
    font-size: 0.85rem;
    color: #718096;
}

.current-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Load More Button */
.load-more-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #4a5568;
    margin: 0 0 0.5rem 0;
}

.empty-desc {
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
.page-footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin-top: 2rem;
    padding: 1.5rem 1rem;
}

.footer-content {
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
}

.footer-info p {
    color: #718096;
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive Design for Standalone Page */
@media (max-width: 640px) {
    .header-content {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .trophy-icon {
        font-size: 1.3rem;
    }
    
    .leaderboard-tabs {
        margin: 0.75rem;
        padding: 0.2rem;
    }
    
    .tab-btn {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .tab-icon {
        font-size: 1.3rem;
    }
    
    .leaderboard-content {
        padding: 0 0.75rem 1.5rem;
    }
    
    .leaderboard-intro,
    .user-stats-card,
    .leaderboard-list-section {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .intro-title {
        font-size: 1.1rem;
    }
    
    .stats-header {
        gap: 0.75rem;
    }
    
    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .rank-medal {
        font-size: 1.3rem;
        min-width: 35px;
    }
    
    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0.5rem;
    }
    
    .back-btn, .refresh-btn {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .page-title {
        font-size: 1rem;
    }
    
    .trophy-icon {
        font-size: 1.2rem;
    }
    
    .leaderboard-tabs {
        margin: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .tab-icon {
        font-size: 1.2rem;
    }
    
    .leaderboard-content {
        padding: 0 0.5rem 1rem;
    }
    
    .leaderboard-intro,
    .user-stats-card,
    .leaderboard-list-section {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .intro-title {
        font-size: 1rem;
    }
    
    .user-avatar {
        width: 45px;
        height: 45px;
    }
    
    .rank-medal {
        font-size: 1.2rem;
        min-width: 30px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
}
