:root {
	--phj-primary: var(--e-global-color-primary, #0f172a);
	--phj-accent: var(--e-global-color-primary, #0f172a);
	--phj-text-main: #000000;
	--phj-text-muted: #666666;
	--phj-bg-card: #ffffff;
	--phj-border: #e0e0e0;
	--phj-radius: 8px;
	--phj-font: 'Inter Tight', -apple-system, sans-serif;
}

@keyframes phjFadeIn {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes phjSpinner {
	to { transform: rotate(360deg); }
}

.phj-job-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: var(--phj-font);
	width: 100%;
	animation: phjFadeIn 0.4s ease-out forwards;
}

/* Job Card Styling - Modern Professional */
.phj-job-card {
	border: 1px solid var(--phj-border);
	padding: 32px 36px;
	border-radius: var(--phj-radius);
	background: #ffffff;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 60px;
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.phj-job-card:hover {
	border-color: var(--phj-primary);
	box-shadow: 0 12px 40px rgba(0,0,0,0.08);
	transform: translateY(-2px);
	z-index: 5;
}

.phj-job-content {
	flex: 1;
	min-width: 0; /* Prevents overflow */
}

.phj-job-title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	color: #000000;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.phj-job-company {
	font-size: 16px;
	font-weight: 600;
	color: var(--phj-text-muted);
	margin-bottom: 16px;
	display: block;
	line-height: 1;
}

.phj-job-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 20px;
	font-size: 14px;
	color: #555555;
}

.phj-meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.phj-icon {
	width: 15px;
	height: 15px;
	color: #94a3b8;
}

.phj-job-description {
	display: block;
	font-size: 14px;
	line-height: 1.6;
	color: #475569;
	margin: 0;
	max-width: 800px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Action Buttons */
.phj-job-actions {
	display: flex;
	flex-direction: row;
	gap: 16px;
	flex-shrink: 0;
}

.phj-view-details,
.phj-apply-toggle,
.phj-submit-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	padding: 8px 18px;
	border-radius: 20px; /* Pill shaped buttons like LinkedIn */
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: var(--phj-font);
	font-weight: 600;
	font-size: 14px;
	white-space: nowrap;
}

.phj-view-details {
	background: #fff;
	color: var(--phj-primary);
	border-color: var(--phj-primary);
}

.phj-view-details:hover {
	background: rgba(0, 0, 0, 0.03);
	border-width: 2px;
	padding: 7px 17px;
}

.phj-apply-toggle,
.phj-submit-button {
	background: var(--phj-primary);
	color: #ffffff;
}

.phj-apply-toggle:hover {
	filter: brightness(0.9);
}

/* Modal Shell & Container */
.phj-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(8px);
	z-index: 999999;
	display: none;
	align-items: center; /* Back to center */
	justify-content: center;
	padding: 24px;
}

.phj-modal-overlay.is-active {
	display: flex !important;
}

body.phj-modal-open {
	overflow: hidden !important;
}

.phj-modal-container {
	background: #fff;
	width: 100%;
	max-width: 650px;
	height: 80vh; /* Fixed height for consistent look */
	max-height: 700px;
	border-radius: 16px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: phjFadeIn 0.3s ease-out forwards;
	display: flex;
	flex-direction: column;
	border-top: 4px solid var(--phj-accent);
	position: relative;
	overflow: hidden; /* Clips children to rounded corners */
}

.phj-modal-header {
	padding: 24px 32px;
	border-bottom: 1px solid var(--phj-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fff;
	border-radius: 16px 16px 0 0;
}

.phj-modal-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--phj-text-main);
}

.phj-modal-close {
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: all 0.2s;
}

.phj-modal-close:hover {
	background: #e2e8f0;
	color: #ef4444;
}

.phj-modal-body {
	padding: 32px 32px 40px;
	overflow-y: auto !important;
	flex: 1;
	min-height: 0;
	-webkit-overflow-scrolling: touch;
	display: block;
}

/* Custom Scrollbar for Modal Body */
.phj-modal-body::-webkit-scrollbar {
	width: 8px;
}

.phj-modal-body::-webkit-scrollbar-track {
	background: #f8fafc;
}

.phj-modal-body::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 10px;
	border: 2px solid #f8fafc;
}

.phj-modal-body::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

.phj-full-content {
	font-size: 15px;
	line-height: 1.8;
	color: #334155;
	padding-bottom: 20px;
}

.phj-modal-footer {
	padding: 20px 32px;
	border-top: 1px solid var(--phj-border);
	background: #f8fafc;
	display: flex;
	justify-content: flex-start;
	border-radius: 0 0 16px 16px;
}

/* Application Form */
.phj-application-wrap {
	margin-top: 24px;
	padding: 32px;
	background: #fff;
	border: 1px solid var(--phj-border);
	border-radius: var(--phj-radius);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.phj-form-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
}

.phj-form-field-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.phj-application-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

@media (max-width: 640px) {
	.phj-form-field-row {
		grid-template-columns: 1fr;
		gap: 15px;
	}
}

.phj-form-field label span {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #475569;
}

.phj-form-field input[type="text"],
.phj-form-field input[type="email"] {
	width: 100%;
	height: 46px;
	padding: 0 16px;
	border: 1px solid var(--phj-border);
	border-radius: 8px;
	background: #f8fafc;
	font-family: var(--phj-font);
	font-size: 14px;
	transition: all 0.2s;
}

.phj-form-field input:focus {
	outline: none;
	border-color: var(--phj-accent);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

/* Custom File Upload */
.phj-file-upload-container {
	position: relative;
}

.phj-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 2;
}

.phj-file-custom {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 50px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	transition: all 0.2s;
}

.phj-file-custom.has-file {
	border: 1px solid #bbfc7a;
	background: #f0fdf4;
	color: #166534;
}

.phj-file-icon {
	width: 18px;
	height: 18px;
	color: #94a3b8;
}

.phj-file-custom.has-file .phj-upload-icon {
	display: none;
}

.phj-file-custom.has-file .phj-check-icon {
	display: block !important;
	color: #166534;
}

.phj-file-text {
	font-size: 14px;
	color: #64748b;
}

/* Actions & Spinner */
.phj-form-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 10px;
}

.phj-submit-button {
	min-width: 160px;
	height: 48px;
}

.phj-btn-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: phjSpinner 0.8s linear infinite;
	margin-left: 10px;
}

.phj-form-message {
	padding: 12px;
	border-radius: 8px;
	font-size: 13px;
	margin-top: 16px;
}

.phj-form-message.is-success {
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbfc7a;
}

.phj-form-message.is-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fee2e2;
}

@media (max-width: 640px) {
	.phj-job-card {
		flex-direction: column;
		align-items: flex-start;
		padding: 24px;
	}
	.phj-job-actions {
		width: 100%;
	}
}
