/* Incident Trends — ServiceAlert.ai */

.trends-hero { text-align: center; padding: 40px 0 32px; }
.trends-hero h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.trends-hero p { color: var(--text-secondary); font-size: 1.1rem; }

/* Summary Cards */
.trends-summary-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 32px; }
.trends-card { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; text-align: center; }
.trends-card-value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.trends-card-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.trends-card-value.accent { color: var(--accent); }
.trends-card-value.major { color: var(--status-major); }
.trends-card-sub { display: flex; justify-content: center; gap: 8px; margin-top: 8px; font-size: 0.75rem; }
.trends-card-sub span { padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.trends-card-sub .critical { background: rgba(239,68,68,0.15); color: #EF4444; }
.trends-card-sub .major { background: rgba(249,115,22,0.15); color: #F97316; }
.trends-card-sub .minor { background: rgba(234,179,8,0.15); color: #EAB308; }
.trends-card-sub .none { background: rgba(107,114,128,0.15); color: #6B7280; }

/* Service link in card */
.trends-card a { color: var(--accent); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.trends-card a:hover { text-decoration: underline; }

/* Sections */
.trends-section { margin-bottom: 40px; }
.trends-section h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 16px; }

/* Chart Controls */
.trends-controls { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.trends-toggle { padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.8rem; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.trends-toggle:hover, .trends-toggle.active { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.trends-controls-group { display: flex; gap: 6px; }
.trends-controls-spacer { flex: 1; }

/* Chart Container */
.trends-chart-container { background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 12px; padding: 24px; margin-bottom: 16px; }
.trends-chart-container canvas { max-height: 350px; }

/* Charts Row (frequency + donut side by side) */
.trends-charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 32px; }

/* Table Controls */
.trends-table-controls { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.trends-search { flex: 1; max-width: 300px; }
.trends-search input { width: 100%; padding: 10px 16px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.95rem; background: var(--bg-primary); color: var(--text-primary); }
.trends-show-all { padding: 6px 14px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.8rem; background: transparent; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; font-family: inherit; }
.trends-show-all:hover { border-color: var(--accent); color: var(--accent); }

/* Table */
.trends-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.trends-table th, .trends-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-color); font-size: 0.9rem; }
.trends-table th { background: var(--bg-secondary); font-weight: 600; font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; user-select: none; }
.trends-table th:hover { color: var(--accent); }
.trends-table tr:last-child td { border-bottom: none; }
.trends-table tr.hidden { display: none; }
.trends-service-link { display: flex; align-items: center; gap: 8px; color: var(--text-primary); text-decoration: none; }
.trends-service-link:hover { color: var(--accent); }
.trends-service-link img { width: 20px; height: 20px; border-radius: 4px; }

/* Severity Badges */
.severity-badge { display: inline-block; padding: 2px 10px; border-radius: 100px; font-size: 0.75rem; font-weight: 600; }
.severity-badge.critical { background: rgba(239,68,68,0.15); color: #EF4444; }
.severity-badge.major { background: rgba(249,115,22,0.15); color: #F97316; }
.severity-badge.minor { background: rgba(234,179,8,0.15); color: #EAB308; }
.severity-badge.none { background: rgba(107,114,128,0.15); color: #6B7280; }

/* Heatmap */
.trends-heatmap-wrapper { overflow-x: auto; }
.trends-heatmap { display: grid; grid-template-columns: 50px repeat(24, 1fr); gap: 2px; font-size: 0.7rem; }
.trends-heatmap-label { display: flex; align-items: center; color: var(--text-secondary); font-weight: 500; padding: 0 4px; }
.trends-heatmap-header { text-align: center; color: var(--text-tertiary); font-size: 0.65rem; padding: 4px 0; }
.trends-heatmap-cell { aspect-ratio: 1; border-radius: 3px; min-width: 20px; min-height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; color: transparent; transition: all 0.15s; }
.trends-heatmap-cell:hover { color: var(--text-primary); transform: scale(1.2); z-index: 1; }
.trends-heatmap-cell.intensity-0 { background: var(--bg-tertiary); }
.trends-heatmap-cell.intensity-1 { background: rgba(59,130,246,0.2); }
.trends-heatmap-cell.intensity-2 { background: rgba(59,130,246,0.4); }
.trends-heatmap-cell.intensity-3 { background: rgba(59,130,246,0.6); }
.trends-heatmap-cell.intensity-4 { background: rgba(59,130,246,0.8); }
.trends-heatmap-cell.intensity-5 { background: rgba(59,130,246,1); color: #fff; }
.trends-heatmap-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; font-size: 0.7rem; color: var(--text-tertiary); }
.trends-heatmap-legend-cell { width: 14px; height: 14px; border-radius: 2px; }

/* CTA */
.trends-cta { background: var(--accent-subtle); border: 1px solid rgba(99,102,241,0.2); border-radius: 10px; padding: 24px; text-align: center; margin-bottom: 48px; }
.trends-cta p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 12px; }
.trends-cta a { display: inline-block; padding: 10px 24px; background: var(--accent); color: #fff; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 0.9rem; }
.trends-cta a:hover { background: var(--accent-hover); }

/* SEO Content */
.trends-seo { max-width: 700px; margin: 0 auto; padding-top: 40px; border-top: 1px solid var(--border-color); }
.trends-seo h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; }
.trends-seo p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; margin-bottom: 16px; }
.trends-seo a { color: var(--accent); text-decoration: none; }
.trends-seo a:hover { text-decoration: underline; }

/* Empty State */
.trends-empty { text-align: center; padding: 60px 0; color: var(--text-secondary); }
.trends-empty h3 { margin-top: 16px; }

/* Responsive */
@media (max-width: 1024px) {
    .trends-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .trends-hero h1 { font-size: 1.5rem; }
    .trends-summary-cards { grid-template-columns: repeat(2, 1fr); }
    .trends-table-controls { flex-direction: column; }
    .trends-search { max-width: 100%; }
    .col-resolution, .col-last { display: none; }
    .trends-heatmap { min-width: 600px; }
}

@media (max-width: 480px) {
    .trends-summary-cards { grid-template-columns: 1fr 1fr; }
    .trends-card-value { font-size: 1.4rem; }
}
