/**
 * Jobus Admin Dashboard Styles
 *
 * @package Jobus
 * @since 1.5.0
 */

@use "sass:color";

// Variables
$jobus-primary: #31795A;
$jobus-primary-light: #e8f5f0;
$jobus-primary-dark: #244034;
$jobus-secondary: #D2F34C;
$jobus-success: #22c55e;
$jobus-warning: #f59e0b;
$jobus-danger: #ef4444;
$jobus-info: #3b82f6;
$jobus-gray-50: #f9fafb;
$jobus-gray-100: #f3f4f6;
$jobus-gray-200: #e5e7eb;
$jobus-gray-300: #d1d5db;
$jobus-gray-400: #9ca3af;
$jobus-gray-500: #6b7280;
$jobus-gray-600: #4b5563;
$jobus-gray-700: #374151;
$jobus-gray-800: #1f2937;
$jobus-gray-900: #111827;
$jobus-border-radius: 12px;
$jobus-border-radius-sm: 8px;
$jobus-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$jobus-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
$jobus-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

// Dashboard Wrapper
.jobus-dashboard-wrap {
	margin: 20px auto;
	max-width: 1600px;
}

// Dashboard Header
.jobus-dashboard-header {
	background: linear-gradient(135deg, $jobus-primary 0%, $jobus-primary-dark 100%);
	border-radius: $jobus-border-radius;
	padding: 28px 32px;
	margin-bottom: 24px;
	color: #fff;
}

.jobus-dashboard-header-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 16px;
}

.jobus-dashboard-title {
	display: flex;
	align-items: center;
	gap: 16px;
}

.jobus-dashboard-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: $jobus-border-radius-sm;
	
	svg {
		stroke: #fff;
	}
}

.jobus-dashboard-title-text {
	h1 {
		margin: 0;
		font-size: 26px;
		font-weight: 700;
		color: #fff;
		line-height: 1.2;
	}
}

.jobus-dashboard-subtitle {
	margin: 4px 0 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

.jobus-dashboard-meta {
	display: flex;
	align-items: center;
	gap: 12px;
}

.jobus-dashboard-version {
	padding: 4px 12px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
}

.jobus-pro-badge {
	padding: 4px 12px;
	background: $jobus-secondary;
	color: $jobus-gray-900;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.jobus-dashboard-date {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.9);
	
	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
	}
}

// Quick Actions
.jobus-quick-actions {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.jobus-quick-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: $jobus-border-radius-sm;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
	
	.dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}
	
	&.jobus-quick-action-primary {
		background: $jobus-primary;
		color: #fff;
		
		&:hover {
			background: color.adjust($jobus-primary, $lightness: -8%);
			color: #fff;
		}
	}
	
	&.jobus-quick-action-secondary {
		background: #fff;
		color: $jobus-gray-700;
		border: 1px solid $jobus-gray-200;
		box-shadow: $jobus-shadow-sm;
		
		&:hover {
			border-color: $jobus-primary;
			color: $jobus-primary;
			background: #fff;
		}
	}
}

// Stats Grid
.jobus-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
	margin-bottom: 24px;
}

.jobus-stat-card {
	background: #fff;
	border-radius: $jobus-border-radius;
	padding: 24px;
	display: flex;
	align-items: flex-start;
	gap: 16px;
	position: relative;
	box-shadow: $jobus-shadow;
	border: 1px solid $jobus-gray-100;
	transition: all 0.2s ease;
	
	&:hover {
		box-shadow: $jobus-shadow-lg;
		transform: translateY(-2px);
	}
}

.jobus-stat-card-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: $jobus-border-radius-sm;
	flex-shrink: 0;
	
	svg {
		width: 24px;
		height: 24px;
	}
}

.jobus-stat-jobs .jobus-stat-card-icon {
	background: rgba($jobus-primary, 0.1);
	
	svg {
		stroke: $jobus-primary;
	}
}

.jobus-stat-applications .jobus-stat-card-icon {
	background: rgba($jobus-info, 0.1);
	
	svg {
		stroke: $jobus-info;
	}
}

.jobus-stat-companies .jobus-stat-card-icon {
	background: rgba($jobus-warning, 0.1);
	
	svg {
		stroke: $jobus-warning;
	}
}

.jobus-stat-candidates .jobus-stat-card-icon {
	background: rgba(#8b5cf6, 0.1);
	
	svg {
		stroke: #8b5cf6;
	}
}

.jobus-stat-card-content {
	flex: 1;
	min-width: 0;
}

.jobus-stat-value {
	display: block;
	font-size: 28px;
	font-weight: 700;
	color: $jobus-gray-900;
	line-height: 1.2;
}

.jobus-stat-label {
	display: block;
	font-size: 13px;
	color: $jobus-gray-500;
	margin-top: 4px;
}

.jobus-stat-trend {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	margin-top: 8px;
	padding: 2px 8px;
	border-radius: 4px;
	
	.dashicons {
		font-size: 14px;
		width: 14px;
		height: 14px;
	}
	
	&.jobus-stat-trend-up {
		background: rgba($jobus-success, 0.1);
		color: $jobus-success;
	}
	
	&.jobus-stat-trend-down {
		background: rgba($jobus-danger, 0.1);
		color: $jobus-danger;
	}
}

.jobus-stat-card-link {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	color: $jobus-gray-400;
	transition: all 0.2s ease;
	
	&:hover {
		background: $jobus-gray-100;
		color: $jobus-primary;
	}
	
	.dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}
}

// Status Row
.jobus-status-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 24px;
}

.jobus-status-card {
	background: #fff;
	border-radius: $jobus-border-radius-sm;
	padding: 20px;
	display: flex;
	align-items: center;
	gap: 14px;
	box-shadow: $jobus-shadow-sm;
	border: 1px solid $jobus-gray-100;
}

.jobus-status-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	
	.dashicons {
		font-size: 20px;
		width: 20px;
		height: 20px;
	}
}

.jobus-status-pending .jobus-status-icon {
	background: rgba($jobus-warning, 0.1);
	color: $jobus-warning;
}

.jobus-status-approved .jobus-status-icon {
	background: rgba($jobus-success, 0.1);
	color: $jobus-success;
}

.jobus-status-rejected .jobus-status-icon {
	background: rgba($jobus-danger, 0.1);
	color: $jobus-danger;
}

.jobus-status-content {
	flex: 1;
}

.jobus-status-value {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: $jobus-gray-900;
	line-height: 1.2;
}

.jobus-status-label {
	display: block;
	font-size: 12px;
	color: $jobus-gray-500;
	margin-top: 2px;
}

// Dashboard Grid (Main Content + Sidebar)
.jobus-dashboard-grid {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 24px;
}

.jobus-dashboard-column-main {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.jobus-dashboard-column-sidebar {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

// Cards
.jobus-card {
	background: #fff;
	border-radius: $jobus-border-radius;
	box-shadow: $jobus-shadow;
	border: 1px solid $jobus-gray-100;
	overflow: hidden;
}

.jobus-card-warning {
	border-color: rgba($jobus-warning, 0.3);
	
	.jobus-card-header {
		background: rgba($jobus-warning, 0.05);
		
		h2 .dashicons {
			color: $jobus-warning;
		}
	}
}

.jobus-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid $jobus-gray-100;
	
	h2 {
		margin: 0;
		font-size: 15px;
		font-weight: 600;
		color: $jobus-gray-900;
		display: flex;
		align-items: center;
		gap: 8px;
		
		.dashicons {
			font-size: 18px;
			width: 18px;
			height: 18px;
			color: $jobus-gray-400;
		}
	}
}

.jobus-card-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	color: $jobus-primary;
	text-decoration: none;
	font-weight: 500;
	
	&:hover {
		color: color.adjust($jobus-primary, $lightness: -10%);
	}
	
	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
	}
}

.jobus-card-body {
	padding: 20px;
}

.jobus-card-list {
	padding: 12px 20px;
}

// Tables
.jobus-table {
	width: 100%;
	border-collapse: collapse;
	
	thead th {
		text-align: left;
		font-size: 11px;
		font-weight: 600;
		color: $jobus-gray-500;
		text-transform: uppercase;
		letter-spacing: 0.5px;
		padding: 8px 12px 12px;
		border-bottom: 1px solid $jobus-gray-100;
	}
	
	tbody td {
		padding: 12px;
		font-size: 13px;
		color: $jobus-gray-700;
		border-bottom: 1px solid $jobus-gray-50;
		
		a {
			color: $jobus-gray-900;
			text-decoration: none;
			
			&:hover {
				color: $jobus-primary;
			}
		}
	}
	
	tbody tr:last-child td {
		border-bottom: none;
	}
	
	.jobus-table-center {
		text-align: center;
	}
	
	.jobus-table-right {
		text-align: right;
	}
}

.jobus-applicant-cell {
	display: flex;
	align-items: center;
	gap: 10px;
	
	img {
		border-radius: 50%;
	}
}

// Badges
.jobus-badge {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	text-transform: capitalize;
	
	&.jobus-badge-pending {
		background: rgba($jobus-warning, 0.1);
		color: color.adjust($jobus-warning, $lightness: -10%);
	}
	
	&.jobus-badge-approved {
		background: rgba($jobus-success, 0.1);
		color: color.adjust($jobus-success, $lightness: -10%);
	}
	
	&.jobus-badge-rejected {
		background: rgba($jobus-danger, 0.1);
		color: color.adjust($jobus-danger, $lightness: -10%);
	}
}

// Lists
.jobus-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.jobus-list-item {
	border-bottom: 1px solid $jobus-gray-100;
	
	&:last-child {
		border-bottom: none;
	}
	
	a {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 12px 0;
		text-decoration: none;
		color: $jobus-gray-700;
		transition: color 0.2s ease;
		
		&:hover {
			color: $jobus-primary;
		}
	}
}

.jobus-list-title {
	font-size: 13px;
	font-weight: 500;
	flex: 1;
	min-width: 0;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
	padding-right: 12px;
}

.jobus-list-badge {
	padding: 4px 10px;
	background: $jobus-gray-100;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 600;
	color: $jobus-gray-600;
	white-space: nowrap;
	
	&.jobus-list-badge-warning {
		background: rgba($jobus-warning, 0.1);
		color: color.adjust($jobus-warning, $lightness: -10%);
	}
}

// Empty State
.jobus-empty-state {
	text-align: center;
	padding: 40px 20px;
	
	.dashicons {
		font-size: 48px;
		width: 48px;
		height: 48px;
		color: $jobus-gray-300;
		margin-bottom: 12px;
	}
	
	p {
		margin: 0 0 16px;
		color: $jobus-gray-500;
		font-size: 14px;
	}
}

// Resources Card
.jobus-card-resources {
	.jobus-card-body {
		padding: 8px 20px;
	}
}

.jobus-resource-list {
	list-style: none;
	margin: 0;
	padding: 0;
	
	li {
		border-bottom: 1px solid $jobus-gray-100;
		
		&:last-child {
			border-bottom: none;
		}
	}
	
	a {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 14px 0;
		text-decoration: none;
		color: $jobus-gray-700;
		font-size: 13px;
		font-weight: 500;
		transition: color 0.2s ease;
		
		.dashicons:first-child {
			font-size: 18px;
			width: 18px;
			height: 18px;
			color: $jobus-gray-400;
		}
		
		.dashicons:last-child {
			margin-left: auto;
			font-size: 14px;
			width: 14px;
			height: 14px;
			color: $jobus-gray-400;
		}
		
		&:hover {
			color: $jobus-primary;
			
			.dashicons:first-child {
				color: $jobus-primary;
			}
		}
	}
	
	.jobus-upgrade-link {
		color: $jobus-primary;
		
		.dashicons:first-child {
			color: $jobus-secondary;
		}
		
		&:hover {
			color: color.adjust($jobus-primary, $lightness: -10%);
		}
	}
}

// Responsive
@media screen and (max-width: 1200px) {
	.jobus-dashboard-grid {
		grid-template-columns: 1fr;
	}
	
	.jobus-dashboard-column-sidebar {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media screen and (max-width: 782px) {
	.jobus-dashboard-wrap {
		margin: 10px 10px 10px 0;
	}
	
	.jobus-dashboard-header {
		padding: 20px;
	}
	
	.jobus-dashboard-header-content {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.jobus-dashboard-meta {
		flex-wrap: wrap;
	}
	
	.jobus-stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	
	.jobus-status-row {
		grid-template-columns: 1fr;
	}
	
	.jobus-dashboard-column-sidebar {
		grid-template-columns: 1fr;
	}
	
	.jobus-quick-actions {
		flex-direction: column;
	}
	
	.jobus-quick-action {
		justify-content: center;
	}
}

@media screen and (max-width: 480px) {
	.jobus-stats-grid {
		grid-template-columns: 1fr;
	}
	
	.jobus-stat-value {
		font-size: 24px;
	}
}
