/* ========================================
   Redesigned Analytics Dashboard Styles
   ======================================== */

/* Metrics Grid - Consolidated Model Health */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.metric-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.metric-card--primary {
    border-left: 3px solid var(--accent-cyan);
}

.metric-card__icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.metric-card__content {
    flex: 1;
}

.metric-card__label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.metric-card__trend {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.chart-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.chart-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.chart-card__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.chart-card__body {
    min-height: 250px;
    position: relative;
}

/* Feature Selection Styles */
.feature-categories {
    display: grid;
    gap: 20px;
    margin: 24px 0;
}

.feature-category {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.feature-category__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(148, 163, 184, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.feature-category__header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.feature-category__badge {
    background: var(--accent-cyan);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.feature-category__badge--new {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.feature-category__list {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(148, 163, 184, 0.03);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.feature-item:hover {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--accent-cyan);
}

.feature-item.collapsed {
    background: transparent;
    border: 1px dashed var(--border-color);
}

.feature-item__name {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.feature-item__importance {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.feature-item__importance:contains("High") {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

/* Default styling for importance */
.feature-item__importance {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.btn-expand {
    background: transparent;
    border: none;
    color: var(--accent-cyan);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-expand:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Performance Summary Cards */
.perf-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.perf-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}

.perf-card__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.perf-card__value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.perf-card__value--positive {
    color: var(--accent-green);
}

.perf-card__value--negative {
    color: var(--accent-red);
}

.perf-card__trend {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Monthly Heatmap */
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    padding: 20px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.heatmap-cell__month {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.heatmap-cell__value {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Color scale for heatmap */
.heatmap-cell--gain-high {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    border-color: #22c55e;
}

.heatmap-cell--gain-med {
    background: rgba(34, 197, 94, 0.5);
    color: white;
    border-color: #22c55e;
}

.heatmap-cell--gain-low {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.heatmap-cell--loss-low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.heatmap-cell--loss-med {
    background: rgba(239, 68, 68, 0.5);
    color: white;
    border-color: #ef4444;
}

.heatmap-cell--loss-high {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border-color: #ef4444;
}

.heatmap-cell--neutral {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

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

    .heatmap-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .feature-categories {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .perf-summary {
        grid-template-columns: 1fr;
    }

    .heatmap-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}