/**
 * at-amber Theme - Target Dashboard Specific Styles
 *
 * Custom styles for the Target Analytics Dashboard
 * Scoped with .target-dashboard prefix to avoid conflicts
 * Version: 1.8
 * Date: 2025-12-08
 * Changelog: Added page header metric styling for "days since last update"
 */

/* ===== PAGE HEADER METRIC ===== */
.page-header-metric {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 1rem;
	padding: 0.75rem 1.25rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.95rem;
	color: var(--text-secondary);
}

.page-header-metric i {
	font-size: 1.25rem;
	color: var(--accent);
}

.page-header-metric .metric-value {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--accent);
	margin: 0 0.25rem;
}

.page-header-metric .metric-label {
	color: var(--text-primary);
	font-weight: 400;
}

/* ===== LSP STATISTICS SECTION ===== */
.target-dashboard .lsp-card {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.5rem;
	position: relative;
	height: 460px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Flip trigger positioning - top right corner */
.target-dashboard .lsp-card .flip-trigger {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
}

/* Front fills the card */
.target-dashboard .lsp-card .flip-front {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

/* Back is hidden by default */
.target-dashboard .lsp-card .flip-back {
	display: none;
}

/* When flipped: hide front, show back with scroll */
.target-dashboard .lsp-card.flipped .flip-front {
	display: none;
}

.target-dashboard .lsp-card.flipped .flip-back {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.target-dashboard .lsp-header {
	margin-bottom: 1.5rem;
}

.target-dashboard .lsp-header h2 {
	color: var(--accent);
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.target-dashboard .lsp-header p {
	color: var(--text-secondary);
	margin-bottom: 1rem;
}

.target-dashboard .lsp-toggle-form {
	margin-top: 1rem;
}

.target-dashboard .anomaly-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
	color: var(--text-primary);
}

.target-dashboard .anomaly-toggle input[type="checkbox"] {
	cursor: pointer;
}

.target-dashboard .anomaly-toggle .bi-info-circle {
	color: var(--accent);
	cursor: help;
}

.target-dashboard .lsp-stats-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 1rem;
}

.target-dashboard .lsp-stat {
	background: var(--bg-tertiary);
	border: 1px solid var(--border-subtle);
	border-radius: 6px;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.target-dashboard .lsp-label {
	font-size: 0.9rem;
	color: var(--text-secondary);
	font-weight: 500;
}

.target-dashboard .lsp-value {
	font-size: 1.3rem;
	color: var(--accent);
	font-weight: 600;
	font-family: 'Orbitron', monospace;
	word-break: break-word;
	overflow-wrap: break-word;
}

.target-dashboard .lsp-note {
	margin-top: 1rem;
	color: var(--text-tertiary);
	font-style: italic;
}

/* Flip-back content styling */
.target-dashboard .flip-back h3 {
	color: var(--accent);
	font-size: 1.1rem;
	margin: 0 0 1rem 0;
	padding-right: 2rem;
}

.target-dashboard .flip-back p {
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.6;
	margin-bottom: 0.75rem;
}

.target-dashboard .flip-back ul {
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.6;
	margin: 0.5rem 0 1rem 1.25rem;
	padding: 0;
}

.target-dashboard .flip-back li {
	margin-bottom: 0.5rem;
}

.target-dashboard .flip-back strong {
	color: var(--text-primary);
	font-weight: 600;
}

/* Responsive: Stack on tablet and mobile */
@media (max-width: 1400px) {
	.target-dashboard .lsp-stats-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 1200px) {
	.target-dashboard .lsp-stats-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.target-dashboard .lsp-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.target-dashboard .lsp-stats-grid {
		grid-template-columns: 1fr;
	}

	.target-dashboard .lsp-card {
		height: 500px;
	}

	.target-dashboard .lsp-card .flip-front {
		overflow-y: auto;
	}

	.target-dashboard .lsp-stat {
		gap: 0.25rem;
		padding: 0.75rem;
		min-height: auto;
	}

	.target-dashboard .lsp-value {
		font-size: 1.1rem;
	}

	.target-dashboard .lsp-label {
		font-size: 0.85rem;
	}
}

/* ===== CHART SECTION ===== */
.target-dashboard .chart-card {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.5rem;
}

.target-dashboard .chart-header-container {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--border-subtle);
}

.target-dashboard .chart-header-title h2 {
	color: var(--accent);
	font-size: 1.5rem;
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.target-dashboard .chart-header-title .chart-subtitle {
	color: var(--text-secondary);
	margin: 0;
	font-size: 0.9rem;
}

.target-dashboard .chart-container {
	position: relative;
	height: 400px;
	width: 100%;
}

/* Responsive chart adjustments */
@media (max-width: 1024px) {
	.target-dashboard .chart-header-container {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}

	.target-dashboard .chart-header-title {
		padding-bottom: 0.5rem;
		border-bottom: 1px solid var(--border-subtle);
	}
}

@media (max-width: 768px) {
	.target-dashboard .chart-container {
		height: 300px;
	}
}

/* ===== MINI-CHARTS SECTION ===== */
.target-dashboard .mini-charts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}

.target-dashboard .mini-chart-card {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 1.5rem;
	position: relative;
	height: 380px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.target-dashboard .mini-chart-card .flip-trigger {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
}

.target-dashboard .mini-chart-card .flip-front {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.target-dashboard .mini-chart-card .flip-back {
	display: none;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.target-dashboard .mini-chart-card.flipped .flip-front {
	display: none;
}

.target-dashboard .mini-chart-card.flipped .flip-back {
	display: flex;
}

.target-dashboard .mini-chart-title {
	color: var(--accent);
	font-size: 1.1rem;
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.target-dashboard .mini-chart-wrapper {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
}

.target-dashboard .mini-chart-wrapper canvas {
	max-height: 250px;
}

/* Mini-chart flip-back styling */
.target-dashboard .mini-chart-card .flip-back h3 {
	color: var(--accent);
	font-size: 1.1rem;
	margin: 0 0 1rem 0;
	padding-right: 2rem;
}

.target-dashboard .mini-chart-card .flip-back p {
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.6;
	margin-bottom: 0.75rem;
}

.target-dashboard .mini-chart-card .flip-back ul {
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.6;
	margin: 0.5rem 0 1rem 1.25rem;
	padding: 0;
}

.target-dashboard .mini-chart-card .flip-back li {
	margin-bottom: 0.5rem;
}

.target-dashboard .mini-chart-card .flip-back strong {
	color: var(--text-primary);
	font-weight: 600;
}

/* Responsive mini-charts */
@media (max-width: 1024px) {
	.target-dashboard .mini-charts-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}
}

/* ===== TABLE SECTION - BEA REVISED STYLING ===== */
/* Subtle visual distinction for BEA revised data in table */
.target-revised,
.cpi-revised {
	font-style: italic;
	color: var(--text-secondary);
	opacity: 0.95;
}
