/* Scholarship + institution search toolbars (nd-learning, /scholarships/ pages) */

.nd-learning-aug-toolbar {
	background: linear-gradient(165deg, #f8fafc 0%, #ffffff 55%);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 12px;
	padding: 0.9rem 1rem 1rem;
	margin: 0 0 1.15rem;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px rgba(15, 23, 42, 0.06);
	box-sizing: border-box;
}

.nd-learning-aug-toolbar--institutions {
	margin-top: 0.75rem;
	margin-bottom: 0.85rem;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	align-self: stretch;
}

/* Compact institution card + embedded country links (moved from UCP sidebar) */
.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country {
	padding: 0.45rem 0.55rem 0.55rem;
	margin-top: 0.35rem;
	margin-bottom: 0.65rem;
	margin-left: 0;
	margin-right: 0;
}

.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country .nd-learning-aug-toolbar-head {
	margin-bottom: 0.3rem;
}

.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country .nd-learning-aug-toolbar-kicker {
	font-size: 0.6rem;
	margin-bottom: 0.05rem;
}

.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country .nd-learning-aug-toolbar-label {
	font-size: 0.8125rem;
	line-height: 1.25;
}

.nd-learning-aug-toolbar-countryrow {
	display: flex;
	align-items: center;
	gap: 0.35rem 0.45rem;
	margin-bottom: 0.4rem;
	padding-bottom: 0.4rem;
	border-bottom: 1px solid rgba(15, 23, 42, 0.07);
	width: 100%;
	box-sizing: border-box;
}

.nd-learning-aug-toolbar-countrylabel {
	flex-shrink: 0;
	font-size: 0.6rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(15, 23, 42, 0.42);
	line-height: 1.4;
	padding-top: 0;
	align-self: center;
}

.nd-learning-aug-toolbar-countryscroller {
	flex: 1;
	min-width: 0;
	display: block;
}

.nd-learning-aug-inst-country-input-row {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.nd-learning-aug-inst-country-input-row > a {
	flex-shrink: 0;
	text-decoration: none;
	max-width: 42%;
}

.nd-learning-aug-inst-country-input-row .nd-learning-aug-toolbar-input {
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	margin: 0;
}

.nd-learning-aug-inst-country-input-row > a .scholarship_button,
.nd-learning-aug-toolbar-countryscroller > a .scholarship_button {
	display: inline-block;
	padding: 0.28rem 0.45rem;
	font-size: 0.72rem;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	background: #fff;
	color: #334155;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
	line-height: 1.15;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.nd-learning-aug-inst-country-input-row > a:hover .scholarship_button,
.nd-learning-aug-toolbar-countryscroller a:hover .scholarship_button {
	border-color: rgba(37, 99, 235, 0.35);
	color: #1e3a8a;
}

.nd-learning-aug-inst-country-input-row .scholarship_button.scholarship_country_selected,
.nd-learning-aug-toolbar-countryscroller .scholarship_button.scholarship_country_selected {
	background: rgba(37, 99, 235, 0.1);
	border-color: rgba(37, 99, 235, 0.45);
	color: #1d4ed8;
}

.nd-learning-aug-inst-country-input-row .scholarship_button img,
.nd-learning-aug-toolbar-countryscroller .scholarship_button img {
	display: none;
}

.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country .nd-learning-aug-toolbar-input {
	padding: 0.4rem 0.55rem;
	font-size: 0.8125rem;
}

.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--with-country .nd-learning-aug-toolbar-meta {
	margin-top: 0.3rem;
	font-size: 0.6875rem;
}

/* Country card: chỉ tên quốc gia + ô search (giống sidebar AUG) */
.nd-learning-aug-toolbar--institutions.nd-learning-aug-toolbar--country-card-only {
	/* Chiều ngang: JS đo .scholarship_button của <a> liền trên (aug-scholarship-search.js) */
	align-self: flex-start;
	width: auto;
	min-width: 0;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
	background: #fff;
	background-image: none;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
	padding: 0.65rem 0.75rem 0.75rem;
}

.nd-learning-aug-toolbar--country-card-only .nd-aug-country-inst-card {
	border: 0;
	margin: 0;
	padding: 0;
}

.nd-learning-aug-toolbar--country-card-only .nd-learning-aug-toolbar-countryrow {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.nd-learning-aug-toolbar--country-card-only .nd-learning-aug-inst-country-input-row {
	flex-direction: column;
	align-items: stretch;
	gap: 0.45rem;
}

.nd-learning-aug-toolbar--country-card-only .nd-learning-aug-inst-country-input-row > a {
	max-width: 100%;
}

.nd-learning-aug-toolbar--country-card-only .nd-aug-country-inst-card-title {
	display: block;
	text-decoration: none;
	color: inherit;
}

.nd-learning-aug-toolbar--country-card-only .nd-aug-country-inst-card-title .scholarship_button {
	display: block;
	border: none;
	background: transparent;
	padding: 0;
	margin: 0 0 0.05rem;
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
	border-radius: 0;
	line-height: 1.35;
	text-align: left;
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
	max-width: 100%;
}

.nd-learning-aug-toolbar--country-card-only .nd-aug-country-inst-card-title:hover .scholarship_button {
	color: #1d4ed8;
}

.nd-learning-aug-toolbar--country-card-only
	.nd-aug-country-inst-card-title
	.scholarship_button.scholarship_country_selected {
	background: transparent;
	border: none;
	color: #0f172a;
}

.nd-learning-aug-toolbar--country-card-only
	.nd-aug-country-inst-card-title:hover
	.scholarship_button.scholarship_country_selected {
	color: #1d4ed8;
}

.nd-learning-aug-toolbar--country-card-only .nd-learning-aug-toolbar-input {
	width: 100%;
	flex: none;
}

.nd-learning-aug-toolbar-head {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin-bottom: 0.5rem;
}

.nd-learning-aug-toolbar-head--solo {
	gap: 0;
}

.nd-learning-aug-toolbar-head--solo .nd-learning-aug-toolbar-text {
	flex: 1;
	min-width: 0;
}

.nd-learning-aug-toolbar-icon {
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 8px;
	background: rgba(37, 99, 235, 0.08);
	color: #2563eb;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.05rem;
}

.nd-learning-aug-toolbar-icon svg {
	width: 1.1rem;
	height: 1.1rem;
	opacity: 0.92;
}

.nd-learning-aug-toolbar-text {
	min-width: 0;
	flex: 1;
}

.nd-learning-aug-toolbar-kicker {
	display: block;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(15, 23, 42, 0.45);
	margin-bottom: 0.15rem;
	line-height: 1.2;
}

.nd-learning-aug-toolbar-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.35;
}

.nd-learning-aug-toolbar-row {
	display: flex;
	align-items: stretch;
	gap: 0.45rem;
}

.nd-learning-aug-toolbar-field {
	position: relative;
	flex: 1;
	min-width: 0;
}

.nd-learning-aug-toolbar-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.62rem 0.75rem;
	font-size: 0.9375rem;
	line-height: 1.35;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 8px;
	background: #fff;
	color: #0f172a;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nd-learning-aug-toolbar-input:hover {
	border-color: rgba(15, 23, 42, 0.18);
}

.nd-learning-aug-toolbar-input:focus {
	outline: none;
	border-color: rgba(37, 99, 235, 0.45);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.nd-learning-aug-toolbar-input::placeholder {
	color: rgba(15, 23, 42, 0.38);
}

.nd-learning-aug-toolbar-clear {
	flex-shrink: 0;
	padding: 0.55rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	border: 1px solid rgba(15, 23, 42, 0.12);
	border-radius: 8px;
	background: #fff;
	color: #334155;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.nd-learning-aug-toolbar-clear:hover {
	background: #f1f5f9;
	border-color: rgba(15, 23, 42, 0.18);
}

.nd-learning-aug-toolbar-meta {
	margin-top: 0.45rem;
	font-size: 0.75rem;
	color: rgba(15, 23, 42, 0.5);
	line-height: 1.4;
	min-height: 1.15em;
}

.nd-learning-aug-toolbar-empty {
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	color: #b45309;
	display: none;
}

.nd-learning-aug-toolbar-empty.is-visible {
	display: block;
}

/* Table row hide (scholarship text filter) */
.scholarship_details tr.nd-learning-aug-sch-nomatch {
	display: none !important;
}

/* Sidebar institution rows */
#institution_list .aug_menu_arrow_preview.nd-learning-aug-inst-nomatch {
	display: none !important;
}

/* Match scholarship search bar width to the table below */
.nd-learning-aug-scholarship-search-host {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.nd-learning-aug-toolbar--scholarships {
	width: 100%;
	max-width: 100%;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 0.6rem;
}

.nd-learning-aug-toolbar--scholarships .nd-learning-aug-toolbar-head {
	margin-bottom: 0;
	flex: 0 1 auto;
	min-width: 0;
	align-items: center;
}

.nd-learning-aug-toolbar--scholarships .nd-learning-aug-toolbar-row {
	flex: 1 1 12rem;
	margin-bottom: 0;
	min-width: 0;
}

/* Scholarship table search: compact + institution name as main label (sidebar) */
.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact {
	padding: 0.5rem 0.65rem;
	margin-bottom: 0.75rem;
	flex-wrap: nowrap;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-head {
	flex: 0 1 auto;
	min-width: 0;
	max-width: none;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-icon {
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 6px;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-icon svg {
	width: 0.9rem;
	height: 0.9rem;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-kicker {
	font-size: 0.58rem;
	margin-bottom: 0.05rem;
	letter-spacing: 0.07em;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-label {
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.25;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-input {
	padding: 0.45rem 0.6rem;
	font-size: 0.8125rem;
	border-radius: 6px;
}

.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-clear {
	padding: 0.4rem 0.55rem;
	font-size: 0.75rem;
	border-radius: 6px;
}

@media (max-width: 520px) {
	.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact {
		flex-wrap: wrap;
	}

	.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-head {
		max-width: 100%;
		flex: 1 1 100%;
	}

	.nd-learning-aug-toolbar--scholarships.nd-learning-aug-toolbar--sch-compact .nd-learning-aug-toolbar-row {
		flex: 1 1 100%;
	}
}
