/**
 * 增强版筛选和统计系统 - CSS样式
 * 用于美化筛选面板、统计卡片等UI组件
 */

/* ========== 增强版筛选面板样式 ========== */
.enhanced-filter-panel {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: visible;
}

/* 确保下拉菜单正确显示 */
.enhanced-filter-panel .el-select-dropdown {
    z-index: 9999 !important;
}

.enhanced-filter-panel .el-popper {
    z-index: 9999 !important;
}

/* 出库类型下拉菜单样式 */
.outbound-type-select-dropdown {
    z-index: 9999 !important;
    max-height: 300px !important;
}

.outbound-type-select-dropdown .el-select-dropdown__item {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.outbound-type-select-dropdown .el-select-dropdown__item:hover {
    background-color: #f5f7fa;
}

.outbound-type-select-dropdown .el-select-dropdown__item.selected {
    color: #409eff;
    font-weight: 600;
}

.filter-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.filter-title {
    font-size: 15px;
    font-weight: 600;
    color: #303133;
}

.filter-count-badge {
    font-weight: 500;
}

.filter-content {
    padding: 20px;
    background: #fafbfc;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #606266;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 时间筛选按钮组 */
.time-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.time-filter-btn {
    padding: 6px 14px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    transition: all 0.3s ease !important;
    background: #fff !important;
    border: 1px solid #dcdfe6 !important;
    color: #606266 !important;
}

.time-filter-btn:hover {
    border-color: #409eff !important;
    color: #409eff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
}

.time-filter-btn.active {
    background: #409eff !important;
    border-color: #409eff !important;
    color: #fff !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
}

/* 自定义日期范围 */
.custom-date-range {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e4e7ed;
}

/* 范围输入框 */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.range-inputs .el-input-number {
    flex: 1;
}

.range-separator {
    color: #909399;
    font-weight: 600;
    font-size: 14px;
}

/* 筛选操作按钮 */
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e4e7ed;
}

/* ========== 增强版统计卡片样式 ========== */
.enhanced-stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

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

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

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.stat-card-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card-unit {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.85;
    margin-left: 4px;
}

/* 不同颜色的统计卡片 */
.stat-card.primary {
    background: linear-gradient(135deg, #409eff 0%, #337ecc 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #67c23a 0%, #529b2e 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #e6a23c 0%, #b88230 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #f56c6c 0%, #c45656 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #909399 0%, #73757a 100%);
}

/* ========== 分组统计表格样式 ========== */
.grouped-stats-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.grouped-stats-table thead {
    background: #f5f7fa;
}

.grouped-stats-table th,
.grouped-stats-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #ebeef5;
    font-size: 14px;
}

.grouped-stats-table th {
    font-weight: 600;
    color: #303133;
    background: #fafbfc;
}

.grouped-stats-table tbody tr:hover {
    background: #f5f7fa;
}

.grouped-stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== 趋势图表容器 ========== */
.trend-chart-container {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.trend-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }

    .enhanced-stats-container {
        grid-template-columns: 1fr;
    }

    .time-filter-buttons {
        justify-content: center;
    }

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

@media (max-width: 480px) {
    .filter-content {
        padding: 16px;
    }

    .range-inputs {
        flex-direction: column;
    }

    .range-separator {
        transform: rotate(90deg);
    }
}

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

.stat-card {
    animation: fadeInUp 0.5s ease-out forwards;
}

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

/* 加载状态 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
