/* Section-specific styles for client portal */

/* Content Area Container */
#contentArea {
	background-color: white;
	border-radius: var(--border-radius);
	padding: 2rem;
	min-height: 400px;
}

/* Main Section Container */
.section,
.main-content .section {
	background-color: transparent;
	border-radius: 0;
	padding: 0;
	margin-bottom: 1.5rem;
	border: none;
}

/* Section Headers */
.section-header {
	margin-bottom: 2rem;
}

.section-header h2 {
	margin-bottom: 0.5rem;
	color: var(--color-gray-900);
}

.section-subtitle {
	color: var(--color-gray-600);
	font-size: 1rem;
}

/* Dashboard Grid */
.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.stat-card {
	background: var(--color-white);
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
	display: flex;
	align-items: center;
	gap: 1rem;
	transition: all 0.3s ease;
	cursor: default;
	border: 2px solid #d0d0d0;
}

.stat-card:hover {
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
	border-color: var(--brand-grey);
}

.stat-icon {
	font-size: 2.5rem;
	line-height: 1;
}

.stat-content {
	flex: 1;
}

.stat-label {
	font-size: 0.875rem;
	color: var(--color-gray-600);
	margin-bottom: 0.25rem;
}

.stat-value {
	font-size: 2rem;
	font-weight: 700;
	color: var(--color-gray-900);
	line-height: 1.2;
}

.stat-value.stat-value-compact {
	font-size: 1.5rem;
}

/* Info Icon Tooltip */
.info-icon {
	transition: background-color 0.2s ease, color 0.2s ease;
}

.info-icon:hover {
	background-color: #0ea5e9;
	color: white;
}

.info-icon-wrapper {
	position: relative;
}

.info-icon-wrapper:hover::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: 125%;
	left: 50%;
	transform: translateX(-50%);
	background-color: #333;
	color: white;
	padding: 0.75rem;
	border-radius: 4px;
	font-size: 0.8rem;
	white-space: normal;
	max-width: 260px;
	width: max-content;
	z-index: 1000;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	line-height: 1.4;
	text-align: center;
}

.info-icon-wrapper:hover::before {
	content: '';
	position: absolute;
	bottom: 110%;
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #333;
	z-index: 1000;
	pointer-events: none;
}

/* Dashboard Sections */
.dashboard-section {
	margin-bottom: 2rem;
}

.quick-stats-section {
	margin-bottom: 2.5rem;
}

.quick-stats-section .section-subtitle {
	margin-bottom: 1.5rem;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--color-gray-600);
}

.quick-stats-section .dashboard-grid {
	gap: 1.25rem;
}

.dashboard-section h3 {
	margin-bottom: 1rem;
	color: var(--color-gray-900);
}

/* Cert Manager section grouping */
.cert-manager-block {
	background: #e5e7eb;
	border: 1px solid #cfd4dc;
	border-radius: 12px;
	padding: 1.25rem;
	margin-bottom: 1.5rem;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.cert-manager-pdc-block {
	background: #e2e8f0;
}

.cert-manager-ova-block {
	background: #e7ecef;
}

.cert-manager-block .dashboard-section:last-child {
	margin-bottom: 0;
}

/* Products Grid */
.products-grid,
.training-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 1.5rem;
}

.products-grid.products-grid-scroll {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	gap: 1rem;
	padding-bottom: 0.5rem;
	scroll-behavior: smooth;
}

.products-grid.products-grid-scroll .product-card {
	flex: 0 0 360px;
	max-width: 360px;
}

.product-card,
.training-card {
	background: var(--color-white);
	border-radius: 12px;
	padding: 1rem 1.5rem 1.5rem 1.5rem;
	box-shadow: var(--shadow-md);
	position: relative;
	transition: var(--transition-fast);
	border: 2px solid var(--brand-grey);
}

.product-card:hover,
.training-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card.disabled,
.training-card.disabled {
	opacity: 0.6;
}

.product-status {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.product-status.active {
	background: var(--color-success);
}

.product-status.inactive {
	background: var(--color-gray-400);
}

.product-card h4,
.training-card h3 {
	margin-top: 0;
	margin-bottom: 1rem;
	color: var(--color-gray-900);
}

.product-stats,
.training-stats {
	margin: 1rem 0;
}

.stat-row {
	display: flex;
	justify-content: space-between;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--color-gray-200);
}

.stat-row:last-child {
	border-bottom: none;
}

/* Training Card Specific */
.training-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.training-description {
	color: var(--color-gray-600);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

.training-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* Progress Bars */
.progress-bar-container {
	width: 100%;
	height: 8px;
	background: var(--color-gray-200);
	border-radius: 4px;
	overflow: hidden;
	margin: 0.5rem 0;
}

.progress-bar-container.small {
	height: 6px;
}

.progress-bar {
	height: 100%;
	background: var(--color-primary);
	border-radius: 4px;
	transition: width 0.3s ease;
}

.progress-text {
	font-size: 0.875rem;
	color: var(--color-gray-600);
	margin-top: 0.5rem;
}

/* Data Tables */
.table-container,
.data-table-container {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
	overflow-x: auto;
}

/* Table styling for user results (matches admin portal) */
.data-table {
	width: 100%;
	overflow: hidden;
	border-radius: var(--border-radius, 8px);
	background: #fff;
}

.data-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}

.data-table thead {
	background: #f5f5f5;
	border-bottom: 2px solid #e0e0e0;
	position: sticky;
	top: 0;
}

.data-table thead tr:first-child th:first-child {
	border-top-left-radius: var(--border-radius, 8px);
}

.data-table thead tr:first-child th:last-child {
	border-top-right-radius: var(--border-radius, 8px);
}

.data-table th {
	padding: 0.75em 0.5em;
	text-align: left;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
	min-width: 80px;
}

.data-table td {
	padding: 0.65em 0.5em;
	border-bottom: 1px solid #f0f0f0;
	max-width: 150px;
	word-break: break-word;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.data-table tbody tr:hover {
	background: #f9f9f9;
}

.data-table tbody tr.user-row {
	transition: background 0.15s;
	cursor: pointer;
}

.data-table tbody tr.user-row:hover {
	background: #fffaee;
}

/* Specific column widths */
.data-table td:nth-child(1) { min-width: 150px; } /* First column (User ID or Username) */
.data-table td:nth-child(2) { min-width: 100px; } /* Second column */
.data-table td:nth-child(3) { min-width: 100px; } /* Third column */
.data-table td:nth-child(4) { min-width: 100px; } /* Fourth column */
.data-table td:nth-child(5) { min-width: 140px; } /* Fifth column */
.data-table td:nth-child(6) { min-width: 120px; } /* Sixth column */
.data-table td:nth-child(7) { min-width: 140px; } /* Seventh column */
.data-table td:nth-child(8) { min-width: 80px; } /* Eighth column */

.table-scroll {
	max-height: 500px;
	overflow-y: auto;
}

.pdc-table-scroll {
	border-radius: var(--radius-lg, 10px);
	overflow-x: hidden;
	overflow-y: auto;
	border: 1px solid var(--color-gray-200, #e5e5e5);
	max-height: 36rem;
}

.pdc-table-scroll .btn:disabled {
	opacity: 0.55;
	filter: grayscale(0.4);
	cursor: not-allowed;
}

/* Badges */
.badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	border-radius: 12px;
	font-size: 0.875rem;
	font-weight: 500;
}

.badge.success {
	background: var(--color-success-light, #d4edda);
	color: var(--color-success);
}

.badge.warning {
	background: var(--color-warning-light, #fff3cd);
	color: var(--color-warning);
}

.badge.inactive {
	background: var(--color-gray-200);
	color: var(--color-gray-600);
}

/* PDC Status Styles */
.pdc-status {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem;
	background: #f9fafb;
	border-radius: 6px;
	margin: 1rem 0;
	border-left: 4px solid var(--color-gray-300);
}

.pdc-status .label {
	font-weight: 600;
	color: var(--color-gray-700);
	min-width: 100px;
}

.pdc-status .value {
	font-weight: 500;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
}

.pdc-status .value.unavailable {
	background: #fee2e2;
	color: #991b1b;
	border-left-color: #dc2626;
}

.pdc-status .value.available {
	background: #d1fae5;
	color: #065f46;
	border-left-color: #10b981;
}

.pdc-status .value.requested {
	background: #fef3c7;
	color: #92400e;
	border-left-color: #f59e0b;
}

.pdc-status .value.sent {
	background: #dbeafe;
	color: #1e40af;
	border-left-color: #3b82f6;
}

/* Filters and Search */
.users-filters,
.teams-filters {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.search-input {
	flex: 1;
	min-width: 250px;
	padding: 0.5rem 1rem;
	border: 1px solid var(--color-gray-300);
	border-radius: var(--radius-md);
	font-size: 1rem;
}

.filter-select {
	padding: 0.5rem 1rem;
	border: 1px solid var(--color-gray-300);
	border-radius: var(--radius-md);
	font-size: 1rem;
	background: var(--color-white);
}

.pdc-filter-select {
	outline: 2px solid var(--border-color, #e5e5e5);
	outline-offset: 2px;
	background: #ffffff !important;
	color: var(--color-gray-900);
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23374151' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8l4 4 4-4'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.75rem center !important;
	background-size: 1rem !important;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.pdc-filter-select option {
	background-color: #ffffff;
	color: var(--color-gray-900);
}

.cert-manager-pdc-block #pdcTrackingFilter {
	background-color: #ffffff !important;
}

/* Team/Location Cards */
.teams-grid,
.locations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1.5rem;
}

.team-card,
.location-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
}

.team-card-header,
.location-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.team-stats,
.location-details,
.location-stats {
	margin: 1rem 0;
}

.team-actions,
.location-actions {
	display: flex;
	gap: 0.5rem;
	margin-top: 1rem;
}

/* Reports */
.reports-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.report-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
	text-align: center;
}

.report-icon {
	font-size: 3rem;
	margin-bottom: 1rem;
}

.report-card h4 {
	margin-bottom: 0.5rem;
	color: var(--color-gray-900);
}

.report-card p {
	color: var(--color-gray-600);
	font-size: 0.9rem;
	margin-bottom: 1rem;
}

.report-settings {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	background: var(--color-white);
	padding: 1.5rem;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-md);
}

/* PDC Section */
.pdc-overview {
	margin-bottom: 2rem;
}

.info-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
}

.duties-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.5rem;
}

.duty-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
	text-align: center;
}

.duty-icon {
	font-size: 2.5rem;
	margin-bottom: 1rem;
}

.resources-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
}

.resource-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem;
	background: var(--color-white);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	text-decoration: none;
	color: var(--color-gray-900);
	transition: var(--transition-fast);
}

.resource-link:hover {
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}

.resource-icon {
	font-size: 1.5rem;
}

/* Progress Section */
.progress-section {
	margin-bottom: 2rem;
}

.progress-overview {
	margin-bottom: 2rem;
}

.progress-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
}

.product-progress-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.product-progress-item {
	background: var(--color-white);
	border-radius: var(--radius-md);
	padding: 1rem;
	box-shadow: var(--shadow-sm);
}

.product-progress-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.product-name {
	font-weight: 600;
	color: var(--color-gray-900);
}

.product-progress-value {
	font-weight: 700;
	color: var(--color-primary);
}

.product-progress-details {
	display: flex;
	gap: 1rem;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--color-gray-600);
}

/* Member Progress */
.member-progress-card {
	background: var(--color-white);
	border-radius: var(--radius-md);
	padding: 1rem;
	box-shadow: var(--shadow-sm);
	margin-bottom: 1rem;
}

.member-progress-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.member-progress-stats {
	display: flex;
	gap: 1rem;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--color-gray-600);
}

/* Empty States */
.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--color-gray-600);
}

.empty-state .text-muted {
	font-size: 0.9rem;
	margin-top: 0.5rem;
}

/* Error States */
.error-state {
	text-align: center;
	padding: 3rem 1rem;
	color: var(--color-error);
}

/* Loading States */
.loading-message {
	text-align: center;
	padding: 2rem;
	color: var(--color-gray-600);
}

/* Chart Placeholders */
.chart-placeholder {
	background: var(--color-gray-100);
	border-radius: var(--radius-md);
	padding: 3rem 1rem;
	text-align: center;
	min-height: 200px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.progress-charts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.chart-card {
	background: var(--color-white);
	border-radius: var(--radius-lg);
	padding: 1.5rem;
	box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
	.dashboard-grid {
		grid-template-columns: 1fr;
	}
	
	.products-grid,
	.training-grid,
	.teams-grid,
	.locations-grid {
		grid-template-columns: 1fr;
	}
	
	.users-filters,
	.teams-filters {
		flex-direction: column;
	}
	
	.search-input {
		min-width: 100%;
	}
	
	.data-table-container {
		overflow-x: scroll;
	}
}
