/* Statistics Page Styles */
.stats-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

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

.stat-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-color);
}

.stat-card.primary::before { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); }
.stat-card.secondary::before { background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%); }
.stat-card.success::before { background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); }
.stat-card.warning::before { background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%); }
.stat-card.info::before { background: linear-gradient(90deg, #fa709a 0%, #fee140 100%); }
.stat-card.danger::before { background: linear-gradient(90deg, #a8edea 0%, #fed6e3 100%); }

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--accent-color);
    flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }
.stat-card.secondary .stat-icon { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); color: white; }
.stat-card.success .stat-icon { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); color: white; }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); color: white; }
.stat-card.info .stat-icon { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); color: white; }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #333; }

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
}

.stat-change.positive {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.stat-change.negative {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.stat-change.neutral {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.chart-card h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.chart-container {
    position: relative;
    height: 200px;
}

/* Language Statistics */
.language-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.language-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.language-fill.javascript { background: #f7df1e; }
.language-fill.css { background: #1572b6; }
.language-fill.html { background: #e34f26; }

.language-name {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 80px;
}

.language-percent {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: right;
}

/* Contributors Section */
.contributors-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.contributors-section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.contributors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.contributor-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.contributor-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.contributor-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.contributor-avatar.placeholder {
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.contributor-info h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.contributor-info p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.contributor-stats {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-main {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .contributors-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 24px;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .chart-card {
    background: var(--bg-secondary);
}

[data-theme="dark"] .contributors-section {
    background: var(--bg-secondary);
}

[data-theme="dark"] .contributor-card {
    background: var(--bg-tertiary);
}

/* Animation for loading stats */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-number {
    animation: countUp 0.6s ease-out;
}

.stat-card:nth-child(1) .stat-number { animation-delay: 0.1s; }
.stat-card:nth-child(2) .stat-number { animation-delay: 0.2s; }
.stat-card:nth-child(3) .stat-number { animation-delay: 0.3s; }
.stat-card:nth-child(4) .stat-number { animation-delay: 0.4s; }
.stat-card:nth-child(5) .stat-number { animation-delay: 0.5s; }
.stat-card:nth-child(6) .stat-number { animation-delay: 0.6s; }