/**
 * Workshop Card Component Styles
 *
 * @package HTA\LiveEvent\Public\Components\WorkshopCard
 */

/* Base Card */
.hta-workshop-card {
	background: #FFFFFF;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	position: relative;
	width: 100%;
	max-width: 360px;
	margin: 0 auto;
	height: 100%; /* Ensure cards stretch to same height in grid */
}

.hta-workshop-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

/* Media Area */
.hta-workshop-card__media {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 aspect ratio */
	overflow: hidden;
	background: #f0f0f0;
	border-radius: 12px 12px 0 0;
	flex-shrink: 0; /* Prevent from shrinking */
}

.hta-workshop-card__media-link {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: block;
	overflow: hidden;
	margin: 0;
	padding: 0;
}

.hta-workshop-card__image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.3s ease;
	margin: 0;
	padding: 0;
	vertical-align: top;
}

.hta-workshop-card:hover .hta-workshop-card__image {
	transform: scale(1.02);
}

.hta-workshop-card__image-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
	display: block;
}

/* Status Badge (Top-left overlaying image) */
.hta-workshop-card__badge--status {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(0, 0, 0, 0.75);
	color: #FFFFFF;
	min-width: 110px;
	height: 28px;
	padding: 0 12px;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	z-index: 10;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	backdrop-filter: blur(4px);
	white-space: nowrap;
	box-sizing: border-box;
	line-height: 28px;
	text-align: center;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Status-specific background colors */
.hta-workshop-card__badge--status[data-status="new"] {
	background-color: #55D6AB;
	color: #000000;
}

.hta-workshop-card__badge--status[data-status="canceled"] {
	background-color: #FF5757;
	color: #FFFFFF;
}

.hta-workshop-card__badge--status[data-status="passed"] {
	background-color: #E76E3C;
	color: #FFFFFF;
}

.hta-workshop-card__badge--status[data-status="waitlist"] {
	background-color: #FFDE59;
	color: #000000;
}

.hta-workshop-card__badge--status[data-status="coming-soon"] {
	background-color: #3b82f6;
	color: #FFFFFF;
}

.hta-workshop-card__badge--status[data-status="registration-closed"] {
	background-color: #6b7280;
	color: #FFFFFF;
}

.hta-workshop-card__badge--status[data-status="free"] {
	background-color: #22c55e;
	color: #FFFFFF;
}

.hta-workshop-card__badge--status[data-status="paid"] {
	background-color: #8b5cf6;
	color: #FFFFFF;
}

/* Post Type Row with Favorite/Share Buttons */
.hta-workshop-card__post-type-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	gap: 8px;
	flex-shrink: 0; /* Prevent from shrinking */
}

.hta-workshop-card__post-type {
	font-size: 11px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	border-radius: 0;
	padding: 4px 8px;
}

/* Post type background colors based on post type */
.hta-workshop-card[data-post-type="hta_live_event"] .hta-workshop-card__post-type {
	background-color: #FFDE59;
}

.hta-workshop-card[data-post-type="hta_ssc"] .hta-workshop-card__post-type,
.hta-workshop-card[data-post-type="hta_self_study_course"] .hta-workshop-card__post-type {
	background-color: #5CE1E6;
}

.hta-workshop-card[data-post-type="live_training_course"] .hta-workshop-card__post-type {
	background-color: #E76E3C;
}

.hta-workshop-card__post-type-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hta-workshop-card__language-flags {
	display: flex;
	align-items: center;
	gap: 4px;
}

.hta-workshop-card__language-flag {
	width: 20px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid #EDEDED;
	flex-shrink: 0;
}

/* Video Like Share (reused from custom-videos-plugin) */
.video-like-share {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-left: auto;
	margin-right: 0 !important;
}

/* Like Button (reused from custom-videos-plugin) */
.like-button {
	width: 24px;
	height: 24px;
	background: url('https://happyteachersacademy.com/community/wp-content/uploads/sites/2/2025/08/white.png') no-repeat center center;
	background-size: contain;
	background-color: transparent;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	outline: none;
	transition: all 0.3s ease;
}

.like-button:hover {
	transform: scale(1.1);
}

.like-button.liked {
	background-image: url('https://happyteachersacademy.com/community/wp-content/uploads/sites/2/2025/08/red.png') !important;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: contain;
}

/* Share Button (reused from custom-videos-plugin) */
.share-button {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 18px;
	transition: color 0.3s;
	display: flex;
	align-items: center;
	padding: 0;
}

.share-button:hover {
	opacity: 0.8;
	transform: scale(1.1);
}

.share-button img {
	width: 24px;
	height: 24px;
	display: block;
	margin: auto;
}

/* Hover Toast (reused from custom-videos-plugin) */
.hover-toast {
	position: absolute;
	top: -35px;
	left: 50%;
	transform: translateX(-50%) translateY(10px);
	background-color: #092c7c;
	color: white;
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 11px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 1000;
}

.hover-toast::after {
	content: '';
	position: absolute;
	bottom: -5px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid #092c7c;
}

.hover-toast-wrapper:hover > .hover-toast {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Category and Language Row */
.hta-workshop-card__meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px;
	gap: 8px;
}

.hta-workshop-card__category {
	background: #FFD84D;
	color: #111;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	white-space: nowrap;
}

.hta-workshop-card__languages {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}

.hta-workshop-card__language-flag {
	width: 24px;
	height: 18px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid #EDEDED;
}

.hta-workshop-card__language-code {
	width: 28px;
	height: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #FFFFFF;
	border: 1px solid #D9D9D9;
	border-radius: 4px;
	font-size: 10px;
	font-weight: 600;
	color: #555;
}

/* Date and Time Row */
.hta-workshop-card__datetime {
	padding: 6px 12px;
	font-size: 12px;
	color: #555;
	line-height: 1.3;
}

/* Date/Time Display - Keep on same line */
.hta-workshop-card__datetime-display {
	padding: 6px 12px;
	font-size: 12px;
	color: #555;
	line-height: 1.3;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: nowrap;
	white-space: nowrap;
}

.hta-workshop-card__datetime-date,
.hta-workshop-card__datetime-time {
	white-space: nowrap;
	flex-shrink: 0;
}

/* Title */
.hta-workshop-card__title {
	margin: 0;
	padding: 12px 12px;
	font-size: 15px;
	font-weight: 700;
	color: #111;
	line-height: 1.3;
	flex-shrink: 0; /* Prevent title from shrinking */
}

.hta-workshop-card__title a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.2s ease;
}


/* Statistics Row */
.hta-workshop-card__stats {
	padding: 0 12px 8px;
	font-size: 11px;
	color: #666;
	line-height: 1.4;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin-bottom: 0;
	flex-shrink: 0; /* Prevent from shrinking */
}

.hta-workshop-card__stat-item {
	white-space: nowrap;
}

.hta-workshop-card__stat-divider {
	color: #999;
	margin: 0 4px;
}

/* Review and Members Row */
.hta-workshop-card__review-members-row {
	padding: 8px 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-shrink: 0; /* Prevent from shrinking */
}

/* When no members section exists, reduce padding and ensure stats stay close to title */
.hta-workshop-card__review-members-row--no-members {
	padding-top: 0;
	border-top: none;
}

/* Fallback: When no members section exists (using :has() for modern browsers) */
.hta-workshop-card__review-members-row:not(:has(.hta-card__members)) {
	padding-top: 0;
	border-top: none;
}

.hta-workshop-card__rating {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

/* Average Star Rating Display - TEMPORARILY HIDDEN */
.average-star-rating,
.hta-workshop-card__rating,
.avg-rating-label,
.review-count {
	display: none !important;
}

/* Average Star Rating Display */
.average-star-rating {
	display: flex;
	gap: 4px;
	align-items: center;
}

.average-star-rating img {
	width: 20px;
	height: 20px;
	object-fit: contain;
	display: block;
}

.hta-star-rating-img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}

.avg-rating-label {
	font-size: 12px;
	color: #666;
	font-weight: 600;
}

.review-count {
	font-size: 12px;
	color: #666;
}

/* Members Section (ht-card__members) */
.hta-card__members {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
	margin-left: auto;
}

.hta-card__member-avatars {
	display: flex;
	align-items: center;
	flex-direction: row;
	margin-left: 0;
	position: relative;
}

.hta-card__member-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50% !important;
	border: 2px solid #FFFFFF;
	margin-left: -12px;
	object-fit: cover;
	position: relative;
	background: #f0f0f0;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	display: block;
}

/* First avatar (leftmost) - highest z-index to overlap others */
.hta-card__member-avatar:first-child {
	margin-left: 0;
	z-index: 10;
}

/* Subsequent avatars - decreasing z-index so left overlaps right */
.hta-card__member-avatar:nth-child(2) {
	z-index: 9;
}

.hta-card__member-avatar:nth-child(3) {
	z-index: 8;
}

.hta-card__member-avatar:nth-child(4) {
	z-index: 7;
}

.hta-card__member-avatar:nth-child(5) {
	z-index: 6;
}

.hta-card__member-avatar:nth-child(6) {
	z-index: 5;
}

.hta-card__member-avatar:nth-child(n+7) {
	z-index: 4;
}

.hta-card__member-more {
	width: 36px;
	height: 36px;
	border-radius: 50% !important;
	background: #6B7280;
	color: #FFFFFF;
	border: 2px solid #FFFFFF;
	margin-left: -12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
	position: relative;
	z-index: 1; /* Lowest z-index - will be overlapped by avatars */
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.hta-card__member-count {
	font-size: 12px;
	color: #666;
	font-weight: 400;
	line-height: 1.4;
	text-align: right;
	white-space: nowrap;
	color: #555;
	position: relative;
	z-index: 1;
}

/* Price Section */
.hta-workshop-card__pricing {
	padding: 12px;
	margin-top: auto; /* Push pricing to bottom for equal height cards */
	flex-shrink: 0; /* Prevent from shrinking */
}

.hta-workshop-card__price-free {
	background: #8FD8B5;
	color: #111;
	padding: 8px 16px;
	border-radius: 8px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.hta-workshop-card__price-free--with-preview {
	justify-content: space-between;
}

.hta-workshop-card__price-free__left {
	display: flex;
	align-items: center;
	gap: 6px;
}

.hta-workshop-card__price-free__icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

/* Priceband Structure */
.hta-workshop-card__priceband {
	border-radius: 8px;
	background: #FFFFFF;
	padding: 10px;
	border: 1px solid #EDEDED;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.hta-workshop-card__priceband__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.hta-workshop-card__priceband__lock-icon,
.hta-workshop-card__price-free__icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

.hta-workshop-card__priceband__col {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.hta-workshop-card__priceband__col--right {
	align-items: flex-end;
	text-align: right;
}

.hta-workshop-card__priceband__price {
	font-size: 18px;
	font-weight: 700;
	color: #111;
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 6px;
}

.hta-workshop-card__priceband__lock-icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

.hta-workshop-card__priceband__price--old {
	font-size: 14px;
	color: #999;
	text-decoration: line-through;
	text-decoration-thickness: 1px;
	font-weight: 400;
	/* Keep flex for alignment, strikethrough works on flex containers with text content */
}

.hta-workshop-card__priceband__price--info {
	/* Empty state for right column when no sale */
	font-size: 16px;
	color: transparent;
}

.hta-workshop-card__priceband__note {
	font-size: 11px;
	color: #666;
	line-height: 1.3;
}

/* Preview button in priceband */
.hta-workshop-card__priceband__col--preview {
	align-items: flex-end;
	flex: 0 0 auto;
}

.hta-workshop-card__preview-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background-color: transparent;
	color: #000000;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.hta-workshop-card__preview-btn:hover {
	text-decoration: underline;
	color: #000000;
}

.hta-workshop-card__preview-icon {
	flex-shrink: 0;
}



.hta-workshop-card__priceband__access {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.hta-workshop-card__access-btn {
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
	font-weight: 600;
}

/* When user has access, ensure layout doesn't break */
.hta-workshop-card__priceband--has-access {
	/* Center content when showing "Access Now" */
	justify-content: center;
}

.hta-workshop-card__priceband--has-access .hta-workshop-card__priceband__col {
	/* Ensure proper flex behavior */
	flex: 1;
	display: flex;
	justify-content: center;
}

/* Legacy support - keep for backward compatibility */
.hta-workshop-card__price-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.hta-workshop-card__price-sale {
	font-size: 20px;
	font-weight: 700;
	color: #e76e3c;
}

.hta-workshop-card__price-base {
	font-size: 16px;
	color: #999;
	text-decoration: line-through;
}

.hta-workshop-card__price-current {
	font-size: 20px;
	font-weight: 700;
	color: #111;
}

/* Additional Badges */
.hta-workshop-card__badges {
	padding: 0 12px 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.hta-workshop-card__badge--waitlist {
	background: #f59e0b;
	color: #FFFFFF;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hta-workshop-card__badge--certificate {
	background: #4F46E5;
	color: #FFFFFF;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 968px) {
	.hta-workshop-card {
		max-width: 100%;
	}

	.hta-workshop-card__media {
		padding-top: 75%; /* 4:3 aspect ratio on tablet */
	}
}

@media (max-width: 768px) {
	.hta-workshop-card {
		max-width: 100%;
	}

	.hta-workshop-card__media {
		padding-top: 56.25%; /* Keep 16:9 so image fills without letterboxing */
		padding-right: 0;
		padding-bottom: 0;
		padding-left: 0;
		line-height: 0;
	}

	.hta-workshop-card__media-link,
	.hta-workshop-card__image {
		min-width: 100%;
		min-height: 100%;
	}

	.hta-workshop-card__badge--status {
		top: 8px;
		left: 8px;
		min-width: 100px;
		height: 24px;
		padding: 0 10px;
		font-size: 10px;
		border-radius: 6px;
		line-height: 24px;
	}

	.hta-workshop-card__actions {
		opacity: 1; /* Always show on mobile */
	}

	.hta-workshop-card__review-members-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.hta-card__members {
		align-items: flex-start;
		margin-left: 0;
	}

	.hta-card__member-avatars {
		flex-wrap: wrap;
		margin-left: 0;
	}

	.hta-card__member-avatar {
		margin-left: 0;
		margin-right: 4px;
		margin-bottom: 4px;
		width: 32px;
		height: 32px;
	}

	.hta-card__member-more {
		margin-left: 0;
		margin-right: 4px;
		margin-bottom: 4px;
		width: 32px;
		height: 32px;
		font-size: 10px;
	}

	.hta-workshop-card__priceband {
		flex-direction: column;
		gap: 12px;
	}

	.hta-workshop-card__priceband__col--right {
		align-items: flex-start;
		text-align: left;
	}

	.hta-workshop-card__priceband__price {
		font-size: 18px;
	}

	.hta-workshop-card__priceband__price--old {
		font-size: 14px;
	}

	.hta-workshop-card__priceband__note {
		font-size: 11px;
	}
}

/* Loading/Skeleton State */
.hta-workshop-card--loading .hta-workshop-card__image {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}

/* Accessibility */
.hta-workshop-card__action:focus,
.hta-workshop-card__title a:focus {
	outline: 2px solid #4F46E5;
	outline-offset: 2px;
}

/* Print Styles */
@media print {
	.hta-workshop-card__actions {
		display: none;
	}

	.hta-workshop-card {
		box-shadow: none;
		border: 1px solid #EDEDED;
	}
}

