/**
 * LLMS Remote Courses - Frontend Styles
 *
 * All selectors prefixed with .llms-rc- to prevent conflicts.
 * Matches the reference card design: gradient image overlay, centered content,
 * colored badges overlaying the bottom of the image.
 */

/* =========================================================================
   RESET — Prevent theme interference
   ========================================================================= */
.llms-rc-grid,
.llms-rc-grid *,
.llms-rc-grid *::before,
.llms-rc-grid *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* =========================================================================
   GRID LAYOUT
   ========================================================================= */
.llms-rc-grid {
	display: grid;
	grid-template-columns: repeat(var(--llms-rc-cols, 3), 1fr);
	gap: 28px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
}

@media (max-width: 1024px) {
	.llms-rc-grid {
		grid-template-columns: repeat(var(--llms-rc-cols-tablet, 2), 1fr);
		gap: 20px;
	}
}

@media (max-width: 640px) {
	.llms-rc-grid {
		grid-template-columns: repeat(var(--llms-rc-cols-mobile, 1), 1fr);
		gap: 16px;
	}
}

/* =========================================================================
   COURSE CARD
   ========================================================================= */
.llms-rc-course-card {
	background: #ffffff;
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- Card style: shadow (default, matches reference) --- */
.llms-rc-style-shadow .llms-rc-course-card {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
}
.llms-rc-style-shadow .llms-rc-course-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* --- Card style: border --- */
.llms-rc-style-border .llms-rc-course-card {
	border: 1.5px solid #e5e7eb;
}
.llms-rc-style-border .llms-rc-course-card:hover {
	border-color: #7c3aed;
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(124, 58, 237, 0.1);
}

/* --- Card style: flat --- */
.llms-rc-style-flat .llms-rc-course-card {
	border-radius: 10px;
	background: #f9fafb;
}
.llms-rc-style-flat .llms-rc-course-card:hover {
	background: #f3f0ff;
}

/* =========================================================================
   IMAGE WRAPPER — with gradient overlay
   ========================================================================= */
.llms-rc-card-image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	flex-shrink: 0;
}

/* Dark gradient overlay at the bottom of the image (like reference design) */
.llms-rc-card-image-wrap::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 55%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 100%);
	z-index: 1;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.llms-rc-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.llms-rc-course-card:hover .llms-rc-card-img {
	transform: scale(1.05);
}

/* Placeholder when no image */
.llms-rc-card-img-placeholder {
	background: linear-gradient(135deg, #ede9fe 0%, #e0f2fe 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #a78bfa;
}
.llms-rc-card-img-placeholder svg {
	width: 56px;
	height: 56px;
	opacity: 0.5;
}

/* =========================================================================
   BADGES — positioned over the gradient at bottom-right of image
   ========================================================================= */
.llms-rc-badge-wrap {
	position: absolute;
	bottom: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-end;
	z-index: 2;
}

.llms-rc-badge {
	display: inline-block;
	padding: 5px 16px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.3px;
	line-height: 1.3;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Difficulty badge — red/coral (matches reference) */
.llms-rc-badge-diff {
	background: #ef4444;
	color: #ffffff;
}

/* Track badge — green (matches reference) */
.llms-rc-badge-track {
	background: #22c55e;
	color: #ffffff;
}

/* =========================================================================
   CARD LINK (wraps the image area)
   ========================================================================= */
.llms-rc-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}
.llms-rc-card-link:hover,
.llms-rc-card-link:focus {
	text-decoration: none;
	color: inherit;
}

/* =========================================================================
   CARD CONTENT — centered layout like reference
   ========================================================================= */
.llms-rc-card-content {
	padding: 18px 20px 22px;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	flex: 1;
}

/* Meta pills (e.g. "13 Lessons", "5 Hours") — outlined, centered */
.llms-rc-card-meta-pills {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	margin-bottom: 12px;
}

.llms-rc-meta-pill {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 500;
	border: 1.5px solid #d1d5db;
	color: #6b7280;
	background: transparent;
	line-height: 1.4;
}

/* Second pill gets a green accent */
.llms-rc-meta-pill:nth-child(2) {
	border-color: #86efac;
	color: #16a34a;
}

/* =========================================================================
   TITLE — centered, clean
   ========================================================================= */
.llms-rc-card-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 10px;
	color: #111827;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
	width: 100%;
}

.llms-rc-card-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.2s ease;
}

.llms-rc-card-title a:hover {
	color: #7c3aed;
}

/* =========================================================================
   EXCERPT — centered
   ========================================================================= */
.llms-rc-card-excerpt {
	font-size: 13px;
	line-height: 1.6;
	color: #6b7280;
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-align: center;
}

/* =========================================================================
   "SEE MORE" LINK — centered, matches reference style
   ========================================================================= */
.llms-rc-see-more {
	margin-top: auto;
	display: inline-block;
	font-size: 14px;
	font-weight: 500;
	color: #6b7280;
	text-decoration: none;
	padding-top: 4px;
	transition: color 0.2s ease;
	letter-spacing: 0.2px;
}

.llms-rc-see-more:hover {
	color: #7c3aed;
	text-decoration: none;
}

/* =========================================================================
   ERROR / EMPTY STATES
   ========================================================================= */
.llms-rc-error,
.llms-rc-no-courses {
	padding: 24px;
	background: #fef2f2;
	border: 1px solid #fca5a5;
	border-radius: 10px;
	color: #991b1b;
	font-size: 14px;
	text-align: center;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.llms-rc-no-courses {
	background: #f9fafb;
	border-color: #e5e7eb;
	color: #6b7280;
}
