/**
 * Custom Events List View Styles
 * Unified card layout: date block | details | image
 *
 * Place in: wp-content/themes/woodmart-child/custom-events-list.css
 */

/* ==========================================================================
   Category Filter Bar
   ========================================================================== */

:root {
	--tec-color-category-primary: #db08c6;
	--tec-color-category-primary-rgb: 219, 8, 198;
	--tec-color-category-secondary: #D77D5F;
	--tec-color-category-secondary-rgb: 215, 125, 95;
}

.custom-events-filter-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	background-color: #333;
	padding: 12px 20px;
	border-radius: 4px 4px 0 0;
	flex-wrap: wrap;
}


.tribe-events-calendar-list__month-separator+.custom-event-card {
	border-top: none !important;
}

.tribe-events .tribe-events-calendar-list__month-separator {
	background: white !important;
}

.tribe-common .tribe-common-form-control-text__input:focus {
	outline: none !important;
}

.custom-events-filter-bar .filter-group {
	display: flex;
	align-items: center;
	gap: 8px;
}

.custom-events-filter-bar label {
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	font-style: italic;
	text-transform: uppercase;
	margin: 0;
	white-space: nowrap;
}

.custom-events-filter-bar select {
	background: #333;
	color: #ccc;
	border: 1px solid #555;
	padding: 6px 32px 6px 10px;
	font-size: 14px;
	border-radius: 3px;
	min-width: 140px;
	cursor: pointer;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ccc' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
}

.custom-events-filter-bar select:focus {
	outline: none;
	border-color: #999;
}

/* ==========================================================================
   Event Cards Wrapper (for shortcode output)
   ========================================================================== */

.custom-events-list-wrapper {
	margin: 0;
}

/* ==========================================================================
   Event Card
   ========================================================================== */

.custom-event-card {
	background: #fff;
	border: 1px solid #ddd;
	border-top: none;
	transition: box-shadow 0.2s ease;
	position: relative;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);

	@media(max-width:768px) {
		padding: 10px !important;
	}

}

.tribe-events-calendar-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

@media(min-width:998px) {
	.tribe-events-calendar-list {
		display: grid;
		gap: 10px;
	}
}

.custom-event-card:first-child,
.custom-events-filter-bar+.custom-event-card,
.custom-events-list-wrapper .custom-event-card:first-child,
.tribe-events-calendar-list__month-separator+.custom-event-card {
	border-top: 1px solid #ddd;
}

.custom-events-filter-bar+.custom-events-list-wrapper .custom-event-card:first-child {
	border-top: 1px solid #ddd;
}

.custom-event-card:hover {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	z-index: 1;
}

.custom-event-card--featured {
	border-left: 3px solid #e6c84c;
}

.custom-event-card__link {
	display: flex;
	align-items: center;
	width: 100%;
	text-decoration: none !important;
	color: inherit !important;
	padding: 18px 20px;
	gap: 24px;
	box-sizing: border-box;
}

.custom-event-card__link:hover,
.custom-event-card__link:focus,
.custom-event-card__link:visited {
	text-decoration: none !important;
	color: inherit !important;
}

/* ==========================================================================
   Date Block (Left)
   ========================================================================== */

.custom-event-card__date {
	flex: 0 0 115px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #f7f6ec;
	border: 1px solid #e8e6d0;
	border-radius: 4px;
	padding: 10px 8px;
	min-height: 88px;
	text-align: center;
}

.custom-event-card__day-name {
	font-size: 11px;
	color: #666;
	text-transform: capitalize;
	line-height: 1.3;
	letter-spacing: 0.02em;
}

.custom-event-card__day-num {
	font-size: 21px;
	font-weight: 700;
	color: #222;
	line-height: 1.3;
}

.custom-event-card__time {
	font-size: 15px;
	font-weight: 600;
	color: var(--wd-primary-color);
	line-height: 1.3;
}

.custom-event-card__time--allday {
	font-size: 12px;
	font-weight: 500;
	color: #888;
}

/* ==========================================================================
   Event Details (Center)
   ========================================================================== */

.custom-event-card__details {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	gap: 5px;
}

.custom-event-card__title {
	font-size: 19px;
	font-weight: 700;
	color: #222;
	margin: 0 0 4px 0;
	line-height: 1.35;
}

.custom-event-card__desc {
	font-size: 13.5px;
	color: #666;
	margin: 0 0 6px 0;
	line-height: 1.45;
}

.custom-event-card__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.custom-event-card__price {
	font-size: 14px;
	font-weight: 600;
	color: var(--wd-primary-color);
}

.custom-event-card__preorder-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
	background: #d4820a;
	padding: 2px 8px;
	border-radius: 3px;
}

.custom-event-card__category {
	font-family: inherit;
	font-size: 11px;
	font-weight: 400;
	color: #ffffff;
	padding: 2px 8px !important;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	display: inline-block;
	margin-right: 5px;
}

.custom-event-card__category[style*="background:#888"] {
	background-color: #888;
}

/* Specific Category Colors */
.custom-event-card__category[data-cat="live-stream"] {
	background-color: var(--tec-color-category-primary);
}

/* .custom-event-card__category[data-cat="tournaments"] {
	background-color: var(--tec-color-category-secondary) !important;
} */

.tribe-events .tribe-events-calendar-month__calendar-event .tribe-events-calendar-month__calendar-event-details {
	background: none !important;
}

/* Optional: Add a pulse for Live Streams */
.custom-event-card__category[data-cat="live-stream"] {
	box-shadow: 0 0 0 0 rgba(var(--tec-color-category-primary-rgb), 0.7);
	animation: pulse-live 2s infinite;
}

/* Update Date Block for Tournaments */
/* .custom-event-card[data-primary-cat="tournaments"] .custom-event-card__date {
	background-color: rgba(var(--tec-color-category-secondary-rgb), 0.1) !important;
	border-color: var(--tec-color-category-secondary) !important;
} */

/* Update Date Block for Live Stream */
.custom-event-card[data-primary-cat="live-stream"] .custom-event-card__date {
	background-color: rgba(var(--tec-color-category-primary-rgb), 0.1) !important;
	border-color: var(--tec-color-category-primary) !important;
}


@keyframes pulse-live {
	70% {
		box-shadow: 0 0 0 5px rgba(var(--tec-color-category-primary-rgb), 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(var(--tec-color-category-primary-rgb), 0);
	}
}

/* ==========================================================================
   Featured Image / Logo (Right)
   ========================================================================== */

.custom-event-card__logo {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;

	@media(max-width:768px) {
		display: none;
	}
}

.custom-event-card__logo img {
	max-width: 120px;
	max-height: 80px;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
}

/* ==========================================================================
   Override TEC / WoodMart defaults
   ========================================================================== */

.tribe-events .tribe-events-l-container {
	max-width: 100%;

	@media(max-width:768px) {
		padding: 0 !important;
	}
}

/* Hide default TEC elements that might still render */
.tribe-events-calendar-list__month-separator {
	padding: 12px 20px;
	margin: 0;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-bottom: none;
	font-size: 14px;
	font-weight: 600;
	color: #555;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.custom-event-card__link {
		padding: 12px;
		gap: 12px;
		flex-wrap: nowrap;
	}

	.custom-event-card__date {
		flex: 0 0 80px;
		min-height: 70px;
		padding: 6px 4px;
	}

	.custom-event-card__day-name {
		font-size: 10px;
	}

	.custom-event-card__day-num {
		font-size: 16px;
	}

	.custom-event-card__time {
		font-size: 12px;
	}

	.custom-event-card__time--allday {
		font-size: 10px;
	}

	.custom-event-card__title {
		font-size: 15px;
		margin-bottom: 2px;
	}

	.custom-event-card__desc {
		font-size: 12px;
		margin-bottom: 4px;
		/* Limit to 2 lines on mobile */
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.custom-event-card__meta {
		gap: 6px;
	}

	.custom-event-card__price {
		font-size: 12px;
	}

	.custom-event-card__category {
		font-size: 9px;
		padding: 1px 6px;
	}

	.custom-event-card__preorder-badge {
		font-size: 9px;
		padding: 1px 6px;
	}

	.custom-event-card__logo {
		flex: 0 0 70px;
	}

	.custom-event-card__logo img {
		max-width: 70px;
		max-height: 50px;
	}

	.custom-events-filter-bar {
		padding: 10px 12px;
		gap: 8px;
	}

	.custom-events-filter-bar label {
		font-size: 13px;
	}

	.custom-events-filter-bar select {
		font-size: 13px;
		min-width: 120px;
	}

	.tribe-events-sub-nav li a {
		background: transparent !important;
	}
}

@media (max-width: 480px) {
	.custom-event-card__link {
		padding: 10px;
		gap: 10px;
	}

	.custom-event-card__date {
		flex: 0 0 68px;
		min-height: 62px;
		padding: 5px 3px;
	}

	.custom-event-card__day-num {
		font-size: 14px;
	}

	.custom-event-card__title {
		font-size: 14px;
	}

	.custom-event-card__desc {
		font-size: 11px;
		-webkit-line-clamp: 1;
	}

	.custom-event-card__logo {
		flex: 0 0 55px;
	}

	.custom-event-card__logo img {
		max-width: 55px;
		max-height: 40px;
	}
}