/**
 * EMWC Blocks - Editor Styles
 *
 * @package EventsAndTicketsForWooCommerce
 */

/* Block placeholders */
.wp-block-emwc-calendar,
.wp-block-emwc-events-list,
.wp-block-emwc-upcoming-events,
.wp-block-emwc-event-card,
.wp-block-emwc-event-countdown {
	min-height: 100px;
}

/* Loading state */
.wp-block-emwc-calendar .components-spinner,
.wp-block-emwc-events-list .components-spinner,
.wp-block-emwc-upcoming-events .components-spinner,
.wp-block-emwc-event-card .components-spinner,
.wp-block-emwc-event-countdown .components-spinner {
	margin: 20px auto;
	display: block;
}

/* Placeholder styling */
.emwc-no-event-selected,
.emwc-event-not-found,
.emwc-no-events {
	padding: 40px 20px;
	text-align: center;
	background: #f8f7fa;
	border-radius: 8px;
	color: #666;
	border: 1px dashed #ddd;
}

/* ========================================
   Archive Event Card Styles (for Events List Block)
   Ensures editor matches frontend
   ======================================== */

/* Editor-specific fixes for archive styles */
.editor-styles-wrapper .emwc-events-list-block,
.block-editor-block-list__block .emwc-events-list-block {
	margin: 0;
}

/* Events Grid in Editor */
.editor-styles-wrapper .emwc-events-grid,
.block-editor-block-list__block .emwc-events-grid {
	display: grid;
	gap: 30px;
}

/* Event Card - Match archive-event.css */
.editor-styles-wrapper .emwc-event-card,
.block-editor-block-list__block .emwc-event-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
	transition: transform 0.2s, box-shadow 0.2s;
}

.editor-styles-wrapper .emwc-card-link,
.block-editor-block-list__block .emwc-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Card Image */
.editor-styles-wrapper .emwc-card-image,
.block-editor-block-list__block .emwc-card-image {
	position: relative;
	aspect-ratio: 16/10;
	overflow: hidden;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.editor-styles-wrapper .emwc-card-image img,
.block-editor-block-list__block .emwc-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.editor-styles-wrapper .emwc-card-placeholder,
.block-editor-block-list__block .emwc-card-placeholder {
	width: 100%;
	height: 100%;
}

/* Date Badge on Image */
.editor-styles-wrapper .emwc-card-date,
.block-editor-block-list__block .emwc-card-date {
	position: absolute;
	top: 12px;
	left: 12px;
	background: #fff;
	border-radius: 8px;
	padding: 8px 12px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	min-width: 50px;
}

.editor-styles-wrapper .emwc-card-month,
.block-editor-block-list__block .emwc-card-month {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #e74c3c;
	letter-spacing: 0.5px;
}

.editor-styles-wrapper .emwc-card-day,
.block-editor-block-list__block .emwc-card-day {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: #1a1a2e;
	line-height: 1;
}

/* Status Badges */
.editor-styles-wrapper .emwc-card-badge,
.block-editor-block-list__block .emwc-card-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

.editor-styles-wrapper .emwc-badge-live,
.block-editor-block-list__block .emwc-badge-live {
	background: #dcfce7;
	color: #16a34a;
}

.editor-styles-wrapper .emwc-badge-cancelled,
.block-editor-block-list__block .emwc-badge-cancelled {
	background: #fee2e2;
	color: #dc2626;
}

.editor-styles-wrapper .emwc-badge-soldout,
.block-editor-block-list__block .emwc-badge-soldout {
	background: #f3f4f6;
	color: #6b7280;
}

/* Card Content */
.editor-styles-wrapper .emwc-card-content,
.block-editor-block-list__block .emwc-card-content {
	padding: 20px;
}

.editor-styles-wrapper .emwc-card-title,
.block-editor-block-list__block .emwc-card-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #1e293b;
	line-height: 1.3;
}

.editor-styles-wrapper .emwc-card-meta,
.block-editor-block-list__block .emwc-card-meta {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #64748b;
	margin-bottom: 6px;
}

.editor-styles-wrapper .emwc-card-meta .dashicons,
.block-editor-block-list__block .emwc-card-meta .dashicons {
	font-family: dashicons;
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #6366f1;
}

.editor-styles-wrapper .emwc-card-excerpt,
.block-editor-block-list__block .emwc-card-excerpt {
	font-size: 14px;
	color: #64748b;
	line-height: 1.5;
	margin: 12px 0 16px;
}

.editor-styles-wrapper .emwc-card-btn,
.block-editor-block-list__block .emwc-card-btn {
	display: inline-block;
	padding: 8px 16px;
	background: #f1f5f9;
	color: #475569;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
}

/* ========================================
   Upcoming Events Block
   ======================================== */

.emwc-upcoming-events-block,
.editor-styles-wrapper .emwc-upcoming-events-block,
.block-editor-block-list__block .emwc-upcoming-events-block {
	margin: 0;
}

.emwc-upcoming-events-list,
.editor-styles-wrapper .emwc-upcoming-events-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.emwc-upcoming-event-item,
.editor-styles-wrapper .emwc-upcoming-event-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 20px 0;
	border-bottom: 1px solid #e5e7eb;
}

.emwc-upcoming-event-item:last-child {
	border-bottom: none;
}

.emwc-upcoming-event-thumb img,
.editor-styles-wrapper .emwc-upcoming-event-thumb img {
	width: 100px;
	height: 70px;
	object-fit: cover;
	border-radius: 6px;
}

.emwc-upcoming-event-details,
.editor-styles-wrapper .emwc-upcoming-event-details {
	flex: 1;
	min-width: 0;
	padding-top: 2px;
}

.emwc-upcoming-event-title,
.editor-styles-wrapper .emwc-upcoming-event-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 8px 0;
	line-height: 1.4;
}

.emwc-upcoming-event-title a,
.editor-styles-wrapper .emwc-upcoming-event-title a {
	text-decoration: none !important;
	color: #1e293b;
	font-weight: 600;
}

.emwc-upcoming-event-title a:hover {
	color: #6366f1;
}

.emwc-upcoming-event-meta,
.editor-styles-wrapper .emwc-upcoming-event-meta {
	font-size: 14px;
	color: #64748b;
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
}

.emwc-upcoming-event-meta span,
.emwc-event-meta-date,
.emwc-event-meta-venue,
.editor-styles-wrapper .emwc-event-meta-date,
.editor-styles-wrapper .emwc-event-meta-venue {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.editor-styles-wrapper .emwc-upcoming-event-meta .dashicons,
.block-editor-block-list__block .emwc-upcoming-event-meta .dashicons,
.editor-styles-wrapper .emwc-event-meta-date .dashicons,
.editor-styles-wrapper .emwc-event-meta-venue .dashicons,
.emwc-event-meta-date .dashicons,
.emwc-event-meta-venue .dashicons {
	font-family: dashicons;
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #6366f1;
	line-height: 1;
}

/* Compact style */
.emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-item,
.editor-styles-wrapper .emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-item {
	padding: 16px 0;
}

.emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-title,
.editor-styles-wrapper .emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-title {
	font-size: 15px;
}

.emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-thumb img,
.editor-styles-wrapper .emwc-upcoming-events-block.emwc-compact .emwc-upcoming-event-thumb img {
	width: 80px;
	height: 56px;
}

/* ========================================
   Event Card Block (Compact Inline Card)
   ======================================== */

.emwc-event-card-block,
.editor-styles-wrapper .emwc-event-card-block {
	margin: 1em 0;
}

.emwc-event-card-link,
.editor-styles-wrapper .emwc-event-card-link {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	text-decoration: none !important;
	color: inherit;
}

.emwc-event-card-link *,
.editor-styles-wrapper .emwc-event-card-link * {
	text-decoration: none !important;
}

.emwc-event-card-image,
.editor-styles-wrapper .emwc-event-card-image {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	border-radius: 8px;
	overflow: hidden;
}

.emwc-event-card-image img,
.editor-styles-wrapper .emwc-event-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.emwc-event-card-content,
.editor-styles-wrapper .emwc-event-card-content {
	flex: 1;
	min-width: 0;
}

.emwc-event-card-title,
.editor-styles-wrapper .emwc-event-card-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: #1e293b;
	line-height: 1.3;
}

.emwc-event-card-meta,
.editor-styles-wrapper .emwc-event-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 14px;
	color: #64748b;
}

.emwc-event-card-date,
.emwc-event-card-venue,
.editor-styles-wrapper .emwc-event-card-date,
.editor-styles-wrapper .emwc-event-card-venue {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.emwc-event-card-date .dashicons,
.emwc-event-card-venue .dashicons,
.editor-styles-wrapper .emwc-event-card-date .dashicons,
.editor-styles-wrapper .emwc-event-card-venue .dashicons {
	font-family: dashicons;
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #6366f1;
}

.emwc-event-card-arrow,
.editor-styles-wrapper .emwc-event-card-arrow {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #f1f5f9;
	border-radius: 50%;
	color: #64748b;
}

.emwc-event-card-arrow .dashicons,
.editor-styles-wrapper .emwc-event-card-arrow .dashicons {
	font-family: dashicons;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* ========================================
   Event Countdown Block
   ======================================== */

.emwc-event-countdown-block {
	text-align: center;
	padding: 40px 30px;
	background: #f8fafc;
	border-radius: 12px;
}

.emwc-countdown-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 24px 0;
	color: #1e293b;
}

.emwc-countdown-title a {
	text-decoration: none;
	color: inherit;
}

.emwc-countdown-timer {
	display: flex;
	justify-content: center;
	gap: 24px;
	margin-bottom: 20px;
}

.emwc-countdown-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 80px;
	padding: 16px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.emwc-countdown-value {
	font-size: 42px;
	font-weight: 700;
	line-height: 1;
	color: #6366f1;
}

.emwc-countdown-label {
	font-size: 11px;
	text-transform: uppercase;
	color: #64748b;
	margin-top: 6px;
	letter-spacing: 0.5px;
}

.emwc-countdown-date {
	font-size: 14px;
	color: #64748b;
}

.emwc-countdown-completed {
	font-size: 24px;
	color: #16a34a;
	font-weight: 600;
}
