/* app/static/css/borrow_statistics.css */
/* 确保与 statistics.css 兼容的样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.stats-item {
    background-color: var(--secondary-color);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    position: relative;
    overflow: hidden;
}

.stats-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-color);
    background-color: white;
}

.stats-item::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: -15px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.1;
    transition: all 0.3s ease;
}

.stats-item:hover::after {
    transform: scale(1.2);
    opacity: 0.2;
}

.stats-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    position: relative;
}

.stats-value::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.stats-title {
    font-size: 14px;
    color: var(--light-text);
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--light-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader {
    border: 4px solid rgba(244, 188, 204, 0.3);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* 修复图表容器 */
.chart-container {
    margin-bottom: 30px;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.trend-chart .chart-wrapper {
    height: 330px;
}

/* 确保图表正确渲染 */
canvas {
    max-width: 100%;
    height: auto !important;
}

/* 添加一些女性化的装饰元素 */
.chart-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.4;
    z-index: 0;
}

.chart-container::after {
    content: '';
    position: absolute;
    bottom: -15px;
    right: -15px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    opacity: 0.4;
    z-index: 0;
}

/* 新增部分 */
.intro-text {
    text-align: center;
    margin-bottom: 25px;
    font-size: 16px;
    font-weight: 300;
    color: var(--light-text);
    font-style: italic;
}

.insights-container {
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 5px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.insights-container h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
    position: relative;
}

.insights-container h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color), var(--secondary-color));
    border-radius: 3px;
}

.insights-content {
    line-height: 1.6;
    color: var(--text-color);
    text-align: center;
    position: relative;
    z-index: 1;
}

.insights-container::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--primary-color);
    opacity: 0.1;
}

/* 优雅的动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.8s ease forwards;
}

/* 确保响应式布局 */
@media (max-width: 768px) {
    .chart-row {
        flex-direction: column;
    }

    .half {
        width: 100%;
        min-width: 0;
    }

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

    .chart-wrapper {
        height: 250px;
    }
}
