/**
 * Skills Practice Session - Dashboard Styles
 *
 * Comprehensive styles for dashboard, charts, feedback visualization
 */

/* === TARGETED CSS ISOLATION === */
/* Prevents WordPress theme styles from overriding dashboard styles */
/* The .erc-dashboard reset is defined in player.css */

/* Box-sizing only for child elements */
.erc-dashboard *,
.erc-dashboard *::before,
.erc-dashboard *::after {
	box-sizing: border-box;
}

/* Typography reset - targeted */
.erc-dashboard h1,
.erc-dashboard h2,
.erc-dashboard h3,
.erc-dashboard h4,
.erc-dashboard p,
.erc-dashboard span,
.erc-dashboard label {
	font-family: inherit !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}

/* Button reset - targeted */
.erc-dashboard button {
	font-family: inherit !important;
	font-size: 16px !important;
	line-height: 1.5 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	min-height: auto !important;
	min-width: auto !important;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

/* ==========================================================================
   Mood Trends Section
   ========================================================================== */

/* Doubled specificity for theme override */
.erc-dashboard .erc-mood-trends,
.erc-mood-trends.erc-mood-trends {
	margin: 32px 0;
	padding: 24px;
	background: #f8f9fa;
	border-radius: 12px;
}

.erc-mood-summary {
	display: flex;
	gap: 24px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.erc-mood-stat {
	flex: 1;
	min-width: 200px;
	padding: 16px;
	background: white;
	border-radius: 8px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.erc-mood-stat:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.erc-mood-stat__value {
	display: block;
	font-size: 24px;
	font-weight: 700;
	color: #10b981;
	margin-bottom: 8px;
}

.erc-mood-stat__label {
	display: block;
	font-size: 14px;
	color: #666;
	font-weight: 500;
}

/* ==========================================================================
   Legacy Bar Chart Styles (to be replaced by Chart.js)
   ========================================================================== */

.erc-mood-chart {
	background: white;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.erc-mood-chart__legend {
	display: flex;
	gap: 24px;
	margin-bottom: 16px;
	justify-content: center;
}

.erc-mood-chart__legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #374151;
}

.erc-mood-chart__legend-marker {
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.erc-mood-chart__legend-marker--before {
	background: #cbd5e1;
}

.erc-mood-chart__legend-marker--after {
	background: #10b981;
}

.erc-mood-chart__graph {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	height: 200px;
	padding: 20px 0;
	border-bottom: 2px solid #e5e7eb;
}

.erc-mood-point {
	position: relative;
	flex: 1;
	display: flex;
	align-items: flex-end;
	gap: 4px;
	height: 100%;
	cursor: pointer;
}

.erc-mood-point__before,
.erc-mood-point__after {
	flex: 1;
	border-radius: 4px 4px 0 0;
	transition: all 0.3s ease;
	min-height: 4px;
}

.erc-mood-point__before {
	background: #cbd5e1;
}

.erc-mood-point__after {
	background: #10b981;
}

.erc-mood-point:hover .erc-mood-point__before,
.erc-mood-point:hover .erc-mood-point__after {
	opacity: 0.8;
	transform: scaleY(1.05);
}

.erc-mood-change {
	position: absolute;
	top: -20px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 12px;
	font-weight: 600;
	color: #10b981;
	white-space: nowrap;
}

/* ==========================================================================
   Chart.js Canvas Containers
   ========================================================================== */

.erc-chart-container {
	position: relative;
	background: white;
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 24px;
}

.erc-chart-container__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	flex-wrap: wrap;
	gap: 16px;
}

.erc-chart-container__title {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0;
}

.erc-chart-container__controls {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.erc-chart-control-btn {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	background: #f3f4f6;
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.erc-chart-control-btn:hover {
	background: #e5e7eb;
	border-color: #9ca3af;
}

.erc-chart-control-btn--active {
	background: #4f46e5;
	color: white;
	border-color: #4f46e5;
}

.erc-chart-control-btn:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.erc-chart-canvas-wrapper {
	position: relative;
	width: 100%;
	height: 400px;
}

.erc-chart-canvas-wrapper canvas {
	max-height: 100%;
}

.erc-chart-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 300px;
	color: #6b7280;
	font-size: 16px;
}

.erc-chart-error {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 200px;
	color: #ef4444;
	font-size: 14px;
	padding: 20px;
	text-align: center;
}

.erc-chart-no-data {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 250px;
	color: #9ca3af;
	font-size: 16px;
}

.erc-chart-no-data__icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

/* ==========================================================================
   Filter Controls
   ========================================================================== */

.erc-dashboard-filters {
	display: flex;
	gap: 16px;
	margin-bottom: 24px;
	padding: 16px;
	background: white;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	flex-wrap: wrap;
	align-items: flex-end;
}

.erc-filter-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.erc-filter-label {
	font-size: 14px;
	font-weight: 500;
	color: #374151;
}

.erc-filter-select,
.erc-filter-input {
	padding: 8px 12px;
	font-size: 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	background: white;
	color: #1a1a1a;
	min-width: 150px;
	transition: border-color 0.2s ease;
}

.erc-filter-select:focus,
.erc-filter-input:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.erc-filter-apply {
	padding: 8px 20px;
	font-size: 14px;
	font-weight: 600;
	background: #4f46e5;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.erc-filter-apply:hover {
	background: #4338ca;
}

.erc-filter-reset {
	padding: 8px 20px;
	font-size: 14px;
	font-weight: 600;
	background: transparent;
	color: #6b7280;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.erc-filter-reset:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

/* ==========================================================================
   Export Controls
   ========================================================================== */

.erc-export-controls {
	display: flex;
	gap: 8px;
}

.erc-export-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 500;
	background: white;
	color: #374151;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.erc-export-btn:hover {
	background: #f9fafb;
	border-color: #9ca3af;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.erc-export-btn:active {
	transform: translateY(0);
}

.erc-export-btn__icon {
	font-size: 16px;
}

/* ==========================================================================
   Recent Feedback Section
   ========================================================================== */

.erc-recent-feedback {
	background: white;
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 24px;
}

.erc-recent-feedback__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.erc-recent-feedback__title {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0;
}

.erc-recent-feedback__view-all {
	font-size: 14px;
	color: #4f46e5;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.2s ease;
}

.erc-recent-feedback__view-all:hover {
	color: #4338ca;
	text-decoration: underline;
}

.erc-feedback-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.erc-feedback-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px;
	margin-bottom: 12px;
	background: #f9fafb;
	border-radius: 8px;
	border-left: 4px solid #10b981;
	transition: all 0.2s ease;
}

.erc-feedback-item:hover {
	background: #f3f4f6;
	transform: translateX(4px);
}

.erc-feedback-item__content {
	flex: 1;
}

.erc-feedback-item__session {
	font-size: 16px;
	font-weight: 600;
	color: #1a1a1a;
	margin-bottom: 6px;
}

.erc-feedback-item__meta {
	display: flex;
	gap: 16px;
	font-size: 14px;
	color: #6b7280;
	flex-wrap: wrap;
}

.erc-feedback-item__metric {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.erc-feedback-item__date {
	font-size: 13px;
	color: #9ca3af;
}

/* ==========================================================================
   Helpfulness Stats Section
   ========================================================================== */

.erc-helpfulness-stats {
	background: white;
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	margin-bottom: 24px;
}

.erc-helpfulness-stats__title {
	font-size: 18px;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 20px 0;
}

.erc-helpfulness-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
}

.erc-helpfulness-card {
	padding: 16px;
	background: #f9fafb;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
}

.erc-helpfulness-card__title {
	font-size: 14px;
	color: #6b7280;
	margin-bottom: 8px;
	font-weight: 500;
}

.erc-helpfulness-card__value {
	font-size: 32px;
	font-weight: 700;
	color: #10b981;
	margin-bottom: 4px;
}

.erc-helpfulness-card__subtitle {
	font-size: 13px;
	color: #9ca3af;
}

.erc-helpfulness-bar {
	width: 100%;
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
	margin-top: 12px;
}

.erc-helpfulness-bar__fill {
	height: 100%;
	background: linear-gradient(90deg, #10b981 0%, #059669 100%);
	transition: width 0.5s ease;
}

/* ==========================================================================
   Insights & Achievements
   ========================================================================== */

.erc-insights {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	padding: 24px;
	border-radius: 12px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	color: white;
	margin-bottom: 24px;
}

.erc-insights__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px 0;
}

.erc-insights__list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.erc-insights__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	margin-bottom: 12px;
	backdrop-filter: blur(10px);
}

.erc-insights__item:last-child {
	margin-bottom: 0;
}

.erc-insights__icon {
	font-size: 24px;
	flex-shrink: 0;
}

.erc-insights__text {
	font-size: 15px;
	line-height: 1.5;
}

/* ==========================================================================
   NPS Gauge Visualization
   ========================================================================== */

.erc-nps-gauge {
	text-align: center;
	padding: 32px;
}

.erc-nps-gauge__score {
	font-size: 72px;
	font-weight: 700;
	color: #4f46e5;
	margin-bottom: 8px;
	line-height: 1;
}

.erc-nps-gauge__label {
	font-size: 16px;
	color: #6b7280;
	font-weight: 500;
	margin-bottom: 24px;
}

.erc-nps-gauge__scale {
	display: flex;
	height: 12px;
	border-radius: 6px;
	overflow: hidden;
	margin: 0 auto 16px;
	max-width: 400px;
}

.erc-nps-gauge__segment {
	flex: 1;
	transition: opacity 0.3s ease;
}

.erc-nps-gauge__segment--detractor {
	background: #ef4444;
}

.erc-nps-gauge__segment--passive {
	background: #f59e0b;
}

.erc-nps-gauge__segment--promoter {
	background: #10b981;
}

.erc-nps-gauge__legend {
	display: flex;
	justify-content: space-around;
	font-size: 12px;
	color: #6b7280;
}

.erc-nps-breakdown {
	display: flex;
	justify-content: space-around;
	margin-top: 24px;
	flex-wrap: wrap;
	gap: 16px;
}

.erc-nps-breakdown__item {
	text-align: center;
}

.erc-nps-breakdown__value {
	font-size: 32px;
	font-weight: 700;
	display: block;
	margin-bottom: 4px;
}

.erc-nps-breakdown__value--detractor {
	color: #ef4444;
}

.erc-nps-breakdown__value--passive {
	color: #f59e0b;
}

.erc-nps-breakdown__value--promoter {
	color: #10b981;
}

.erc-nps-breakdown__label {
	font-size: 13px;
	color: #6b7280;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.erc-chart-control-btn,
	.erc-export-controls,
	.erc-dashboard-filters,
	.erc-filter-group,
	.erc-filter-apply,
	.erc-filter-reset {
		display: none !important;
	}

	.erc-chart-container,
	.erc-recent-feedback,
	.erc-helpfulness-stats,
	.erc-insights {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.erc-mood-trends {
		background: white;
		border: 1px solid #e5e7eb;
	}

	body {
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}
}

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

@media (max-width: 1024px) {
	.erc-chart-canvas-wrapper {
		height: 350px;
	}

	.erc-helpfulness-grid {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	}
}

@media (max-width: 768px) {
	.erc-mood-summary {
		flex-direction: column;
	}

	.erc-mood-stat {
		min-width: 100%;
	}

	.erc-mood-chart__graph {
		height: 150px;
		gap: 4px;
	}

	.erc-chart-container {
		padding: 16px;
	}

	.erc-chart-canvas-wrapper {
		height: 300px;
	}

	.erc-chart-container__header {
		flex-direction: column;
		align-items: flex-start;
	}

	.erc-dashboard-filters {
		flex-direction: column;
	}

	.erc-filter-group {
		width: 100%;
	}

	.erc-filter-select,
	.erc-filter-input {
		width: 100%;
	}

	.erc-recent-feedback,
	.erc-helpfulness-stats,
	.erc-insights {
		padding: 16px;
	}

	.erc-feedback-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.erc-nps-gauge__score {
		font-size: 56px;
	}

	.erc-nps-breakdown {
		flex-direction: column;
	}
}

@media (max-width: 480px) {
	.erc-mood-trends {
		padding: 16px;
		margin: 16px 0;
	}

	.erc-chart-control-btn,
	.erc-export-btn {
		font-size: 13px;
		padding: 6px 12px;
	}

	.erc-chart-canvas-wrapper {
		height: 250px;
	}

	.erc-mood-chart__legend {
		flex-direction: column;
		gap: 12px;
	}

	.erc-helpfulness-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.erc-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* Focus visible styles */
.erc-chart-control-btn:focus-visible,
.erc-export-btn:focus-visible,
.erc-filter-apply:focus-visible,
.erc-filter-reset:focus-visible {
	outline: 3px solid #4f46e5;
	outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.erc-mood-point__before,
	.erc-mood-point__after,
	.erc-chart-control-btn,
	.erc-export-btn,
	.erc-feedback-item,
	.erc-helpfulness-bar__fill {
		transition: none;
	}
}

/* High contrast mode */
@media (prefers-contrast: high) {
	.erc-chart-container,
	.erc-recent-feedback,
	.erc-helpfulness-stats {
		border: 2px solid currentColor;
	}

	.erc-chart-control-btn,
	.erc-export-btn,
	.erc-filter-apply {
		border-width: 2px;
	}
}
