/* Show filter name above dropdown once a value is selected */
.funding-popup-enabled .select-filter-wrapper .funding-filter-name-label {
	display: none;
	margin: 0 0 4px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
	line-height: 1.2;
}

.funding-popup-enabled .select-filter-wrapper.has-funding-filter-label .funding-filter-name-label {
	display: block;
}

.funding-popup-enabled table tbody tr {
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.funding-popup-enabled table tbody tr:hover {
	background-color: #f1f5f9 !important;
}

.funding-popup-enabled table tbody tr:hover > td {
	background-color: transparent !important;
}

/* Keep Link column looking clickable, not whole-row style */
.funding-popup-enabled table tbody td.col-link,
.funding-popup-enabled table tbody td.col-link * {
	cursor: pointer;
}

.funding-popup-enabled table tbody td.col-title .funding-popup-trigger,
.funding-popup-enabled table tbody td.col-program_name .funding-popup-trigger {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

.funding-popup-enabled table tbody td.col-title .funding-popup-trigger:hover,
.funding-popup-enabled table tbody td.col-program_name .funding-popup-trigger:hover {
	text-decoration: underline;
}

/* Hide helper columns used only for Search (popup fields) */
.funding-popup-enabled th.col-activity_supported,
.funding-popup-enabled td.col-activity_supported,
.funding-popup-enabled th.col-opening_date,
.funding-popup-enabled td.col-opening_date,
.funding-popup-enabled th.col-sector,
.funding-popup-enabled td.col-sector,
.funding-popup-enabled th.col-geography,
.funding-popup-enabled td.col-geography,
.funding-popup-enabled th.col-intake_type,
.funding-popup-enabled td.col-intake_type,
.funding-popup-enabled th.col-inclusion,
.funding-popup-enabled td.col-inclusion,
.funding-popup-enabled th.col-sponsor,
.funding-popup-enabled td.col-sponsor,
.funding-popup-enabled th.col-last_verified,
.funding-popup-enabled td.col-last_verified {
	display: none !important;
}

.funding-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(15, 23, 42, 0.55);
	box-sizing: border-box;
}

.funding-popup-overlay.is-open {
	display: flex;
}

.funding-popup-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(720px, 100%);
	max-height: min(85vh, 900px);
	overflow: hidden;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	padding: 0;
	box-sizing: border-box;
}

.funding-popup-close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f1f5f9;
	color: #0f172a;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.funding-popup-close:hover {
	background: #e2e8f0;
}

.funding-popup-title {
	flex-shrink: 0;
	margin: 0;
	padding: 28px 56px 16px 28px;
	font-size: 1.35rem;
	line-height: 1.3;
	color: #0f172a;
}

.funding-popup-body {
	display: grid;
	gap: 14px;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	padding: 0 28px 24px;
}

.funding-popup-row {
	display: grid;
	gap: 4px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e2e8f0;
}

.funding-popup-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.funding-popup-label {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #64748b;
}

.funding-popup-value {
	font-size: 0.98rem;
	line-height: 1.55;
	color: #1e293b;
	word-break: break-word;
}

.funding-popup-value a {
	color: #be185d;
}

.funding-popup-loading,
.funding-popup-error {
	padding: 24px 8px;
	text-align: center;
	color: #64748b;
}

.funding-popup-error {
	color: #b91c1c;
}

body.funding-popup-open {
	overflow: hidden;
}

@media (max-width: 640px) {
	.funding-popup-dialog {
		max-height: 90vh;
	}

	.funding-popup-close {
		top: 12px;
		right: 12px;
	}

	.funding-popup-title {
		padding: 22px 52px 14px 18px;
		font-size: 1.15rem;
	}

	.funding-popup-body {
		padding: 0 18px 18px;
	}
}
