/**
 * Insights Tab + Dashboard Widgets CSS
 *
 * Covers: .ldd-insights, .ldd-quick-actions, .ldd-action-items,
 *         .ldd-continue-learning, .ldd-group-overview
 *
 * @since 8.0.0
 */

/* ============================================================
   Quick Actions Bar (dashboard home)
   ============================================================ */

.ldd-quick-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.ldd-quick-actions__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	color: #334155;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.ldd-quick-actions__btn:hover {
	background: #f1f5f9;
	border-color: #3b82f6;
	color: #3b82f6;
	text-decoration: none;
}

.ldd-quick-actions__btn .ldd-icons {
	font-size: 16px;
}

/* ============================================================
   Action Items Widget (dashboard home)
   ============================================================ */

.ldd-action-items {
	margin: 20px 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
}

.ldd-action-items__title {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 12px;
}

.ldd-action-items__list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.ldd-action-items__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	text-decoration: none;
	color: #334155;
	flex: 1 1 calc(50% - 6px);
	min-width: 200px;
	transition: all 0.2s ease;
}

.ldd-action-items__item:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	text-decoration: none;
	color: #1e293b;
}

.ldd-action-items__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #fff;
	flex-shrink: 0;
}

.ldd-action-items__icon .ldd-icons {
	font-size: 18px;
}

.ldd-action-items__label {
	flex: 1;
	font-size: 14px;
	font-weight: 500;
}

.ldd-action-items__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 28px;
	padding: 0 8px;
	background: #ef4444;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	border-radius: 14px;
	flex-shrink: 0;
}

/* ============================================================
   Continue Learning Widget (student dashboard)
   ============================================================ */

.ldd-continue-learning {
	margin: 20px 0;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
}

.ldd-continue-learning__title {
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 12px;
}

.ldd-continue-learning__card {
	display: flex;
	gap: 16px;
	align-items: center;
}

.ldd-continue-learning__thumbnail {
	flex-shrink: 0;
	width: 120px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
}

.ldd-continue-learning__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ldd-continue-learning__info {
	flex: 1;
	min-width: 0;
}

.ldd-continue-learning__course-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ldd-continue-learning__progress {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

.ldd-continue-learning__progress-bar {
	flex: 1;
	height: 8px;
	background: #e2e8f0;
	border-radius: 4px;
	overflow: hidden;
}

.ldd-continue-learning__progress-fill {
	height: 100%;
	background: #3b82f6;
	border-radius: 4px;
	transition: width 0.3s ease;
}

.ldd-continue-learning__progress-text {
	font-size: 13px;
	color: #64748b;
	white-space: nowrap;
}

.ldd-continue-learning__btn {
	display: inline-flex;
	align-items: center;
	padding: 6px 16px;
	background: #3b82f6;
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	border-radius: 6px;
	text-decoration: none;
	transition: background 0.2s;
}

.ldd-continue-learning__btn:hover {
	background: #2563eb;
	color: #fff;
	text-decoration: none;
}

/* ============================================================
   Insights Tab
   ============================================================ */

.ldd-insights {
	padding: 0;
}

.ldd-insights__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.ldd-insights__title {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
}

.ldd-insights__date-range {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ldd-insights__date-range label {
	font-size: 13px;
	color: #64748b;
	font-weight: 500;
}

.ldd-insights__date-input {
	padding: 6px 10px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
	background: #fff;
}

.ldd-insights__date-input:focus {
	outline: none;
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ldd-insights__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

.ldd-insights__widget {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 20px;
	min-height: 200px;
}

.ldd-insights__widget--wide {
	grid-column: span 2;
}

.ldd-insights__widget--full {
	grid-column: span 2;
}

.ldd-insights__widget-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 16px;
}

.ldd-insights__chart-container {
	position: relative;
	min-height: 300px;
	max-height: 420px;
}

.ldd-insights__chart-container .ld-dashboard-chart-wrapper,
.ldd-insights__chart-container .ld-dashboard-chart-js {
	height: 100%;
	min-height: inherit;
	max-height: inherit;
}

.ldd-insights__chart-container canvas {
	max-height: 420px;
}

/* ============================================================
   Group Overview Cards (GL on Insights tab)
   ============================================================ */

.ldd-group-overview {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 16px;
}

.ldd-group-overview__card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
}

.ldd-group-overview__name {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin: 0 0 12px;
}

.ldd-group-overview__stats {
	display: flex;
	gap: 16px;
}

.ldd-group-overview__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
}

.ldd-group-overview__stat-value {
	font-size: 20px;
	font-weight: 700;
	color: #3b82f6;
}

.ldd-group-overview__stat-label {
	font-size: 11px;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
	.ldd-quick-actions {
		gap: 8px;
	}

	.ldd-quick-actions__btn {
		padding: 6px 12px;
		font-size: 13px;
	}

	.ldd-action-items__item {
		flex: 1 1 100%;
	}

	.ldd-continue-learning__card {
		flex-direction: column;
		align-items: flex-start;
	}

	.ldd-continue-learning__thumbnail {
		width: 100%;
		height: 140px;
	}

	.ldd-insights__header {
		flex-direction: column;
		align-items: flex-start;
	}

	.ldd-insights__date-range {
		flex-wrap: wrap;
	}

	.ldd-insights__grid {
		grid-template-columns: 1fr;
	}

	.ldd-insights__widget--wide,
	.ldd-insights__widget--full {
		grid-column: span 1;
	}

	.ldd-group-overview {
		grid-template-columns: 1fr;
	}

	.ldd-insights__chart-container {
		height: 280px;
	}
}
