/* Lesson Analytics Dashboard */
.pcs-analytics-dashboard {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 0.5rem;
	padding: 1.5rem;
	margin-top: 2rem;
}

.pcs-analytics-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #e5e7eb;
}

.pcs-analytics-header h2 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: #1f2937;
}

.pcs-analytics-export-btn {
	padding: 0.5rem 1rem;
	background: var(--pco-primary-color, #7A3FF2);
	color: #fff;
	border: none;
	border-radius: 0.375rem;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.pcs-analytics-export-btn:hover {
	background: #5B1ED9;
}

/* Metrics Grid */
.pcs-analytics-metrics {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin-bottom: 2rem;
}

.pcs-metric-card {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 0.375rem;
	padding: 1rem;
}

.pcs-metric-label {
	font-size: 0.875rem;
	color: #6b7280;
	margin-bottom: 0.5rem;
	font-weight: 500;
}

.pcs-metric-value {
	font-size: 1.75rem;
	font-weight: 700;
	color: #1f2937;
}

.pcs-metric-unit {
	font-size: 0.75rem;
	color: #9ca3af;
	margin-left: 0.25rem;
	font-weight: 400;
}

/* Engagement Score */
.pcs-engagement-card {
	grid-column: 1 / -1;
	background: linear-gradient(135deg, var(--pco-primary-color, #7A3FF2) 0%, color-mix(in srgb, var(--pco-primary-color, #7A3FF2) 55%, #6d28d9) 100%);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.5rem;
	border: none;
	border-radius: 0.375rem;
}

.pcs-engagement-info h3 {
	margin: 0 0 0.5rem 0;
	font-size: 1rem;
	font-weight: 600;
	opacity: 0.9;
}

.pcs-engagement-score {
	font-size: 2.5rem;
	font-weight: 700;
}

.pcs-engagement-bar {
	flex: 1;
	margin-left: 2rem;
	max-width: 300px;
}

.pcs-progress-ring {
	width: 120px;
	height: 120px;
}

.pcs-progress-ring-circle {
	transition: stroke-dashoffset 0.35s;
	transform: rotate(-90deg);
	transform-origin: 50% 50%;
	stroke: rgba(255, 255, 255, 0.3);
	fill: transparent;
	stroke-width: 8;
}

.pcs-progress-ring-circle-fill {
	stroke: #fff;
	stroke-dasharray: 377;
	stroke-dashoffset: 0;
	stroke-linecap: round;
}

/* Heatmap */
.pcs-analytics-heatmap {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
}

.pcs-heatmap-title {
	font-size: 1rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 1rem;
}

.pcs-heatmap-container {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 200px;
	padding: 1rem;
	background: #f9fafb;
	border-radius: 0.375rem;
	border: 1px solid #e5e7eb;
	overflow-x: auto;
}

.pcs-heatmap-bar {
	flex: 1;
	min-width: 8px;
	background: #d1d5db;
	border-radius: 2px 2px 0 0;
	transition: background 0.2s ease;
	position: relative;
}

.pcs-heatmap-bar.hot {
	background: #ef4444;
}

.pcs-heatmap-bar.warm {
	background: #f59e0b;
}

.pcs-heatmap-bar.cool {
	background: #3b82f6;
}

.pcs-heatmap-bar:hover::after {
	content: attr(data-time);
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	white-space: nowrap;
	margin-bottom: 0.5rem;
}

/* Events List */
.pcs-analytics-events {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
}

.pcs-events-title {
	font-size: 1rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 1rem;
}

.pcs-events-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 400px;
	overflow-y: auto;
}

.pcs-event-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem;
	background: #f9fafb;
	border-left: 3px solid var(--pco-primary-color, #7A3FF2);
	border-radius: 0.25rem;
	font-size: 0.875rem;
}

.pcs-event-icon {
	font-size: 1.25rem;
	width: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.pcs-event-details {
	flex: 1;
}

.pcs-event-type {
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 0.25rem;
}

.pcs-event-time {
	font-size: 0.75rem;
	color: #9ca3af;
}

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

	.pcs-engagement-card {
		flex-direction: column;
		text-align: center;
	}

	.pcs-engagement-bar {
		margin-left: 0;
		margin-top: 1rem;
		max-width: 100%;
	}

	.pcs-heatmap-container {
		height: 150px;
	}
}
