/* Extracted from new/templ/component/course_listing.templ (templ CourseListing) */
.course-card-modern {
	background: #fff;
	border-radius: 28px;
	overflow: hidden;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
	border: 1px solid #e8eef5;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px -18px rgba(15, 23, 42, 0.12);
	position: relative;
	z-index: 1;
}
.course-card-modern:hover {
	transform: translateY(-8px);
	box-shadow: 0 6px 12px -6px rgba(15, 23, 42, 0.08), 0 28px 48px -18px rgba(0, 140, 255, 0.28);
	border-color: rgba(0, 140, 255, 0.35);
}
/* Inside a gutter-managed grid the card's own mb-4 would double the row gap
   (and pad out the bottom of the section), and cards in the same row should
   share a height with their footers pinned to the bottom edge - otherwise a
   one-line title leaves a visibly shorter card next to a two-line one. */
.courses-grid .course-card-modern {
	height: 100%;
	margin-bottom: 0 !important;
}
.courses-grid .card-content-wrapper {
	height: 100%;
	display: flex;
	flex-direction: column;
}
.courses-grid .banner-area {
	flex-shrink: 0;
}
.courses-grid .body-area {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}
.courses-grid .body-area .footer-area {
	margin-top: auto;
}
.banner-area {
	height: 160px;
	position: relative;
	overflow: hidden;
}
/* Depth gradient so white card chrome always reads over busy banner photos. */
.banner-area::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, transparent 30%, transparent 55%, rgba(15, 23, 42, 0.28) 100%);
	pointer-events: none;
	z-index: 2;
}
.banner-area .course-banner-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.course-card-modern:hover .course-banner-img {
	transform: scale(1.1);
}
.bookmark-overlay {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 5;
}
.bookmark-star {
	position: relative;
	width: 42px;
	height: 42px;
	padding: 0;
	border: none;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(15, 23, 42, 0.35);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.25);
	cursor: pointer;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease;
	-webkit-tap-highlight-color: transparent;
}
.bookmark-star:hover {
	transform: scale(1.12);
	background: rgba(15, 23, 42, 0.5);
}
.bookmark-star:active {
	transform: scale(0.9);
}
.bookmark-star .star-icon {
	width: 20px;
	height: 20px;
	fill: transparent;
	stroke: #fff;
	stroke-width: 1.8;
	stroke-linejoin: round;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
	transition: fill 0.25s ease, stroke 0.25s ease, transform 0.25s ease;
}
.bookmark-star.is-saved {
	background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
	box-shadow: 0 4px 16px rgba(245, 158, 11, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.bookmark-star.is-saved:hover {
	background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
}
.bookmark-star.is-saved .star-icon {
	fill: #fff;
	stroke: #fff;
}
.bookmark-star.just-saved .star-icon {
	animation: star-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes star-pop {
	0% { transform: scale(1); }
	35% { transform: scale(1.4) rotate(-14deg); }
	65% { transform: scale(0.85) rotate(8deg); }
	100% { transform: scale(1); }
}
.star-sparkles {
	position: absolute;
	inset: 0;
	pointer-events: none;
}
.star-sparkles span {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #fde68a;
	opacity: 0;
}
.star-sparkles span:nth-child(1) { --fly-x: 26px; --fly-y: -8px; }
.star-sparkles span:nth-child(2) { --fly-x: 16px; --fly-y: -22px; background: #fff; }
.star-sparkles span:nth-child(3) { --fly-x: -10px; --fly-y: -26px; }
.star-sparkles span:nth-child(4) { --fly-x: -24px; --fly-y: -12px; background: #fff; }
.star-sparkles span:nth-child(5) { --fly-x: -20px; --fly-y: 16px; }
.star-sparkles span:nth-child(6) { --fly-x: 14px; --fly-y: 24px; background: #fff; }
.bookmark-star.just-saved .star-sparkles span {
	animation: sparkle-fly 0.6s ease-out forwards;
}
@keyframes sparkle-fly {
	0% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(0.4);
	}
	100% {
		opacity: 0;
		transform: translate(calc(-50% + var(--fly-x)), calc(-50% + var(--fly-y))) scale(1);
	}
}
.card-content-wrapper {
	position: relative;
}
/* Anchored to the card wrapper (not .banner-area, whose overflow: hidden
   would clip the part hanging below the 160px banner). */
.icon-badge-modern {
	position: absolute;
	top: 115px;
	left: 25px;
	width: 70px;
	height: 70px;
	background: #fff;
	border-radius: 20px;
	padding: 8px;
	box-shadow: 0 10px 20px -6px rgba(15, 23, 42, 0.18), 0 0 0 4px #fff;
	border: 1px solid #eef2f6;
	z-index: 5;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* The chip hangs ~30px below the banner; push the body down so the
   qualification pills clear it (p-4 is !important, hence the override). */
.icon-badge-modern + .body-area {
	padding-top: 44px !important;
}
.course-card-modern:hover .icon-badge-modern {
	transform: translateY(-3px) rotate(-3deg) scale(1.05);
}
.icon-badge-modern img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	/* Many course icons ship with their own white rounded square baked into
	   the bitmap; rounding the img keeps that inner square's corners from
	   clashing with the chip's. */
	border-radius: 13px;
}
/* Dark theme: a translucent white ring reads as a muddy grey halo on dark
   cards - ring with the card surface colour instead so the white chip looks
   cleanly cut out of the card. */
html[data-theme="dark"] .icon-badge-modern {
	border-color: rgba(255, 255, 255, 0.14);
	box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.6), 0 0 0 4px var(--tt-surface, #111a2e);
}
/* Phones: slightly smaller chip, raised so it straddles the banner edge and
   clears the qualification pills at the top of the card body. */
@media (max-width: 575.98px) {
	.icon-badge-modern {
		width: 58px;
		height: 58px;
		top: 122px;
		left: 20px;
		border-radius: 16px;
		padding: 6px;
	}
	.icon-badge-modern + .body-area {
		padding-top: 36px !important;
	}
	.icon-badge-modern img {
		border-radius: 11px;
	}
}
.course-banner-fallback {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
	transition: transform 0.5s ease;
}
.course-card-modern:hover .course-banner-fallback {
	transform: scale(1.05);
}
.fallback-blob {
	position: absolute;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
}
.fallback-blob.blob-1 {
	width: 180px;
	height: 180px;
	top: -70px;
	left: -40px;
}
.fallback-blob.blob-2 {
	width: 120px;
	height: 120px;
	bottom: -50px;
	right: 90px;
	background: rgba(255, 255, 255, 0.08);
}
.fallback-blob.blob-3 {
	width: 60px;
	height: 60px;
	top: 25px;
	right: 40%;
	background: rgba(255, 255, 255, 0.1);
}
.fallback-banner-icon {
	position: absolute;
	right: 24px;
	bottom: 18px;
	font-size: 4.5rem;
	color: rgba(255, 255, 255, 0.35);
	transform: rotate(-8deg);
}
.fallback-banner-watermark {
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-55%);
	font-size: 7rem;
	font-weight: 900;
	line-height: 1;
	color: rgba(255, 255, 255, 0.18);
	user-select: none;
}
.icon-fallback {
	width: 100%;
	height: 100%;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 1.35rem;
}
.course-title-modern {
	font-size: 1.5rem;
	letter-spacing: -0.02em;
}
.fw-black { font-weight: 900; }
.letter-spacing-1 { letter-spacing: 0.05em; }

.bg-primary-subtle { background-color: #e0f2fe; }
.text-primary { color: #0284c7 !important; }

/* Meta badges */
.course-card-modern .meta-tags .badge {
	font-size: 0.68rem;
	letter-spacing: 0.06em;
}
.course-card-modern .meta-tags .badge.bg-light {
	background: #f8fafc !important;
	border-color: #e2e8f0 !important;
	color: #475569 !important;
}
.course-card-modern .meta-tags .badge.bg-primary-subtle {
	background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%) !important;
	border-color: #bae6fd !important;
}

/* Progress */
.course-progress-fill {
	background: linear-gradient(90deg, #38bdf8 0%, #008cff 100%);
	transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* Practice button */
.course-card-modern .action-btns .btn-primary {
	background: linear-gradient(135deg, #00a2ff 0%, #0070e0 100%);
	border: none;
	box-shadow: 0 8px 18px -8px rgba(0, 140, 255, 0.55) !important;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.course-card-modern .action-btns .btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 26px -10px rgba(0, 140, 255, 0.65) !important;
}
.course-card-modern .action-btns .btn-primary i {
	transition: transform 0.25s ease;
}
.course-card-modern .action-btns .btn-primary:hover i {
	transform: translateX(3px);
}

/* Dark theme: the qualification / exam-board / class pills and the progress
   track are hard-coded light (white, #eef2ff, #f1f5f9) and glare on a dark
   card. Inline styles on the class pill and progress track need !important. */
html[data-theme="dark"] .course-card-modern .meta-tags .badge.bg-light {
	background: var(--tt-surface-2, #17233b) !important;
	border-color: var(--tt-line-strong, #33436a) !important;
	color: var(--tt-ink, #e6ebf5) !important;
}
html[data-theme="dark"] .course-card-modern .meta-tags .badge.bg-primary-subtle {
	background: rgba(56, 182, 255, 0.14) !important;
	border-color: rgba(56, 182, 255, 0.35) !important;
	color: #7dcbff !important;
}
html[data-theme="dark"] .course-card-modern .body-area .badge[style*="eef2ff"] {
	background: rgba(129, 140, 248, 0.16) !important;
	border-color: rgba(129, 140, 248, 0.35) !important;
	color: #a5b4fc !important;
}
html[data-theme="dark"] .course-card-modern .progress-info .progress {
	background: var(--tt-surface-3, #1e2c48) !important;
}
html[data-theme="dark"] .course-card-modern .progress-info .text-primary {
	color: #7dcbff !important;
}
