/* Statistical Incentives Frontend Styles */

.stat-incentives-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.stat-incentives-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Statistics Overview */
.stats-overview {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}

.stat-card:nth-child(even) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3n) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    display: block;
}

.stat-number {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stat-label {
    font-size: 0.95em;
    opacity: 0.9;
    font-weight: 500;
}

/* Detailed Statistics */
.detailed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.stats-section {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.stats-section:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.stats-section h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* Upload Statistics */
.upload-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.upload-item:hover {
    background: linear-gradient(90deg, #e9ecef 0%, #dee2e6 100%);
    transform: translateX(4px);
}

.upload-icon {
    font-size: 1.5em;
    margin-right: 12px;
}

.upload-label {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.upload-count {
    font-weight: 700;
    color: #2c3e50;
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 40px;
    text-align: center;
}

/* Activity Metrics */
.activity-metrics, .ranking-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-item, .rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.metric-item:hover, .rank-item:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #3498db;
}

.metric-label, .rank-label {
    font-weight: 500;
    color: #495057;
}

.metric-value, .rank-value {
    font-weight: 700;
    color: #2c3e50;
    background: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    min-width: 60px;
    text-align: center;
}

/* Tables */
.earnings-table, .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.earnings-table th, .earnings-table td,
.leaderboard-table th, .leaderboard-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.earnings-table th, .leaderboard-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.earnings-table tbody tr:hover,
.leaderboard-table tbody tr:hover {
    background: #f8f9fa;
}

/* Leaderboard */
.leaderboard-nav {
    margin-bottom: 30px;
    border-bottom: 2px solid #e9ecef;
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 0 20px;
}

.nav-tab {
    display: inline-block;
    padding: 16px 24px;
    margin-right: 8px;
    text-decoration: none;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tab:hover {
    color: #495057;
    background: rgba(52, 152, 219, 0.1);
}

.nav-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.rank-number {
    font-weight: 700;
    font-size: 1.1em;
}

.medal {
    font-size: 1.4em;
    margin-right: 8px;
    display: inline-block;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.user-info strong {
    color: #2c3e50;
    font-size: 1.1em;
}

.user-info small {
    color: #6c757d;
    font-weight: 400;
}

.stat-value {
    font-weight: 700;
    font-size: 1.2em;
    color: #27ae60;
}

.details {
    color: #6c757d;
    font-size: 0.9em;
}

/* Shortcodes */
.user-stats-shortcode {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .label {
    font-weight: 600;
    color: #495057;
}

.stat-item .value {
    font-weight: 700;
    color: #2c3e50;
}

.leaderboard-shortcode {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.leaderboard-shortcode h4 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-weight: 600;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.leaderboard-list li:hover {
    background: #f8f9fa;
}

.leaderboard-list li:last-child {
    border-bottom: none;
}

.user-name {
    font-weight: 500;
    color: #2c3e50;
}

.user-value {
    font-weight: 700;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 4px 12px;
    border-radius: 16px;
}

.current-user-rank {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .detailed-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .upload-item, .metric-item, .rank-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .upload-count, .metric-value, .rank-value {
        margin-top: 8px;
    }
    
    .earnings-table, .leaderboard-table {
        font-size: 0.9em;
    }
    
    .earnings-table th, .earnings-table td,
    .leaderboard-table th, .leaderboard-table td {
        padding: 8px 12px;
    }
    
    .nav-tab {
        padding: 12px 16px;
        font-size: 0.9em;
    }
    
    .stat-item {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .stat-incentives-page .container {
        padding: 0 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 1.8em;
    }
    
    .stat-icon {
        font-size: 2em;
    }
    
    .stats-section {
        padding: 16px;
    }
    
    .leaderboard-nav {
        padding: 0 16px;
    }
    
    .nav-tab {
        padding: 10px 12px;
        font-size: 0.85em;
    }
}

/* Loading and Animation */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .stat-incentives-page {
        color: #e9ecef;
    }
    
    .stats-section {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .stats-section h3 {
        color: #ecf0f1;
    }
    
    .upload-item, .metric-item, .rank-item {
        background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
        color: #e9ecef;
    }
    
    .earnings-table, .leaderboard-table {
        background: #2c3e50;
    }
    
    .earnings-table tbody tr:hover,
    .leaderboard-table tbody tr:hover {
        background: #34495e;
    }
    
    .user-stats-shortcode, .leaderboard-shortcode {
        background: #2c3e50;
        border-color: #34495e;
        color: #e9ecef;
    }
}