/**
 * Al Mashreq Performance & Progress Module Styles
 * Brand Palette: #FF8D50 (Primary Orange), #1E1E24 (Dark Charcoal), #363434 (Body Dark), #F8F9FA (Card Light BG)
 */

.almashreq-performance-wrapper {
	--amp-primary: #FF8D50;
	--amp-primary-hover: #E0783E;
	--amp-primary-light: rgba(255, 141, 80, 0.12);
	--amp-dark: #1E1E24;
	--amp-dark-card: #282830;
	--amp-text-main: #363434;
	--amp-text-muted: #6C757D;
	--amp-bg-light: #F8F9FA;
	--amp-border: #E2E8F0;
	--amp-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
	--amp-shadow-hover: 0 15px 35px rgba(255, 141, 80, 0.15);
	--amp-radius: 16px;
	--amp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--amp-text-main);
	margin: 30px 0;
	width: 100%;
	box-sizing: border-box;
}

.almashreq-performance-wrapper * {
	box-sizing: border-box;
}

/* Header & Tabs */
.amp-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 25px;
	border-bottom: 2px solid var(--amp-border);
	padding-bottom: 20px;
}

.amp-header-title h2 {
	margin: 0 0 8px 0;
	font-size: 26px;
	font-weight: 700;
	color: var(--amp-dark);
	letter-spacing: -0.5px;
}

.amp-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--amp-primary-light);
	color: var(--amp-primary);
	font-size: 13px;
	font-weight: 600;
	padding: 5px 14px;
	border-radius: 30px;
}

.amp-pulse {
	width: 8px;
	height: 8px;
	background-color: var(--amp-primary);
	border-radius: 50%;
	display: inline-block;
	box-shadow: 0 0 0 rgba(255, 141, 80, 0.4);
	animation: ampPulse 2s infinite;
}

@keyframes ampPulse {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 141, 80, 0.7);
	}
	70% {
		box-shadow: 0 0 0 10px rgba(255, 141, 80, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(255, 141, 80, 0);
	}
}

.amp-tabs {
	display: flex;
	background: var(--amp-bg-light);
	padding: 5px;
	border-radius: 12px;
	gap: 4px;
	border: 1px solid var(--amp-border);
}

.amp-tab-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: none;
	background: transparent;
	color: var(--amp-text-muted);
	font-size: 14px;
	font-weight: 600;
	border-radius: 8px;
	cursor: pointer;
	transition: var(--amp-transition);
}

.amp-tab-btn:hover {
	color: var(--amp-dark);
	background: rgba(255, 255, 255, 0.7);
}

.amp-tab-btn.active {
	background: #FFFFFF;
	color: var(--amp-primary);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* KPI Banner Grid */
.amp-kpi-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	margin-bottom: 30px;
}

.amp-kpi-card {
	background: #FFFFFF;
	border-radius: var(--amp-radius);
	padding: 24px;
	border: 1px solid var(--amp-border);
	box-shadow: var(--amp-shadow);
	display: flex;
	align-items: flex-start;
	gap: 16px;
	transition: var(--amp-transition);
	position: relative;
	overflow: hidden;
}

.amp-kpi-card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: var(--amp-primary);
}

.amp-kpi-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--amp-shadow-hover);
}

.amp-kpi-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kpi-primary .amp-kpi-icon {
	background: var(--amp-primary-light);
	color: var(--amp-primary);
}

.kpi-secondary .amp-kpi-icon {
	background: rgba(54, 162, 235, 0.12);
	color: #2B80FF;
}

.kpi-accent .amp-kpi-icon {
	background: rgba(40, 167, 69, 0.12);
	color: #28A745;
}

.kpi-dark .amp-kpi-icon {
	background: rgba(30, 30, 36, 0.1);
	color: var(--amp-dark);
}

.amp-kpi-body {
	display: flex;
	flex-direction: column;
}

.amp-kpi-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--amp-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.amp-kpi-value {
	font-size: 30px;
	font-weight: 800;
	color: var(--amp-dark);
	line-height: 1.1;
	margin-bottom: 6px;
}

.amp-kpi-subtext {
	font-size: 12px;
	color: var(--amp-text-muted);
}

/* Dynamic Views Container */
.amp-views-container {
	position: relative;
	min-height: 350px;
}

.amp-view-content {
	display: none;
	opacity: 0;
	transition: opacity 0.4s ease;
}

.amp-view-content.active {
	display: block;
	opacity: 1;
}

/* Dashboard View */
.amp-dashboard-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 24px;
}

@media (max-width: 900px) {
	.amp-dashboard-grid {
		grid-template-columns: 1fr;
	}
}

.amp-panel {
	background: #FFFFFF;
	border: 1px solid var(--amp-border);
	border-radius: var(--amp-radius);
	padding: 28px;
	box-shadow: var(--amp-shadow);
}

.amp-panel h3 {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--amp-dark);
	border-left: 4px solid var(--amp-primary);
	padding-left: 12px;
}

.amp-featured-year-badge {
	display: inline-block;
	background: var(--amp-dark);
	color: #FFFFFF;
	font-size: 14px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 6px;
	margin-bottom: 20px;
}

.amp-rings-flex {
	display: flex;
	justify-content: space-around;
	flex-wrap: wrap;
	gap: 20px;
	text-align: center;
}

.amp-ring-item {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.amp-ring-svg-wrap {
	position: relative;
	width: 120px;
	height: 120px;
	margin-bottom: 10px;
}

.amp-ring-svg-wrap svg {
	transform: rotate(-90deg);
}

.ring-bg {
	fill: none;
	stroke: var(--amp-bg-light);
	stroke-width: 10;
}

.ring-fill {
	fill: none;
	stroke-width: 10;
	stroke-linecap: round;
	transition: stroke-dashoffset 1.5s ease-in-out;
}

.ring-orange { stroke: var(--amp-primary); }
.ring-blue { stroke: #2B80FF; }
.ring-teal { stroke: #20C997; }

.ring-text {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ring-num {
	font-size: 20px;
	font-weight: 800;
	color: var(--amp-dark);
}

.ring-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--amp-text-muted);
}

/* Milestones List */
.amp-milestones-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.amp-milestones-list li {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding-bottom: 16px;
	border-bottom: 1px dashed var(--amp-border);
}

.amp-milestones-list li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.m-icon {
	font-size: 24px;
	line-height: 1;
}

.m-content strong {
	display: block;
	font-size: 14px;
	color: var(--amp-dark);
	margin-bottom: 2px;
}

.m-content p {
	margin: 0;
	font-size: 13px;
	color: var(--amp-text-muted);
}

/* Visual Growth Chart */
.amp-chart-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 25px;
}

.amp-chart-header h3 {
	margin: 0;
}

.amp-chart-legend {
	display: flex;
	gap: 15px;
	font-size: 13px;
	font-weight: 600;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
}

.legend-item .dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.legend-trainees .dot { background: var(--amp-primary); }
.legend-courses .dot { background: #2B80FF; }

.amp-chart-container {
	overflow-x: auto;
	padding-top: 40px;
	padding-bottom: 10px;
}

.amp-bar-chart {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	height: 280px;
	min-width: 650px;
	padding-bottom: 30px;
	border-bottom: 2px solid var(--amp-border);
}

.amp-chart-bar-group {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	position: relative;
}

.amp-bar-wrapper {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.amp-bar-fill {
	width: 70%;
	max-width: 24px;
	background: linear-gradient(180deg, var(--amp-primary) 0%, #FFB085 100%);
	border-radius: 6px 6px 0 0;
	position: relative;
	transition: height 0.8s ease, background 0.3s ease;
	cursor: pointer;
}

.amp-bar-fill:hover {
	background: var(--amp-primary-hover);
}

.amp-bar-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--amp-text-muted);
	margin-top: 8px;
	transform: rotate(-45deg);
	white-space: nowrap;
}

/* Bar Tooltip */
.amp-bar-tooltip {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%) translateY(-10px);
	background: var(--amp-dark);
	color: #FFFFFF;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 12px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: all 0.2s ease;
	pointer-events: none;
	z-index: 10;
	box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.amp-bar-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border-width: 6px;
	border-style: solid;
	border-color: var(--amp-dark) transparent transparent transparent;
}

.amp-chart-bar-group:hover .amp-bar-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(-5px);
}

/* Yearly Cards Grid & Filters */
.amp-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	margin-bottom: 25px;
}

.amp-search-input {
	padding: 10px 16px;
	border: 1px solid var(--amp-border);
	border-radius: 8px;
	font-size: 14px;
	width: 250px;
	outline: none;
	transition: border-color 0.2s ease;
}

.amp-search-input:focus {
	border-color: var(--amp-primary);
	box-shadow: 0 0 0 3px var(--amp-primary-light);
}

.amp-quick-years {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.amp-year-chip {
	padding: 6px 14px;
	border: 1px solid var(--amp-border);
	background: #FFFFFF;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	color: var(--amp-text-muted);
	cursor: pointer;
	transition: var(--amp-transition);
}

.amp-year-chip:hover, .amp-year-chip.active {
	background: var(--amp-primary);
	color: #FFFFFF;
	border-color: var(--amp-primary);
}

.amp-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
}

.amp-year-card {
	background: #FFFFFF;
	border: 1px solid var(--amp-border);
	border-radius: var(--amp-radius);
	padding: 20px;
	box-shadow: var(--amp-shadow);
	transition: var(--amp-transition);
}

.amp-year-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--amp-shadow-hover);
	border-color: var(--amp-primary-light);
}

.amp-card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 15px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--amp-border);
}

.amp-card-year {
	font-size: 22px;
	font-weight: 800;
	color: var(--amp-dark);
}

.amp-card-tag {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	background: var(--amp-bg-light);
	color: var(--amp-text-muted);
	padding: 3px 8px;
	border-radius: 4px;
}

.amp-card-metrics {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	text-align: center;
}

.amp-metric-box {
	background: var(--amp-bg-light);
	padding: 10px 5px;
	border-radius: 8px;
}

.amp-metric-box .m-val {
	display: block;
	font-size: 16px;
	font-weight: 700;
	color: var(--amp-dark);
}

.amp-metric-box .m-lbl {
	display: block;
	font-size: 11px;
	color: var(--amp-text-muted);
	margin-top: 2px;
}

.amp-card-footer {
	margin-top: 14px;
	padding-top: 10px;
	border-top: 1px dashed var(--amp-border);
	font-size: 12px;
	color: var(--amp-primary);
	font-weight: 600;
	text-align: right;
}

/* Data Table Styling */
.amp-table-responsive {
	overflow-x: auto;
	background: #FFFFFF;
	border-radius: var(--amp-radius);
	border: 1px solid var(--amp-border);
	box-shadow: var(--amp-shadow);
}

.amp-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 14px;
}

.amp-table th {
	background: var(--amp-dark);
	color: #FFFFFF;
	font-weight: 600;
	padding: 14px 18px;
	border: none;
}

.amp-table td {
	padding: 14px 18px;
	border-bottom: 1px solid var(--amp-border);
	color: var(--amp-text-main);
}

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

.amp-table tr:hover td {
	background: var(--amp-primary-light);
}

.amp-badge-number {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 6px;
	font-weight: 700;
	font-size: 13px;
}

.trainees-bg { background: rgba(255, 141, 80, 0.15); color: #D65A18; }
.courses-bg { background: rgba(43, 128, 255, 0.15); color: #1B65D4; }
.companies-bg { background: rgba(32, 201, 151, 0.15); color: #128B67; }

/* Responsive adjustments */
@media (max-width: 600px) {
	.amp-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.amp-tabs {
		width: 100%;
		overflow-x: auto;
	}
	.amp-tab-btn {
		white-space: nowrap;
		padding: 8px 12px;
		font-size: 13px;
	}
	.amp-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.amp-search-input {
		width: 100%;
	}
}
