/**
 * Shareholder Dashboard Styles
 * Comprehensive styling for KPI dashboard with charts
 */

/* Main Dashboard Container */
.shareholder-dashboard {
	max-width: 1600px;
	margin: 0 auto;
	padding: 1.5rem;
}

/* Override tooltip styling for dashboard - show text normally with icon positioned after */
.shareholder-dashboard pc-tooltip {
	display: inline;
	width: auto;
	height: auto;
	background-image: none;
	background-color: transparent;
	border-radius: 0;
	margin-left: 0;
	padding-right: 18px; /* Space for the icon */
	position: relative;
}

/* Add info icon after the text */
.shareholder-dashboard pc-tooltip::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background-image: url(/src/img/2023/svg/icons/rd-icon-info-circle.svg);
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.5;
}

.shareholder-dashboard pc-tooltip:hover::after {
	opacity: 1;
}

/* Dashboard Header */
.dashboard-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid var(--pc-color-border, #e5e7eb);
}

.dashboard-header h1 {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--pc-color-text-primary, #111827);
}

/* Loading State */
.dashboard-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	gap: 1rem;
}

.dashboard-loading .spinner {
	width: 48px;
	height: 48px;
	border: 4px solid #e5e7eb;
	border-top-color: var(--pc-primary-color, #3b82f6);
	border-radius: 50%;
	animation: dashboard-spin 1s linear infinite;
}

@keyframes dashboard-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Error State */
.dashboard-error {
	text-align: center;
	padding: 3rem;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
}

.dashboard-error h3 {
	color: #dc2626;
	margin-bottom: 0.5rem;
}

/* Dashboard Sections */
.dashboard-section {
	margin-bottom: 3rem;
	padding: 1.5rem;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.dashboard-section h2 {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0 0 1.5rem 0;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.dashboard-section h2 i {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	font-size: 0.875rem;
}

/* Section-specific header icon colors */
.revenue-section h2 i {
	background: linear-gradient(135deg, #3b82f6, #1d4ed8);
	color: #fff;
}

.customer-section h2 i {
	background: linear-gradient(135deg, #22c55e, #15803d);
	color: #fff;
}

.package-section h2 i {
	background: linear-gradient(135deg, #8b5cf6, #6d28d9);
	color: #fff;
}

.user-section h2 i {
	background: linear-gradient(135deg, #06b6d4, #0891b2);
	color: #fff;
}

.payment-section h2 i {
	background: linear-gradient(135deg, #f59e0b, #d97706);
	color: #fff;
}

.unit-economics-section h2 i {
	background: linear-gradient(135deg, #ec4899, #be185d);
	color: #fff;
}

.engagement-section h2 i {
	background: linear-gradient(135deg, #10b981, #047857);
	color: #fff;
}

.growth-section h2 i {
	background: linear-gradient(135deg, #f97316, #c2410c);
	color: #fff;
}

/* KPI Cards Grid */
.kpi-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

/* KPI Card */
.kpi-card {
	display: flex;
	flex-direction: column;
	padding: 1.25rem;
	background: #f9fafb;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	transition: transform 0.15s, box-shadow 0.15s;
}

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

.kpi-card .kpi-label {
	font-size: 0.8125rem;
	font-weight: 500;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.025em;
	margin-bottom: 0.5rem;
}

.kpi-card .kpi-value {
	font-size: 1.75rem;
	font-weight: 700;
	color: #111827;
	line-height: 1.2;
	margin-bottom: 0.25rem;
}

.kpi-card .kpi-value.positive {
	color: #059669;
}

.kpi-card .kpi-value.negative {
	color: #dc2626;
}

.kpi-card .kpi-detail {
	font-size: 0.75rem;
	color: #9ca3af;
}

/* Card color accents */
.revenue-card {
	border-left: 4px solid #3b82f6;
}

.customer-card {
	border-left: 4px solid #22c55e;
}

.package-card {
	border-left: 4px solid #8b5cf6;
}

.user-card {
	border-left: 4px solid #06b6d4;
}

.payment-card {
	border-left: 4px solid #f59e0b;
}

.economics-card {
	border-left: 4px solid #ec4899;
}

.engagement-card {
	border-left: 4px solid #10b981;
}

.growth-card {
	border-left: 4px solid #f97316;
}

.kpi-card .kpi-value.warning {
	color: #d97706;
}

/* Chart Grid */
.chart-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1.5rem;
}

.chart-container {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1rem;
}

.chart-container.full-width {
	grid-column: 1 / -1;
}

.chart-container h3 {
	font-size: 0.9375rem;
	font-weight: 600;
	color: #374151;
	margin: 0 0 1rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #f3f4f6;
}

/* ApexCharts overrides */
.chart-container .apexcharts-legend-text {
	font-size: 12px !important;
}

.chart-container .apexcharts-tooltip {
	font-size: 12px;
}

/* Responsive Design */
@media (max-width: 1200px) {
	.chart-grid {
		grid-template-columns: 1fr;
	}

	.chart-container.full-width {
		grid-column: 1;
	}
}

@media (max-width: 768px) {
	.shareholder-dashboard {
		padding: 1rem;
	}

	.dashboard-header {
		flex-direction: column;
		gap: 1rem;
		align-items: flex-start;
	}

	.dashboard-header h1 {
		font-size: 1.5rem;
	}

	.dashboard-section {
		padding: 1rem;
	}

	.kpi-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.kpi-card .kpi-value {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.kpi-cards {
		grid-template-columns: 1fr;
	}
}

/* Print styles */
@media print {
	.shareholder-dashboard {
		max-width: 100%;
		padding: 0;
	}

	.dashboard-header button {
		display: none;
	}

	.dashboard-section {
		break-inside: avoid;
		page-break-inside: avoid;
		box-shadow: none;
		border: 1px solid #e5e7eb;
	}

	.kpi-card {
		border: 1px solid #e5e7eb;
	}
}

/* ============================================================================
   PROJECTION SECTIONS
   ============================================================================ */

/* Projections Divider */
.projections-divider {
	margin: 3rem 0 2rem;
	padding: 2rem;
	background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
	border-radius: 12px;
	text-align: center;
	color: #fff;
}

.projections-divider h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	border: none;
	padding: 0;
	color: #fff !important;
}

.projections-divider h2 i {
	font-size: 1.25rem;
}

.projections-subtitle {
	margin: 0.75rem 0 0;
	font-size: 0.9375rem;
	opacity: 0.85;
}

/* Projection Section Styling */
.projection-section {
	border-left: 4px solid #1e3a5f;
}

.projection-section h2 i {
	background: linear-gradient(135deg, #1e3a5f, #2d5a87) !important;
}

/* Section-specific colors */
.mrr-projection-section {
	border-left-color: #3b82f6;
}

.mrr-projection-section h2 i {
	background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
}

.facilities-projection-section {
	border-left-color: #22c55e;
}

.facilities-projection-section h2 i {
	background: linear-gradient(135deg, #22c55e, #15803d) !important;
}

.plus-projection-section {
	border-left-color: #8b5cf6;
}

.plus-projection-section h2 i {
	background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
}

.size-projection-section {
	border-left-color: #f59e0b;
}

.size-projection-section h2 i {
	background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

.sales-projection-section {
	border-left-color: #06b6d4;
}

.sales-projection-section h2 i {
	background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
}

.budget-section {
	border-left-color: #6b7280;
}

.budget-section h2 i {
	background: linear-gradient(135deg, #6b7280, #4b5563) !important;
}

/* Question and Methodology Boxes */
.projection-question {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	padding: 1rem 1.25rem;
	margin-bottom: 1rem;
	font-size: 0.9375rem;
	color: #1e40af;
}

.projection-methodology {
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 0.875rem 1.25rem;
	margin-bottom: 1.5rem;
	font-size: 0.8125rem;
	color: #6b7280;
}

/* Projection Card Styling */
.kpi-card.projection-card {
	border-left: 4px solid #1e3a5f;
	background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
}

.kpi-card.projection-card.target {
	border-left-color: #22c55e;
	background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%);
}

.kpi-card.projection-card.target .kpi-value {
	color: #15803d;
}

/* Progress Bar */
.progress-bar-container {
	position: relative;
	background: #e5e7eb;
	border-radius: 8px;
	height: 32px;
	margin-bottom: 1.5rem;
	overflow: hidden;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
	border-radius: 8px;
	transition: width 0.5s ease;
}

.progress-bar.facilities {
	background: linear-gradient(90deg, #22c55e 0%, #15803d 100%);
}

.progress-bar.plus {
	background: linear-gradient(90deg, #8b5cf6 0%, #6d28d9 100%);
}

.progress-label {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.8125rem;
	font-weight: 600;
	color: #111827;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Projection Tables */
.projection-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 1.5rem;
	font-size: 0.875rem;
}

.projection-table th,
.projection-table td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.projection-table th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	font-size: 0.8125rem;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.projection-table tbody tr:hover {
	background: #f9fafb;
}

.projection-table .gap-positive {
	color: #15803d;
	font-weight: 600;
}

.projection-table .gap-negative {
	color: #dc2626;
	font-weight: 600;
}

.projection-table .target-cell {
	color: #059669;
	font-weight: 600;
}

/* Sales Rep Cards */
.sales-rep-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.sales-rep-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 1.25rem;
	transition: box-shadow 0.15s;
}

.sales-rep-card:hover {
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.rep-name {
	font-weight: 600;
	font-size: 1rem;
	color: #111827;
}

.rep-share {
	font-size: 0.75rem;
	color: #6b7280;
	background: #f3f4f6;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
}

.rep-current {
	display: flex;
	gap: 1rem;
	margin-bottom: 1rem;
}

.rep-current .stat {
	flex: 1;
	text-align: center;
}

.rep-current .stat-value {
	display: block;
	font-size: 1.125rem;
	font-weight: 700;
	color: #111827;
}

.rep-current .stat-label {
	display: block;
	font-size: 0.6875rem;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.rep-targets {
	background: #f0fdf4;
	border-radius: 6px;
	padding: 0.875rem;
}

.rep-targets h4 {
	margin: 0 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: #15803d;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

.target-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.25rem 0;
	font-size: 0.8125rem;
}

.target-label {
	color: #6b7280;
}

.target-value {
	font-weight: 600;
	color: #059669;
}

/* Placeholder Message */
.placeholder-message {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem;
	background: #f9fafb;
	border: 2px dashed #d1d5db;
	border-radius: 8px;
	text-align: center;
}

.placeholder-message i {
	font-size: 2.5rem;
	color: #9ca3af;
	margin-bottom: 1rem;
}

.placeholder-message span {
	font-size: 1.125rem;
	font-weight: 600;
	color: #6b7280;
}

.placeholder-message p {
	margin: 0.5rem 0 0;
	font-size: 0.875rem;
	color: #9ca3af;
}

/* Size Distribution Table Container */
.size-table,
.sales-table {
	overflow-x: auto;
	margin-top: 1.5rem;
}

/* Responsive adjustments for projections */
@media (max-width: 768px) {
	.projections-divider {
		padding: 1.5rem;
	}

	.projections-divider h2 {
		font-size: 1.25rem;
	}

	.sales-rep-cards {
		grid-template-columns: 1fr;
	}

	.projection-table {
		font-size: 0.8125rem;
	}

	.projection-table th,
	.projection-table td {
		padding: 0.5rem 0.75rem;
	}
}
