/**
 * Minimal Theme-Integrated Event Manager - Modern Light Theme Styles
 *
 * Strictly inherits active theme native CSS variables.
 * 100% mobile-friendly, light theme, center-aligned live tab,
 * line-by-line card listings, and creative popup modal.
 */

:root {
	--mem-primary: var(--wp--preset--color--primary, #2563eb);
	--mem-contrast: var(--wp--preset--color--contrast, #0f172a);
	--mem-base: var(--wp--preset--color--base, #ffffff);
	--mem-surface: var(--wp--preset--color--surface, #f8fafc);
	--mem-secondary: var(--wp--preset--color--secondary, #64748b);
	--mem-font-heading: var(--wp--preset--font-family--heading, inherit);
	--mem-border: rgba(15, 23, 42, 0.08);
	--mem-live-red: #dc2626;
	--mem-live-red-bg: #fef2f2;
	--mem-direction-blue: #0284c7;
	--mem-radius: 14px;
}

.mem-events-wrapper {
	margin: 2rem 0;
	font-family: inherit;
	color: var(--mem-contrast);
	width: 100%;
	box-sizing: border-box;
}

.mem-events-wrapper *,
.mem-events-wrapper *::before,
.mem-events-wrapper *::after {
	box-sizing: border-box;
}

/* Pulsing Red Dot */
.mem-pulse-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: var(--mem-live-red);
	box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
	animation: memPulse 1.8s infinite;
	vertical-align: middle;
	margin-right: 6px;
	flex-shrink: 0;
}

.mem-pulse-white {
	background-color: #ffffff;
	box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
}

@keyframes memPulse {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
	}
	70% {
		transform: scale(1);
		box-shadow: 0 0 0 7px rgba(220, 38, 38, 0);
	}
	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
	}
}

/* ==========================================================================
   1. FILLED LIGHT LIVE EVENT BOX (Centered Alignment & In-Line Buttons)
   ========================================================================== */
.mem-live-top-section {
	margin-bottom: 2.5rem;
	width: 100%;
}

.mem-live-light-box {
	background: var(--mem-base);
	border: 2px solid var(--mem-live-red);
	border-radius: 16px;
	padding: 2.5rem 2rem;
	box-shadow: 0 10px 35px rgba(220, 38, 38, 0.08);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 1.25rem;
	width: 100%;
}

.mem-live-pill-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.mem-live-pill-light {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.95rem;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: var(--mem-live-red-bg);
	color: var(--mem-live-red);
	border: 1px solid rgba(220, 38, 38, 0.3);
	border-radius: 9999px;
}

/* Event Title First */
.mem-live-title-primary {
	font-family: var(--mem-font-heading);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0;
	color: var(--mem-contrast);
	letter-spacing: -0.02em;
	max-width: 800px;
}

/* Centered Date, Day, Time, Venue */
.mem-live-meta-centered {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	flex-wrap: wrap;
	margin: 0.25rem 0;
}

.mem-live-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 1.05rem;
	color: var(--mem-contrast);
}

.mem-meta-label {
	font-weight: 600;
	color: var(--mem-secondary);
}

.mem-meta-val {
	font-weight: 700;
	color: var(--mem-contrast);
}

/* All Buttons In Line (Centered & Responsive) */
.mem-live-buttons-inline {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
	width: 100%;
	margin-top: 0.5rem;
}

.mem-btn-light {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0.85rem 1.75rem;
	font-size: 0.98rem;
	font-weight: 700;
	border-radius: 8px;
	text-decoration: none !important;
	cursor: pointer;
	line-height: 1;
	min-height: 44px; /* Touch friendly */
	transition: all 0.2s ease;
}

.mem-btn-watch-live {
	background: var(--mem-live-red) !important;
	color: #ffffff !important;
	border: 1px solid var(--mem-live-red) !important;
	box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.mem-btn-watch-live:hover {
	background: #b91c1c !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.mem-btn-direction {
	background: var(--mem-surface) !important;
	color: var(--mem-contrast) !important;
	border: 1px solid var(--mem-border) !important;
}

.mem-btn-direction:hover {
	background: #ffffff !important;
	border-color: var(--mem-direction-blue) !important;
	color: var(--mem-direction-blue) !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   2. TWO BOXES: UPCOMING EVENTS & PAST EVENTS TABS
   ========================================================================== */
.mem-tabs-container {
	margin-top: 1rem;
	width: 100%;
}

.mem-tablist {
	display: flex;
	gap: 0.5rem;
	border-bottom: 2px solid var(--mem-border);
	margin-bottom: 2rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0;
}

.mem-tab-btn {
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	padding: 0.85rem 1.5rem;
	font-size: 1.05rem;
	font-weight: 700;
	font-family: inherit;
	color: var(--mem-secondary);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	transition: all 0.2s ease;
	border-radius: 8px 8px 0 0;
	white-space: nowrap;
	min-height: 44px;
}

.mem-tab-btn:hover {
	color: var(--mem-contrast);
	background: var(--mem-surface);
}

.mem-tab-btn.is-active {
	color: var(--mem-primary);
	border-bottom-color: var(--mem-primary);
}

.mem-tab-pill {
	font-size: 0.75rem;
	font-weight: 700;
	padding: 0.25rem 0.55rem;
	border-radius: 9999px;
	background: rgba(15, 23, 42, 0.08);
	color: inherit;
}

.mem-tab-btn.is-active .mem-tab-pill {
	background: var(--mem-primary);
	color: #ffffff;
}

.mem-tabpanel {
	display: block;
	animation: memFadeIn 0.25s ease;
}

.mem-tabpanel[hidden] {
	display: none !important;
}

@keyframes memFadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ==========================================================================
   3. EVENT DISPLAY AS CARD TYPE IN LINE ONE BY ONE (.mem-cards-list)
   ========================================================================== */
.mem-cards-list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	width: 100%;
}

.mem-light-card {
	background: var(--mem-base);
	border: 1px solid var(--mem-border);
	border-radius: var(--mem-radius);
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
	width: 100%;
}

.mem-light-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
	border-color: rgba(15, 23, 42, 0.16);
}

.mem-card-row-inner {
	padding: 1.5rem 1.75rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	flex-wrap: wrap;
}

.mem-card-details {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	flex: 1 1 500px;
}

/* Event Title */
.mem-card-title {
	font-family: var(--mem-font-heading);
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
	color: var(--mem-contrast);
}

/* Date, Day, Time, Venue In Line */
.mem-card-meta-inline {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.mem-card-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.92rem;
	color: var(--mem-contrast);
}

.mem-meta-svg {
	color: var(--mem-primary);
	flex-shrink: 0;
}

.mem-meta-label {
	color: var(--mem-secondary);
	font-weight: 500;
}

.mem-meta-text {
	font-weight: 600;
	color: var(--mem-contrast);
}

/* All Buttons In Line */
.mem-card-buttons-inline {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	flex-shrink: 0;
}

.mem-btn-card {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 0.75rem 1.35rem;
	font-size: 0.92rem;
	font-weight: 700;
	border-radius: 7px;
	text-decoration: none !important;
	cursor: pointer;
	line-height: 1;
	min-height: 42px;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.mem-btn-card-direction {
	background: var(--mem-surface) !important;
	color: var(--mem-contrast) !important;
	border: 1px solid var(--mem-border) !important;
}

.mem-btn-card-direction:hover {
	background: #ffffff !important;
	border-color: var(--mem-direction-blue) !important;
	color: var(--mem-direction-blue) !important;
}

.mem-btn-card-live {
	background: var(--mem-live-red) !important;
	color: #ffffff !important;
	border: 1px solid var(--mem-live-red) !important;
}

.mem-btn-card-live:hover {
	background: #b91c1c !important;
}

/* ==========================================================================
   Past Box: Year Filtering & Groups
   ========================================================================== */
.mem-past-filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 1rem 1.25rem;
	background: var(--mem-surface);
	border: 1px solid var(--mem-border);
	border-radius: 8px;
	margin-bottom: 2rem;
}

.mem-filter-label {
	font-weight: 600;
	font-size: 0.95rem;
	color: var(--mem-contrast);
}

.mem-select-input {
	padding: 0.45rem 1.75rem 0.45rem 0.85rem;
	border: 1px solid var(--mem-border);
	border-radius: 6px;
	background: var(--mem-base);
	color: var(--mem-contrast);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	cursor: pointer;
}

.mem-year-group {
	margin-bottom: 2rem;
}

.mem-year-group.is-filtered-out {
	display: none;
}

.mem-year-accordion {
	border: 1px solid var(--mem-border);
	border-radius: var(--mem-radius);
	overflow: hidden;
	background: var(--mem-base);
}

.mem-year-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.5rem;
	background: var(--mem-surface);
	cursor: pointer;
	font-family: var(--mem-font-heading);
	user-select: none;
	transition: background-color 0.15s ease;
}

.mem-year-summary:hover {
	background: rgba(15, 23, 42, 0.05);
}

.mem-year-heading {
	font-size: 1.35rem;
	font-weight: 700;
	color: var(--mem-contrast);
}

.mem-year-count {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--mem-secondary);
}

.mem-year-list {
	padding: 1.5rem;
	border-top: 1px solid var(--mem-border);
}

/* Empty States */
.mem-empty-state {
	text-align: center;
	padding: 3.5rem 1.5rem;
	border: 1px dashed var(--mem-border);
	border-radius: var(--mem-radius);
	background: var(--mem-surface);
	margin: 1rem 0;
}

.mem-empty-title {
	font-family: var(--mem-font-heading);
	font-size: 1.25rem;
	margin: 0 0 0.5rem 0;
	color: var(--mem-contrast);
}

.mem-empty-desc {
	color: var(--mem-secondary);
	max-width: 480px;
	margin: 0 auto;
	font-size: 0.95rem;
}

/* ==========================================================================
   4. CREATIVE HOME PAGE LIVE POPUP MODAL
   ========================================================================== */
.mem-popup-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mem-popup-backdrop.is-visible {
	opacity: 1;
	visibility: visible;
}

.mem-creative-popup {
	position: relative;
	max-width: 580px;
	width: 100%;
	background: radial-gradient(circle at 50% 0%, rgba(220, 38, 38, 0.08) 0%, transparent 70%), #ffffff;
	border: 1.5px solid rgba(220, 38, 38, 0.25);
	border-radius: 20px;
	padding: 2.25rem 2rem;
	box-shadow: 0 25px 60px -15px rgba(220, 38, 38, 0.25), 0 0 0 1px rgba(220, 38, 38, 0.1);
	transform: scale(0.92) translateY(15px);
	transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
}

.mem-popup-backdrop.is-visible .mem-creative-popup {
	transform: scale(1) translateY(0);
}

/* Creative Close Button */
.mem-popup-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.05);
	color: var(--mem-contrast);
	border: 1px solid var(--mem-border);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.2s ease;
}

.mem-popup-close:hover {
	background: var(--mem-live-red);
	color: #ffffff;
	border-color: var(--mem-live-red);
	transform: rotate(90deg);
}

/* Creative Live Beacon & Audio Equalizer Animation */
.mem-popup-beacon-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.mem-beacon-glow-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.35rem 0.95rem;
	background: var(--mem-live-red-bg);
	border: 1px solid rgba(220, 38, 38, 0.35);
	border-radius: 9999px;
	box-shadow: 0 2px 10px rgba(220, 38, 38, 0.15);
}

.mem-beacon-live-text {
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--mem-live-red);
}

/* Audio Wave Equalizer Animation */
.mem-live-equalizer {
	display: inline-flex;
	align-items: flex-end;
	gap: 3px;
	height: 16px;
}

.mem-eq-bar {
	width: 3px;
	background: var(--mem-live-red);
	border-radius: 2px;
	animation: memEqDance 1.2s infinite ease-in-out;
}

.mem-eq-1 { height: 8px; animation-delay: 0.1s; }
.mem-eq-2 { height: 16px; animation-delay: 0.3s; }
.mem-eq-3 { height: 11px; animation-delay: 0.2s; }
.mem-eq-4 { height: 14px; animation-delay: 0.4s; }
.mem-eq-5 { height: 7px; animation-delay: 0.15s; }

@keyframes memEqDance {
	0%, 100% { transform: scaleY(0.4); }
	50% { transform: scaleY(1); }
}

/* Popup Event Title */
.mem-popup-title {
	font-family: var(--mem-font-heading);
	font-size: 1.85rem;
	font-weight: 800;
	line-height: 1.25;
	margin: 0;
	color: var(--mem-contrast);
	letter-spacing: -0.02em;
	max-width: 500px;
}

/* Creative Meta Grid in Popup */
.mem-popup-meta-grid {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
	width: 100%;
}

.mem-popup-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0.65rem 1rem;
	background: var(--mem-surface);
	border: 1px solid var(--mem-border);
	border-radius: 10px;
	text-align: left;
}

.mem-popup-chip-full {
	width: 100%;
	justify-content: center;
	text-align: center;
}

.mem-chip-icon {
	color: var(--mem-primary);
	flex-shrink: 0;
}

.mem-chip-text-wrap {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.mem-chip-sublabel {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--mem-secondary);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.mem-chip-main {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--mem-contrast);
}

/* Popup In-Line Buttons */
.mem-popup-buttons-inline {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
	width: 100%;
	margin-top: 0.5rem;
}

.mem-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0.85rem 1.65rem;
	font-size: 0.98rem;
	font-weight: 700;
	border-radius: 8px;
	text-decoration: none !important;
	cursor: pointer;
	line-height: 1;
	min-height: 44px;
	transition: all 0.2s ease;
	flex: 1 1 200px;
}

.mem-popup-btn-live {
	background: var(--mem-live-red) !important;
	color: #ffffff !important;
	border: 1px solid var(--mem-live-red) !important;
	box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.mem-popup-btn-live:hover {
	background: #b91c1c !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

.mem-popup-btn-direction {
	background: var(--mem-surface) !important;
	color: var(--mem-contrast) !important;
	border: 1px solid var(--mem-border) !important;
}

.mem-popup-btn-direction:hover {
	background: #ffffff !important;
	border-color: var(--mem-direction-blue) !important;
	color: var(--mem-direction-blue) !important;
	transform: translateY(-1px);
}

/* ==========================================================================
   5. 100% MOBILE FRIENDLY & RESPONSIVE RULES
   ========================================================================== */
@media (max-width: 768px) {
	.mem-card-row-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 1.25rem;
		padding: 1.25rem;
	}

	.mem-card-details {
		width: 100%;
	}

	.mem-card-buttons-inline {
		width: 100%;
		flex-direction: row;
		justify-content: flex-start;
	}

	.mem-btn-card {
		flex: 1 1 auto;
	}
}

@media (max-width: 640px) {
	.mem-live-light-box {
		padding: 1.75rem 1.25rem;
	}

	.mem-live-title-primary {
		font-size: 1.5rem;
	}

	.mem-live-meta-centered {
		flex-direction: column;
		gap: 0.5rem;
	}

	.mem-live-buttons-inline {
		flex-direction: column;
		width: 100%;
	}

	.mem-btn-light {
		width: 100%;
	}

	.mem-card-meta-inline {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	.mem-card-buttons-inline {
		flex-direction: column;
		width: 100%;
	}

	.mem-btn-card {
		width: 100%;
	}

	.mem-creative-popup {
		padding: 1.75rem 1.25rem;
	}

	.mem-popup-title {
		font-size: 1.4rem;
	}

	.mem-popup-meta-grid {
		flex-direction: column;
	}

	.mem-popup-chip {
		width: 100%;
		justify-content: flex-start;
	}

	.mem-popup-buttons-inline {
		flex-direction: column;
		width: 100%;
	}

	.mem-popup-btn {
		width: 100%;
	}

	.mem-past-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.mem-select-input {
		width: 100%;
	}
}
