/**
 * Stats Dashboard Styles
 * 统计仪表板样式
 */

.stats-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stats-modal.active {
    opacity: 1;
}

.stats-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 212, 255, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-header h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.stats-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.stats-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.stats-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.stats-body::-webkit-scrollbar {
    width: 8px;
}

.stats-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.stats-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

/* 概览卡片 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* 统计部分 */
.stats-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.stats-section h3 {
    margin: 0 0 20px 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
}

.stats-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 40px;
}

/* 柱状图 */
.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-bar-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
    align-items: center;
}

.chart-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    text-align: right;
}

.chart-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    height: 40px;
    position: relative;
    overflow: hidden;
}

.chart-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: width 0.5s ease;
    min-width: 60px;
}

.chart-value {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

/* 时间图表 */
.time-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 200px;
    padding: 20px 0;
    gap: 10px;
}

.time-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.time-bar-fill {
    width: 100%;
    max-width: 60px;
    background: linear-gradient(180deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px 8px 0 0;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10px;
    transition: height 0.5s ease;
    min-height: 30px;
}

.time-bar-value {
    color: #fff;
    font-size: 12px;
    font-weight: bold;
}

.time-bar-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 成就系统 */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.achievement.unlocked {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.1), rgba(0, 184, 148, 0.1));
    border-color: rgba(46, 213, 115, 0.5);
}

.achievement.locked {
    opacity: 0.5;
    filter: grayscale(100%);
}

.achievement:hover {
    transform: translateX(5px);
}

.achievement-icon {
    font-size: 36px;
    flex-shrink: 0;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.achievement-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #46d76f 0%, #00b894 100%);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(46, 213, 115, 0.4);
}

/* 响应式 */
@media (max-width: 768px) {
    .stats-content {
        width: 95%;
        max-height: 95vh;
    }

    .stats-header {
        padding: 20px;
    }

    .stats-header h2 {
        font-size: 20px;
    }

    .stats-body {
        padding: 20px;
    }

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 28px;
    }

    .stat-value {
        font-size: 24px;
    }

    .chart-bar-item {
        grid-template-columns: 100px 1fr;
        gap: 10px;
    }

    .chart-label {
        font-size: 12px;
    }

    .chart-bar {
        min-width: 50px;
    }

    .time-chart {
        height: 150px;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievement {
        padding: 12px;
    }

    .achievement-icon {
        font-size: 28px;
    }
}

/* Canvas可视化图表 */
.visual-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.chart-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.chart-container h4 {
    margin: 0 0 15px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 500;
}

.chart-container canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 8px;
}

/* 暗色/亮色主题支持 */
[data-theme="light"] .stats-content {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

[data-theme="light"] .stats-section {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .stat-card {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .stat-value,
[data-theme="light"] .stats-section h3,
[data-theme="light"] .achievement-name {
    color: #2d3436;
}

[data-theme="light"] .stat-label,
[data-theme="light"] .chart-label,
[data-theme="light"] .achievement-desc {
    color: #636e72;
}

[data-theme="light"] .chart-container {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .chart-container h4 {
    color: #2d3436;
}
