/**
 * CBS eRecruit - Dashboard Common Styles
 *
 * Shared styles for all role-based dashboards.
 * Includes layouts, widgets, and common components.
 *
 * @package CBSERecruit
 */

/* ==========================================================================
   Dashboard Layout
   ========================================================================== */

.cbs-dashboard {
	max-width: 1400px;
	margin: 20px auto;
	padding: 0 20px;
}

.cbs-dashboard__header {
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 2px solid #e5e5e5;
}

.cbs-dashboard__title {
	margin: 0 0 10px;
	font-size: 28px;
	font-weight: 600;
	color: #1e293b;
}

.cbs-dashboard__subtitle {
	margin: 0;
	font-size: 14px;
	color: #64748b;
}

.cbs-dashboard__content {
	display: grid;
	gap: 20px;
}

/* ==========================================================================
   Stats Card Component
   ========================================================================== */

.cbs-stats-grid {
	display: grid;
	gap: 20px;
	margin-bottom: 20px;
}

.cbs-stats-grid--2-col {
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cbs-stats-grid--3-col {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.cbs-stats-grid--4-col {
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.cbs-stats-card {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 20px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
	text-decoration: none;
	color: inherit;
}

.cbs-stats-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border-color: #cbd5e1;
}

.cbs-stats-card__icon {
	flex-shrink: 0;
	width: 50px;
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	font-size: 24px;
}

.cbs-stats-card--blue .cbs-stats-card__icon {
	background: #dbeafe;
	color: #2563eb;
}

.cbs-stats-card--green .cbs-stats-card__icon {
	background: #dcfce7;
	color: #16a34a;
}

.cbs-stats-card--orange .cbs-stats-card__icon {
	background: #fed7aa;
	color: #ea580c;
}

.cbs-stats-card--red .cbs-stats-card__icon {
	background: #fee2e2;
	color: #dc2626;
}

.cbs-stats-card--purple .cbs-stats-card__icon {
	background: #e9d5ff;
	color: #9333ea;
}

.cbs-stats-card__content {
	flex: 1;
}

.cbs-stats-card__value {
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 5px;
	color: #1e293b;
}

.cbs-stats-card__label {
	font-size: 13px;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

/* ==========================================================================
   Widget Container
   ========================================================================== */

.cbs-widget {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	overflow: hidden;
}

.cbs-widget__title {
	margin: 0;
	padding: 20px;
	font-size: 16px;
	font-weight: 600;
	color: #1e293b;
	border-bottom: 1px solid #e2e8f0;
	background: #f8fafc;
}

.cbs-widget__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	border-bottom: 1px solid #e2e8f0;
	background: #f8fafc;
}

.cbs-widget__header .cbs-widget__title {
	margin: 0;
	padding: 0;
	border: none;
	background: none;
}

.cbs-widget__content {
	padding: 20px;
}

.cbs-empty-state {
	text-align: center;
	padding: 40px 20px;
	color: #94a3b8;
	font-size: 14px;
}

/* ==========================================================================
   Recent Activity Widget
   ========================================================================== */

.cbs-activity-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cbs-activity-item {
	display: flex;
	gap: 15px;
	padding: 15px 0;
	border-bottom: 1px solid #f1f5f9;
}

.cbs-activity-item:last-child {
	border-bottom: none;
}

.cbs-activity-item__icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border-radius: 50%;
	color: #64748b;
	font-size: 18px;
}

.cbs-activity-item__content {
	flex: 1;
}

.cbs-activity-item__title {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 4px;
	text-decoration: none;
}

.cbs-activity-item__title:hover {
	color: #2563eb;
}

.cbs-activity-item__description {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 4px;
}

.cbs-activity-item__time {
	font-size: 12px;
	color: #94a3b8;
}

/* ==========================================================================
   Quick Actions Widget
   ========================================================================== */

.cbs-quick-actions-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.cbs-action-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 16px;
	text-align: center;
	text-decoration: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
	border: 1px solid transparent;
}

.cbs-action-button .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.cbs-action-button__label {
	flex: 1;
}

.cbs-action-button:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Dashboard Grid Layouts
   ========================================================================== */

.cbs-dashboard-grid-2col {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 20px;
}

.cbs-dashboard-grid-sidebar {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: 20px;
}

/* Add spacing between widgets in main and sidebar columns */
.cbs-dashboard-main > .cbs-widget,
.cbs-dashboard-sidebar > .cbs-widget {
	margin-bottom: 24px;
}

.cbs-dashboard-main > .cbs-widget:last-child,
.cbs-dashboard-sidebar > .cbs-widget:last-child {
	margin-bottom: 0;
}

@media (max-width: 1024px) {
	.cbs-dashboard-grid-sidebar {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Tables in Dashboard
   ========================================================================== */

.cbs-dashboard-table {
	width: 100%;
	border-collapse: collapse;
}

.cbs-dashboard-table th {
	text-align: left;
	padding: 12px;
	background: #f8fafc;
	border-bottom: 2px solid #e2e8f0;
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cbs-dashboard-table td {
	padding: 12px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 14px;
	color: #1e293b;
}

.cbs-dashboard-table tr:hover {
	background: #f8fafc;
}

/* ==========================================================================
   Pipeline Visualization
   ========================================================================== */

.cbs-pipeline {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 16px;
	margin: 0;
}

.cbs-pipeline-stage {
	position: relative;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 20px 16px;
	text-align: center;
	transition: all 0.2s ease;
	overflow: hidden;
}

.cbs-pipeline-stage::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #3498db 0%, #2563eb 100%);
}

.cbs-pipeline-stage:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* Support both BEM naming conventions */
.cbs-pipeline-stage__count,
.cbs-pipeline-count {
	font-size: 36px;
	font-weight: 700;
	color: #1e293b;
	line-height: 1;
	margin-bottom: 8px;
}

.cbs-pipeline-stage__label,
.cbs-pipeline-label {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 0;
}

/* Stage-specific colors for top bar */
.cbs-pipeline-stage:nth-child(1)::before {
	background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%); /* Pending - Orange */
}

.cbs-pipeline-stage:nth-child(2)::before {
	background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%); /* Reviewing - Blue */
}

.cbs-pipeline-stage:nth-child(3)::before {
	background: linear-gradient(90deg, #8b5cf6 0%, #7c3aed 100%); /* Shortlisted - Purple */
}

.cbs-pipeline-stage:nth-child(4)::before {
	background: linear-gradient(90deg, #06b6d4 0%, #0891b2 100%); /* Interview - Cyan */
}

.cbs-pipeline-stage:nth-child(5)::before {
	background: linear-gradient(90deg, #10b981 0%, #059669 100%); /* Offer - Green */
}

.cbs-pipeline-stage:nth-child(6)::before {
	background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%); /* Hired - Bright Green */
}

/* Rejected/Withdrawn styling */
.cbs-pipeline-stage:last-child::before {
	background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%); /* Rejected - Red */
}

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

@media (max-width: 768px) {
	.cbs-dashboard {
		padding: 0 10px;
	}

	.cbs-stats-grid--3-col,
	.cbs-stats-grid--4-col {
		grid-template-columns: 1fr;
	}

	.cbs-dashboard-grid-2col {
		grid-template-columns: 1fr;
	}

	.cbs-quick-actions-grid {
		grid-template-columns: 1fr;
	}

	.cbs-dashboard__title {
		font-size: 22px;
	}

	.cbs-pipeline {
		grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
		gap: 12px;
	}

	.cbs-pipeline-stage {
		padding: 16px 12px;
	}

	.cbs-pipeline-stage__count,
	.cbs-pipeline-count {
		font-size: 28px;
	}

	.cbs-pipeline-stage__label,
	.cbs-pipeline-label {
		font-size: 11px;
	}
}
