/**
 * ============================================================================
 * HytaBansWeb - Statistics Page
 * 数据可视化设计 (Data Visualization Design)
 * ============================================================================
 */

.stats-page {
    animation: fadeInUp 0.5s ease;
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px currentColor; }
    50% { box-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

@keyframes countUp {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================
   STATS HEADER
   ========================================== */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.stats-header-content {
    flex: 1;
    min-width: 200px;
}

.stats-title {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
    color: var(--text-primary);
}

.stats-title-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
    position: relative;
}

.stats-title-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary), #06b6d4);
    z-index: -1;
    opacity: 0.3;
    filter: blur(10px);
}

.stats-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
}

.btn-tech {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.1));
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--primary);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-tech:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

/* ==========================================
   STATS GRID - Data Visualization Cards
   ========================================== */
.stats-grid-tech {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-8);
}

@media (max-width: 1199px) {
    .stats-grid-tech { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .stats-grid-tech { grid-template-columns: 1fr; }
}

/* Stat Card - Cyber Style */
.stat-card-tech {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card-tech::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.stat-card-tech:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Color Variants */
.stat-bans::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-mutes::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-warnings::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-kicks::before { background: linear-gradient(90deg, #6b7280, #9ca3af); }

.stat-bans:hover { border-color: rgba(239, 68, 68, 0.5); box-shadow: 0 20px 40px rgba(239, 68, 68, 0.15); }
.stat-mutes:hover { border-color: rgba(245, 158, 11, 0.5); box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15); }
.stat-warnings:hover { border-color: rgba(59, 130, 246, 0.5); box-shadow: 0 20px 40px rgba(59, 130, 246, 0.15); }
.stat-kicks:hover { border-color: rgba(107, 114, 128, 0.5); box-shadow: 0 20px 40px rgba(107, 114, 128, 0.15); }

.stat-card-glow { display: none; }

.stat-card-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
}

.stat-icon-tech {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
}

.stat-bans .stat-icon-tech { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.stat-mutes .stat-icon-tech { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.stat-warnings .stat-icon-tech { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-kicks .stat-icon-tech { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.stat-data {
    flex: 1;
    min-width: 0;
}

.stat-number-tech {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-2);
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

.stat-label-tech {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-3);
}

.stat-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-bans .stat-bar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-mutes .stat-bar-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-warnings .stat-bar-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-kicks .stat-bar-fill { background: linear-gradient(90deg, #6b7280, #9ca3af); }

.stat-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.85rem;
}

.stat-total-label {
    color: var(--text-muted);
}

.stat-total-value {
    color: var(--text-primary);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ==========================================
   STATS SECTIONS
   ========================================== */
.stats-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.section-header-tech {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-color);
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.section-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.15));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.section-icon.text-danger { color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.section-icon.text-success { color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.section-icon.text-info { color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.section-icon.text-warning { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ==========================================
   ACTIVITY GRID - Timeline Cards
   ========================================== */
.activity-grid-tech {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

@media (max-width: 991px) {
    .activity-grid-tech { grid-template-columns: 1fr; }
}

.activity-card-tech {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.activity-card-tech:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.activity-card-header {
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.1), rgba(6, 182, 212, 0.1));
    border-bottom: 1px solid var(--border-color);
}

.activity-period-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.activity-card-body {
    padding: var(--space-4);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (max-width: 576px) {
    .activity-card-body {
        grid-template-columns: 1fr;
    }
}

.activity-item-tech {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.activity-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    position: relative;
}

.activity-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    opacity: 0.3;
}

.activity-dot.bans { background: #ef4444; }
.activity-dot.bans::after { background: #ef4444; }
.activity-dot.mutes { background: #f59e0b; }
.activity-dot.mutes::after { background: #f59e0b; }
.activity-dot.warnings { background: #3b82f6; }
.activity-dot.warnings::after { background: #3b82f6; }
.activity-dot.kicks { background: #6b7280; }
.activity-dot.kicks::after { background: #6b7280; }

.activity-count {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
    min-width: 40px;
}

.activity-type {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================
   TWO COLUMN LAYOUT
   ========================================== */
.stats-two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

@media (max-width: 991px) {
    .stats-two-column { grid-template-columns: 1fr; }
}

/* ==========================================
   LEADERBOARD
   ========================================== */
.leaderboard-tech {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: var(--hover-bg);
    border-color: var(--primary);
    transform: translateX(6px);
}

.leaderboard-rank {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.leaderboard-rank.rank-1 { 
    background: linear-gradient(135deg, #ffd700, #ffb800); 
    color: #000; 
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}
.leaderboard-rank.rank-2 { 
    background: linear-gradient(135deg, #e5e5e5, #b0b0b0); 
    color: #000; 
}
.leaderboard-rank.rank-3 { 
    background: linear-gradient(135deg, #cd7f32, #8b4513); 
    color: #fff; 
}
.leaderboard-rank:not(.rank-1):not(.rank-2):not(.rank-3) { 
    background: var(--bg-secondary); 
    color: var(--text-secondary); 
}

.leaderboard-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.leaderboard-avatar.staff {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.leaderboard-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.badge {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-primary { background: rgba(124, 58, 237, 0.15); color: var(--primary); }
.badge-success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

.mini-stats {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mini-stat {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}

.mini-stat.bans { color: #ef4444; }
.mini-stat.mutes { color: #f59e0b; }
.mini-stat.warnings { color: #3b82f6; }
.mini-stat.kicks { color: #6b7280; }

/* ==========================================
   REASONS GRID
   ========================================== */
.reasons-grid-tech {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-3);
}

.reason-card-tech {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}

.reason-card-tech:hover {
    background: var(--hover-bg);
    transform: translateX(6px);
    border-left-color: #06b6d4;
}

.reason-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.reason-count {
    flex-shrink: 0;
}

.count-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 36px;
    padding: 0 var(--space-3);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(6, 182, 212, 0.2));
    color: var(--primary);
    border-radius: var(--radius-md);
    font-weight: 800;
    font-family: var(--font-mono);
    font-size: 1rem;
}

/* ==========================================
   BAR CHART
   ========================================== */
.chart-container-tech {
    padding: var(--space-4) 0;
}

.bar-chart-tech {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 220px;
    gap: var(--space-4);
    padding: 0 var(--space-4);
}

.bar-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 100px;
    height: 100%;
}

.bar-wrapper {
    width: 100%;
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, var(--primary), #06b6d4);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    min-height: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: height 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.bar-value {
    position: absolute;
    top: 10px;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.bar-label {
    margin-top: var(--space-3);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================
   MODAL
   ========================================== */
.modal-tech {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
}

.modal-tech .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-5);
}

.modal-tech .modal-body {
    padding: var(--space-6);
    text-align: center;
}

.modal-icon-wrapper {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-4);
    background: rgba(245, 158, 11, 0.15);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #f59e0b;
}

.modal-text {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

.modal-tech .modal-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-5);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stats-title {
        font-size: 1.5rem;
    }
    
    .stats-title-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .stat-card-tech {
        padding: var(--space-5);
    }
    
    .stat-card-content {
        gap: var(--space-4);
    }
    
    .stat-icon-tech {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-number-tech {
        font-size: 2rem;
    }
    
    .stat-label-tech {
        font-size: 0.85rem;
    }
    
    .bar-chart-tech {
        height: 160px;
        gap: var(--space-2);
    }
    
    .bar-value {
        font-size: 0.7rem;
    }
    
    .bar-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .stats-section {
        padding: var(--space-4);
        border-radius: var(--radius-lg);
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .leaderboard-item {
        padding: var(--space-2) var(--space-3);
        gap: var(--space-3);
    }
    
    .leaderboard-rank {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .leaderboard-avatar {
        width: 36px;
        height: 36px;
    }
    
    .mini-stats {
        display: none;
    }
    
    .activity-card-body {
        padding: var(--space-3);
    }
    
    .activity-count {
        font-size: 1.25rem;
    }
}
