/**
 * Dashboard Charts
 *
 * Chart containers, section headers with toggles, and activity tables.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Components: Content Panels (Activity & Achievements)
   ========================================================================== */

.agenticwp-activity-section,
.agenticwp-achievements-section {
	background: var(--agenticwp-bg-white);
	border-radius: var(--agenticwp-radius-xl);
	border: 1px solid var(--agenticwp-border-light);
	box-shadow: var(--agenticwp-shadow-sm);
	height: 100%;
	overflow: hidden;
}

.agenticwp-activity-section {
	padding: 0; /* No padding for full-width table */
}

.agenticwp-achievements-section {
	padding: 24px;
}

/* Section Headers */
.agenticwp-activity-section h2,
.agenticwp-achievements-section h2 {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 24px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.agenticwp-activity-section h2 {
	padding-bottom: 24px;
	border-bottom: 1px solid var(--agenticwp-border-light);
	margin-bottom: 0;
}

/* ==========================================================================
   Component: Section Headers with Toggles
   ========================================================================== */

.agenticwp-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px;
	border-bottom: 1px solid var(--agenticwp-border-light);
}

.agenticwp-section-header h2 {
	padding: 0;
	margin: 0;
	border: none;
}

/* Chart Period Toggle */
.agenticwp-chart-toggle {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--agenticwp-bg-gray);
	border-radius: 8px;
}

.agenticwp-chart-toggle button {
	padding: 6px 14px;
	border: none;
	background: transparent;
	font-size: 12px;
	font-weight: 500;
	color: var(--agenticwp-text-secondary);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.agenticwp-chart-toggle button:hover {
	color: var(--agenticwp-text-primary);
}

.agenticwp-chart-toggle button.active {
	background: var(--agenticwp-bg-white);
	color: var(--agenticwp-text-primary);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Component: Chart Containers
   ========================================================================== */

.agenticwp-chart-container {
	padding: 24px;
	position: relative;
	height: 328px; /* Fixed height: 280px canvas + 48px padding */
	animation: chartFadeIn 0.4s ease-out both;
}

.agenticwp-chart-container:nth-of-type(2) {
	animation-delay: 0.1s;
}

/* Chart.js manages canvas sizing internally - don't override */

@keyframes chartFadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.agenticwp-distribution-container {
	border-top: 1px solid var(--agenticwp-border-light);
	margin-top: 8px;
	height: 284px;
}

.agenticwp-distribution-container h3 {
	font-size: 14px;
	font-weight: 600;
	color: var(--agenticwp-text-primary);
	margin: 0 0 16px 0;
}

.agenticwp-chart-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	color: var(--agenticwp-text-muted);
}

.agenticwp-chart-empty::before {
	content: 'No data yet';
}

.agenticwp-chart-empty canvas {
	display: none;
}

/* ==========================================================================
   Component: Activity Table (Legacy - Hidden with Charts)
   ========================================================================== */

.agenticwp-activity-chart-placeholder {
	display: none; /* Hidden - replaced by charts */
}

.agenticwp-activity-table {
	display: none; /* Hidden - replaced by charts */
}

.agenticwp-stats-table {
	width: 100%;
	border-spacing: 0;
}

.agenticwp-stats-table th {
	background: var(--agenticwp-bg-gray);
	font-size: 11px;
	text-transform: uppercase;
	color: var(--agenticwp-text-secondary);
	font-weight: 600;
	padding: 12px 24px;
	text-align: left;
	border-bottom: 1px solid var(--agenticwp-border-light);
}

.agenticwp-stats-table td {
	padding: 16px 24px;
	font-size: 14px;
	color: var(--agenticwp-text-primary);
	border-bottom: 1px solid var(--agenticwp-border-light);
	transition: background 0.1s;
}

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

.agenticwp-stats-table tr:hover td {
	background: var(--agenticwp-bg-gray);
}
