/**
 * 市场宽度分析页面样式
 */

/* 筛选器卡片 */
.filters-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filters-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
}

.filters-card .card-header h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.filters-card .card-body {
    padding: 1.5rem;
}

.filters-card .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.filters-card .form-control,
.filters-card .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filters-card .form-control:focus,
.filters-card .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
    outline: none;
}

/* 统计卡片 */
.stat-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-card .card-rank {
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stat-card .rank-icon {
    font-size: 1.25rem;
}

.stat-card .card-content {
    padding: 1.5rem 1rem;
}

.stat-card .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-card .card-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* 热力图卡片 */
.chart-card {
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-card .card-header h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card .card-body {
    padding: 1.5rem;
}

#heatmapChart {
    width: 100%;
    height: 600px;
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3);
}

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* 错误提示 */
.error-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error-bg);
    color: var(--error-text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.error-toast i {
    font-size: 1.25rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filters-card .card-body {
        padding: 1rem;
    }

    .stat-card .card-title {
        font-size: 1.25rem;
    }

    #heatmapChart {
        height: 400px;
    }

    .chart-card .card-body {
        padding: 1rem;
    }

    .error-toast {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}

@media (max-width: 576px) {
    #heatmapChart {
        height: 300px;
    }

    .filters-card .row > div {
        margin-bottom: 1rem;
    }

    .stat-card .card-rank {
        font-size: 0.75rem;
    }

    .stat-card .card-title {
        font-size: 1.125rem;
    }
}

/* 四列卡片布局 */
.cards-container.four-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

@media (min-width: 1200px) {
    .cards-container.four-column {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .cards-container.four-column {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 多选框样式 */
select[multiple] {
    min-height: 120px;
}

select[multiple] option:checked {
    background: var(--primary-color) linear-gradient(0deg, var(--primary-color) 0%, var(--primary-color) 100%);
    color: white;
}
