/* EduMentor Majors – front-end styles (scoped to .emj) */

.emj {
	--emj-red: #b23031;
	--emj-red-2: #c74143;
	--emj-red-soft: #fbeeee;
	--emj-teal: #023f4d;
	--emj-teal-2: #156072;
	--emj-teal-soft: #eef5f7;
	--emj-orange: #ef7d16;
	--emj-orange-soft: #fff4ea;
	--emj-green: #157f4b;
	--emj-green-soft: #e8f6ee;
	--emj-ink: #16252b;
	--emj-muted: #5f6f78;
	--emj-line: #e3e9ec;
	--emj-surface: #ffffff;
	--emj-radius: 20px;
	--emj-shadow: 0 10px 30px rgba(2, 63, 77, 0.08);
	--emj-shadow-hover: 0 18px 40px rgba(2, 63, 77, 0.14);
	--emj-columns: 3;

	color: var(--emj-ink);
	font-family: inherit;
	line-height: 1.5;
	margin: 0 auto;
	max-width: 1280px;
}

.emj *,
.emj *::before,
.emj *::after {
	box-sizing: border-box;
}

.emj-icon {
	width: 1em;
	height: 1em;
	flex-shrink: 0;
}

.emj-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Filter bar ---------- */

.emj-filters {
	background: var(--emj-surface);
	border: 1px solid var(--emj-line);
	border-radius: var(--emj-radius);
	box-shadow: var(--emj-shadow);
	padding: 24px;
	margin: 0 0 32px;
}

.emj-filters__top {
	display: flex;
	gap: 12px;
	align-items: stretch;
}

.emj-search {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	margin: 0;
}

.emj-search > .emj-icon {
	position: absolute;
	left: 18px;
	color: var(--emj-teal-2);
	font-size: 20px;
	pointer-events: none;
}

.emj .emj-search input[type="search"] {
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 20px 0 52px;
	border: 1.5px solid var(--emj-line);
	border-radius: 999px;
	background: #f7f9fa;
	color: var(--emj-ink);
	font: inherit;
	font-size: 16px;
	box-shadow: none;
	outline: none;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.emj .emj-search input[type="search"]:focus {
	background: #fff;
	border-color: var(--emj-red);
	box-shadow: 0 0 0 4px rgba(178, 48, 49, 0.12);
}

.emj-filters__toggle {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 0 18px;
	border: 1.5px solid var(--emj-line);
	border-radius: 999px;
	background: #fff;
	color: var(--emj-teal);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.emj-filters__toggle .emj-icon {
	font-size: 18px;
}

.emj-badge-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--emj-red);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
}

.emj-badge-count[hidden] {
	display: none;
}

.emj-filters__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
	margin-top: 20px;
}

.emj-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	min-width: 0;
}

.emj-field__label {
	color: var(--emj-teal);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.emj-select {
	position: relative;
	display: block;
}

.emj-select::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--emj-teal-2);
	border-bottom: 2px solid var(--emj-teal-2);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.emj .emj-select select {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 40px 0 16px;
	border: 1.5px solid var(--emj-line);
	border-radius: 14px;
	background: #fff;
	color: var(--emj-ink);
	font: inherit;
	font-size: 15px;
	text-overflow: ellipsis;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	box-shadow: none;
	outline: none;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.emj .emj-select select:hover {
	border-color: #c9d4d9;
}

.emj .emj-select select:focus {
	border-color: var(--emj-red);
	box-shadow: 0 0 0 4px rgba(178, 48, 49, 0.12);
}

.emj-filters__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px dashed var(--emj-line);
}

.emj-count {
	margin: 0;
	color: var(--emj-muted);
	font-size: 15px;
	font-weight: 500;
}

.emj-filters__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.emj-sort {
	margin: 0;
}

.emj .emj-select--compact select {
	height: 44px;
	min-width: 200px;
	border-radius: 999px;
	font-size: 14px;
}

.emj .emj-reset {
	height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--emj-red), var(--emj-red-2));
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(178, 48, 49, 0.25);
	transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.emj .emj-reset:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(178, 48, 49, 0.3);
}

.emj .emj-reset:disabled {
	opacity: 0.45;
	cursor: default;
	box-shadow: none;
}

/* ---------- Searchable dropdown (JS-enhanced select) ---------- */

.emj-select--enhanced::after {
	display: none;
}

.emj .emj-select--enhanced select.emj-native {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	pointer-events: none;
}

.emj .emj-dd__button {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 42px 0 16px;
	border: 1.5px solid var(--emj-line);
	border-radius: 14px;
	background: #fff;
	color: var(--emj-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	text-align: start;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.emj .emj-dd__button::after {
	content: "";
	position: absolute;
	right: 17px;
	top: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--emj-teal-2);
	border-bottom: 2px solid var(--emj-teal-2);
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.2s;
}

.emj .emj-dd__button:hover {
	border-color: #c9d4d9;
	background: #fff;
	color: var(--emj-ink);
}

.emj .emj-dd__button:focus-visible,
.emj .emj-select--enhanced.is-open .emj-dd__button {
	outline: none;
	border-color: var(--emj-red);
	box-shadow: 0 0 0 4px rgba(178, 48, 49, 0.12);
}

.emj .emj-select--enhanced.is-open .emj-dd__button::after {
	transform: translateY(-25%) rotate(-135deg);
}

/* A chosen filter value stands out */
.emj .emj-select--enhanced.is-filled .emj-dd__button {
	border-color: rgba(2, 63, 77, 0.35);
	background: var(--emj-teal-soft);
	color: var(--emj-teal);
	font-weight: 600;
}

.emj-dd__value {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.emj .emj-select--compact .emj-dd__button {
	height: 44px;
	min-width: 200px;
	border-radius: 999px;
	font-size: 14px;
}

.emj-dd__panel {
	position: absolute;
	z-index: 60;
	top: calc(100% + 8px);
	left: 0;
	width: 100%;
	min-width: 240px;
	padding: 8px;
	background: #fff;
	border: 1px solid var(--emj-line);
	border-radius: 16px;
	box-shadow: 0 18px 44px rgba(2, 63, 77, 0.18), 0 2px 6px rgba(2, 63, 77, 0.06);
	animation: emj-pop 0.14s ease-out;
}

.emj-dd__panel[hidden] {
	display: none;
}

.emj-select--enhanced.is-right .emj-dd__panel {
	left: auto;
	right: 0;
}

.emj-select--enhanced.is-up .emj-dd__panel {
	top: auto;
	bottom: calc(100% + 8px);
}

@keyframes emj-pop {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
}

.emj-dd__search {
	position: relative;
	margin-bottom: 6px;
}

.emj-dd__search[hidden] {
	display: none;
}

.emj-dd__search svg {
	position: absolute;
	left: 12px;
	top: 50%;
	width: 16px;
	height: 16px;
	transform: translateY(-50%);
	color: var(--emj-teal-2);
	pointer-events: none;
}

.emj .emj-dd__search input {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 12px 0 36px;
	border: 1.5px solid var(--emj-line);
	border-radius: 10px;
	background: #f7f9fa;
	color: var(--emj-ink);
	font: inherit;
	font-size: 14px;
	box-shadow: none;
	outline: none;
}

.emj .emj-dd__search input:focus {
	border-color: var(--emj-teal-2);
	background: #fff;
}

.emj .emj-dd__list {
	max-height: 260px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	outline: none;
	scrollbar-width: thin;
	scrollbar-color: #cfd9de transparent;
}

.emj .emj-dd__option {
	position: relative;
	margin: 0;
	padding: 9px 34px 9px 12px;
	border-radius: 9px;
	color: var(--emj-ink);
	font-size: 14px;
	line-height: 1.35;
	cursor: pointer;
}

.emj .emj-dd__option[hidden] {
	display: none;
}

.emj .emj-dd__option.is-active {
	background: var(--emj-teal-soft);
}

.emj .emj-dd__option[aria-selected="true"] {
	color: var(--emj-red);
	font-weight: 600;
}

.emj .emj-dd__option[aria-selected="true"]::after {
	content: "";
	position: absolute;
	right: 14px;
	top: 50%;
	width: 5px;
	height: 10px;
	border-right: 2px solid var(--emj-red);
	border-bottom: 2px solid var(--emj-red);
	transform: translateY(-65%) rotate(45deg);
}

.emj-dd__empty {
	margin: 0;
	padding: 14px 12px;
	color: var(--emj-muted);
	font-size: 14px;
	text-align: center;
}

.emj-dd__empty[hidden] {
	display: none;
}

/* ---------- Results ---------- */

.emj-results {
	position: relative;
	transition: opacity 0.2s;
}

.emj.is-loading .emj-results {
	opacity: 0.45;
	pointer-events: none;
}

.emj.is-loading .emj-results::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 80px;
	width: 42px;
	height: 42px;
	margin-left: -21px;
	border: 4px solid var(--emj-teal-soft);
	border-top-color: var(--emj-red);
	border-radius: 50%;
	animation: emj-spin 0.8s linear infinite;
}

@keyframes emj-spin {
	to {
		transform: rotate(360deg);
	}
}

.emj-grid {
	display: grid;
	grid-template-columns: repeat(var(--emj-columns), minmax(0, 1fr));
	gap: 24px;
}

/* ---------- Card ---------- */

.emj-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px 22px 22px;
	background: var(--emj-surface);
	border: 1px solid var(--emj-line);
	border-radius: var(--emj-radius);
	box-shadow: var(--emj-shadow);
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.emj-card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: linear-gradient(90deg, var(--emj-teal), var(--emj-teal-2) 45%, var(--emj-red));
	opacity: 0;
	transition: opacity 0.2s;
}

.emj-card:hover {
	transform: translateY(-4px);
	border-color: rgba(178, 48, 49, 0.25);
	box-shadow: var(--emj-shadow-hover);
}

.emj-card:hover::before {
	opacity: 1;
}

.emj-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.emj-badge {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.emj-badge--lang {
	background: var(--emj-teal);
	color: #fff;
}

.emj-badge--degree {
	background: var(--emj-orange);
	color: #fff;
}

.emj .emj-card__title {
	margin: 0;
	color: var(--emj-ink);
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.emj-card__uni {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 14px;
	background: #f4f7f8;
	border: 1px solid #edf1f3;
}

.emj .emj-card__logo {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	object-fit: contain;
	border-radius: 10px;
	background: #fff;
	padding: 3px;
	border: 1px solid var(--emj-line);
}

.emj-card__logo--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--emj-teal-2);
	font-size: 18px;
}

.emj-card__uni-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.emj-card__uni-name {
	color: var(--emj-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
}

.emj-card__uni-type {
	color: var(--emj-red);
	font-size: 12px;
	font-weight: 600;
}

.emj .emj-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	color: var(--emj-muted);
	font-size: 14px;
}

.emj .emj-card__meta li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}

.emj-card__meta .emj-icon {
	color: var(--emj-teal-2);
	font-size: 16px;
}

.emj-card__foot {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: auto;
}

/* Prices */

.emj-price {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border: 2px solid var(--emj-orange);
	border-radius: 14px;
	background: var(--emj-orange-soft);
}

.emj-price__label {
	color: var(--emj-muted);
	font-size: 13px;
	font-weight: 600;
}

.emj-price__value {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px;
}

.emj-price__value del {
	color: #9aa6ad;
	font-size: 14px;
}

.emj-price__value strong {
	color: var(--emj-orange);
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
}

.emj-price__value small {
	color: var(--emj-muted);
	font-size: 12px;
}

.emj .emj-fees {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

.emj .emj-fees li,
.emj .emj-plan li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 4px 0;
}

.emj-fees li span {
	color: var(--emj-muted);
}

.emj-fees li b {
	color: var(--emj-teal);
}

.emj-plan {
	padding: 14px 16px;
	border-radius: 14px;
	background: var(--emj-teal-soft);
	border: 1px solid #dbe9ee;
}

.emj-plan__title {
	display: block;
	margin-bottom: 4px;
	color: var(--emj-teal);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.emj .emj-plan ul {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

.emj-plan li span {
	color: var(--emj-muted);
}

.emj-plan li b {
	color: var(--emj-teal);
}

.emj-plan li b.emj-plan__old {
	color: #8b989f;
	text-decoration: line-through;
	font-weight: 600;
}

.emj-plan li.emj-plan__main span {
	color: var(--emj-ink);
	font-weight: 600;
}

.emj-plan li.emj-plan__main b {
	color: var(--emj-red);
	font-size: 18px;
	font-weight: 800;
}

.emj-plan__save {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	padding: 8px 12px;
	border-radius: 10px;
	background: var(--emj-green-soft);
	color: var(--emj-green);
	font-size: 14px;
	font-weight: 600;
}

.emj-plan__save .emj-icon {
	font-size: 16px;
}

.emj-plan__save b {
	margin-left: auto;
	font-weight: 800;
}

/* Button */

.emj .emj-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 50px;
	padding: 0 20px;
	border-radius: 14px;
	background: linear-gradient(135deg, var(--emj-teal), var(--emj-teal-2));
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	transition: transform 0.15s, box-shadow 0.15s;
}

.emj .emj-card__cta:hover,
.emj .emj-card__cta:focus {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(2, 63, 77, 0.28);
}

/* Empty state */

.emj-empty {
	padding: 56px 24px;
	text-align: center;
	color: var(--emj-muted);
	background: var(--emj-surface);
	border: 1px dashed #cfd9de;
	border-radius: var(--emj-radius);
}

.emj-empty .emj-icon {
	font-size: 40px;
	color: var(--emj-teal-2);
	margin-bottom: 8px;
}

.emj-empty p {
	margin: 0;
	font-size: 16px;
}

/* Pagination */

.emj-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 36px;
}

.emj .emj-page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border: 1.5px solid var(--emj-line);
	border-radius: 12px;
	background: #fff;
	color: var(--emj-teal);
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.emj a.emj-page:hover {
	border-color: var(--emj-red);
	color: var(--emj-red);
}

.emj .emj-page.is-current {
	border-color: transparent;
	background: linear-gradient(135deg, var(--emj-red), var(--emj-red-2));
	color: #fff;
}

.emj .emj-page--gap {
	border-color: transparent;
	background: transparent;
	min-width: 24px;
	padding: 0;
}

.emj--error,
.emj-notice {
	padding: 16px 20px;
	border-radius: 12px;
	background: var(--emj-red-soft, #fbeeee);
	color: #8a2526;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.emj-grid {
		grid-template-columns: repeat(min(var(--emj-columns), 2), minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.emj-filters {
		padding: 16px;
		border-radius: 18px;
		margin-bottom: 24px;
	}

	.emj .emj-search input[type="search"] {
		height: 50px;
		font-size: 16px;
	}

	.emj-filters__toggle {
		display: inline-flex;
	}

	.emj-filters__grid {
		display: none;
		grid-template-columns: 1fr;
		gap: 12px;
		margin-top: 16px;
	}

	.emj-filters.is-open .emj-filters__grid {
		display: grid;
	}

	.emj-filters__footer {
		flex-direction: column;
		align-items: stretch;
	}

	.emj-filters__actions {
		display: grid;
		grid-template-columns: 1fr auto;
	}

	.emj .emj-select--compact select,
	.emj .emj-select--compact .emj-dd__button {
		min-width: 0;
	}

	.emj .emj-dd__list {
		max-height: min(260px, 45vh);
	}

	.emj-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.emj-card {
		padding: 20px 18px 18px;
	}

	.emj .emj-card__title {
		font-size: 18px;
	}

	.emj .emj-page {
		min-width: 40px;
		height: 40px;
	}

	.emj .emj-page--nav {
		flex-basis: calc(50% - 4px);
		order: 2;
	}
}

@media (max-width: 480px) {
	/* Icon-only filter button so the search field keeps its width */
	.emj-filters__toggle {
		padding: 0 14px;
	}

	.emj-filters__toggle > span:not(.emj-badge-count) {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.emj .emj-search input[type="search"] {
		padding-left: 46px;
	}

	.emj-search > .emj-icon {
		left: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.emj-card,
	.emj .emj-reset,
	.emj .emj-card__cta {
		transition: none;
	}

	.emj-card:hover {
		transform: none;
	}
}
