/**
 * AI Event Calendar - Frontend Styles
 * Modern, clean design for event display
 */

/* ===========================
   Single Event Page
   =========================== */

.aiec-event-single {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Hero Section with Image */
.aiec-event-hero {
	position: relative;
	margin: -20px -20px 0;
	border-radius: 0 0 16px 16px;
	overflow: hidden;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.aiec-event-hero__image {
	width: 100%;
	height: 300px;
	object-fit: cover;
	opacity: 0.85;
}

.aiec-event-hero--no-image {
	height: 120px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Event Header */
.aiec-event-header {
	padding: 32px 0 24px;
}

/* Event Status Badges */
.aiec-event-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 600;
	margin-bottom: 16px;
}

.aiec-event-status .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.aiec-event-status small {
	font-weight: 400;
	opacity: 0.9;
}

.aiec-event-status--cancelled {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.aiec-event-status--postponed {
	background: #fff7ed;
	color: #9a3412;
	border: 1px solid #fed7aa;
}

.aiec-event-status--rescheduled {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fde68a;
}

.aiec-event-status--past {
	background: #f3f4f6;
	color: #4b5563;
	border: 1px solid #e5e7eb;
}

.aiec-event-title {
	font-size: 2.25rem;
	font-weight: 700;
	color: #1a1a2e;
	margin: 0 0 20px;
	line-height: 1.2;
}

/* Meta Info Cards */
.aiec-event-meta {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 32px;
}

.aiec-event-meta__item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 18px 20px;
	background: #f8f9fa;
	border-radius: 12px;
	border: 1px solid #e9ecef;
	transition: all 0.2s ease;
}

.aiec-event-meta__item:hover {
	border-color: #dee2e6;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.aiec-event-meta__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 10px;
	flex-shrink: 0;
}

.aiec-event-meta__icon svg {
	width: 22px;
	height: 22px;
	fill: #fff;
}

.aiec-event-meta__content {
	flex: 1;
	min-width: 0;
}

.aiec-event-meta__label {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #6c757d;
	margin-bottom: 4px;
}

.aiec-event-meta__value {
	font-size: 1rem;
	font-weight: 500;
	color: #1a1a2e;
	line-height: 1.4;
}

/* Multiple Dates */
.aiec-event-dates-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aiec-event-dates-list li {
	padding: 4px 0;
	border-bottom: 1px dashed #dee2e6;
}

.aiec-event-dates-list li:last-child {
	border-bottom: none;
}

/* Content Section */
.aiec-event-content {
	padding: 32px 0;
	border-top: 1px solid #e9ecef;
}

.aiec-event-content h2 {
	font-size: 1.25rem;
	font-weight: 600;
	color: #1a1a2e;
	margin: 0 0 16px;
}

.aiec-event-description {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: #495057;
}

.aiec-event-description p {
	margin: 0 0 1.25em;
}

/* Gallery */
.aiec-event-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	margin-top: 24px;
}

.aiec-event-gallery img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.2s;
}

.aiec-event-gallery img:hover {
	transform: scale(1.03);
}

/* Custom Fields */
.aiec-event-custom-fields {
	padding: 24px 0;
	border-top: 1px solid #e9ecef;
}

.aiec-event-custom-field {
	margin-bottom: 16px;
}

.aiec-event-custom-field__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #6c757d;
	margin-bottom: 6px;
}

.aiec-event-custom-field__value {
	font-size: 1rem;
	color: #1a1a2e;
}

/* Source & Meta Footer */
.aiec-event-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 20px 0;
	border-top: 1px solid #e9ecef;
	font-size: 0.875rem;
	color: #6c757d;
}

.aiec-event-source a {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
}

.aiec-event-source a:hover {
	text-decoration: underline;
}

.aiec-event-last-checked {
	margin-left: auto;
}

/* Subscribe Section */
.aiec-event-subscribe {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border-radius: 16px;
	padding: 32px;
	margin: 32px 0;
	text-align: center;
}

.aiec-event-subscribe h3 {
	font-size: 1.25rem;
	font-weight: 600;
	color: #1a1a2e;
	margin: 0 0 8px;
}

.aiec-event-subscribe p {
	color: #6c757d;
	margin: 0 0 20px;
	font-size: 0.9375rem;
}

.aiec-event-subscribe form {
	display: flex;
	gap: 12px;
	max-width: 400px;
	margin: 0 auto;
}

.aiec-event-subscribe input[type="email"] {
	flex: 1;
	padding: 14px 18px;
	border: 2px solid #dee2e6;
	border-radius: 10px;
	font-size: 1rem;
	transition: border-color 0.2s;
}

.aiec-event-subscribe input[type="email"]:focus {
	outline: none;
	border-color: var(--aiec-btn-bg, #667eea);
}

.aiec-event-subscribe button {
	padding: 14px 24px;
	background-color: var(--aiec-btn-bg, #667eea);
	color: var(--aiec-btn-text, #fff);
	border: none;
	border-radius: var(--aiec-btn-radius, 10px);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.aiec-event-subscribe button:hover {
	background-color: var(--aiec-btn-hover-bg, #5a6fd6);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Change History (collapsed by default) */
.aiec-event-history {
	margin-top: 24px;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	overflow: hidden;
}

.aiec-event-history__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 16px 20px;
	background: #f8f9fa;
	border: none;
	cursor: pointer;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #495057;
}

.aiec-event-history__toggle:hover {
	background: #e9ecef;
}

.aiec-event-history__content {
	display: none;
	padding: 16px 20px;
	background: #fff;
}

.aiec-event-history__content.is-open {
	display: block;
}

.aiec-event-history__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.aiec-event-history__list li {
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 0.875rem;
	color: #6c757d;
}

.aiec-event-history__list li:last-child {
	border-bottom: none;
}

/* ===========================
   Event List / Archive
   =========================== */

.aiec-event-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
	margin: 24px 0;
}

.aiec-event-card {
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
	transition: transform 0.2s, box-shadow 0.2s;
}

.aiec-event-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.aiec-event-card__image {
	width: 100%;
	height: 180px;
	object-fit: cover;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.aiec-event-card__content {
	padding: 20px;
}

.aiec-event-card__date {
	display: inline-block;
	padding: 6px 12px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 6px;
	margin-bottom: 12px;
}

.aiec-event-card__title {
	margin: 0 0 8px;
	line-height: 1.3;
}

.aiec-event-card__title a {
	color: inherit;
	text-decoration: none;
}

.aiec-event-card__title a:hover {
	color: #667eea;
}

.aiec-event-card__location {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	color: #6c757d;
}

.aiec-event-card__location svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
	.aiec-event-title {
		font-size: 1.75rem;
	}
	
	.aiec-event-meta {
		grid-template-columns: 1fr;
	}
	
	.aiec-event-subscribe form {
		flex-direction: column;
	}
	
	.aiec-event-list {
		grid-template-columns: 1fr;
	}
}

/* Legacy support for old shortcodes */
.ai-event-calendar-list { margin: 1em 0; }
.ai-event-calendar-list .ai-event-item { margin-bottom: 1.5em; padding-bottom: 1em; border-bottom: 1px solid #eee; }
.ai-event-calendar-list .ai-event-item .aiec-overview-title { margin: 0 0 0.25em; }
.ai-event-calendar-list .ai-event-item .aiec-overview-title a { color: inherit; text-decoration: none; }
.ai-event-calendar-list .ai-event-item .aiec-overview-title a:hover { opacity: 0.85; }
.ai-event-calendar-list .ai-event-date { color: #666; font-size: 0.95em; margin: 0.25em 0; }
.ai-event-calendar-list .ai-event-location { color: #555; margin: 0.25em 0; }
.ai-event-style-cards .ai-event-item { border: 1px solid #ddd; border-radius: 8px; padding: 1em; }

/* ===========================
   Changes & Last Checked Shortcodes
   =========================== */

/* Changes List */
.aiec-changes-list {
	margin: 1em 0;
	padding-left: 1.5em;
	list-style-type: disc;
}
.aiec-changes-list li {
	margin-bottom: 0.5em;
	color: #4a4a4a;
	line-height: 1.5;
}

/* Changes Text */
.aiec-changes-text {
	margin: 1em 0;
	color: #4a4a4a;
	line-height: 1.6;
}

/* Changes Badge */
.aiec-changes-badge {
	display: flex;
	flex-direction: column;
	gap: 8px;
	background: #fff8e6;
	border: 1px solid #ffeaa7;
	border-left: 4px solid #f39c12;
	border-radius: 8px;
	padding: 16px 20px;
	margin: 1em 0;
	font-size: 0.95em;
	color: #6e4e00;
	line-height: 1.5;
}

/* Cancelled Event Badge */
.aiec-changes-badge--cancelled {
	background: #fef2f2;
	border-color: #fecaca;
	border-left-color: #dc2626;
	color: #991b1b;
}
.aiec-changes-badge--cancelled .aiec-changes-badge__date {
	color: #b91c1c;
}
.aiec-changes-badge--cancelled .dashicons {
	color: #dc2626;
}

/* Warning Badge (postponed, rescheduled) */
.aiec-changes-badge--warning {
	background: #fffbeb;
	border-color: #fde68a;
	border-left-color: #f59e0b;
	color: #92400e;
}
.aiec-changes-badge--warning .aiec-changes-badge__date {
	color: #b45309;
}
.aiec-changes-badge--warning .dashicons {
	color: #f59e0b;
}

.aiec-changes-badge__date {
	display: block;
	font-size: 0.8em;
	font-weight: 600;
	color: #a67c00;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.aiec-changes-badge__content {
	display: flex;
	align-items: center;
	gap: 10px;
}

.aiec-changes-badge__content .dashicons {
	color: #f39c12;
	flex-shrink: 0;
	font-size: 20px;
	width: 20px;
	height: 20px;
}

.aiec-changes-badge__text {
	flex: 1;
	line-height: 1.4;
}

/* Legacy Change Date (fallback) */
.aiec-change-date {
	display: block;
	color: #888;
	font-size: 0.85em;
	margin-top: 6px;
}

/* Responsive Changes Badge */
@media (max-width: 480px) {
	.aiec-changes-badge {
		padding: 12px 14px;
		gap: 6px;
		font-size: 0.9em;
	}
	.aiec-changes-badge__content {
		gap: 8px;
	}
}

/* Last Checked Text */
.aiec-checked-text {
	margin: 1em 0;
	color: #666;
	font-size: 0.9em;
}

/* Last Checked Badge */
.aiec-checked-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #d4edda;
	border: 1px solid #c3e6cb;
	border-radius: 6px;
	padding: 10px 16px;
	margin: 0.5em 0;
	font-size: 0.9em;
	color: #155724;
}
.aiec-checked-badge .dashicons {
	color: #28a745;
}

/* Last Checked Inline */
.aiec-checked-inline {
	color: #666;
	font-size: 0.85em;
	font-style: italic;
}

/* ===========================
   Status Badge Shortcode
   =========================== */

.aiec-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 0.9em;
	font-weight: 600;
}

.aiec-status-badge--cancelled {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.aiec-status-badge--postponed {
	background: #fff7ed;
	color: #9a3412;
	border: 1px solid #fed7aa;
}

.aiec-status-badge--rescheduled {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fde68a;
}

.aiec-status-badge--past {
	background: #f3f4f6;
	color: #4b5563;
	border: 1px solid #e5e7eb;
}

/* ===========================
   Pexels Image Credit
   =========================== */

.aiec-pexels-credit {
	--pexels-text-color: #666666;
	--pexels-link-color: #05a081;
	margin: 8px 0 0 0;
	font-size: 0.8em;
	color: var(--pexels-text-color);
}

.aiec-pexels-credit a {
	color: var(--pexels-link-color);
	text-decoration: none;
}

.aiec-pexels-credit a:hover {
	text-decoration: underline;
}

/* Subtle style (default) */
.aiec-pexels-credit--subtle {
	padding: 4px 0;
	font-size: 0.75em;
	opacity: 0.8;
}

.aiec-pexels-credit--subtle::before {
	content: "📷 ";
	font-size: 0.9em;
}

/* Badge style */
.aiec-pexels-credit--badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.05);
	border-radius: 6px;
	font-size: 0.8em;
}

.aiec-pexels-credit--badge::before {
	content: "📷";
	font-size: 1em;
}

/* Inline style */
.aiec-pexels-credit--inline {
	display: inline;
	padding: 0;
	font-size: 0.75em;
	font-style: italic;
}

.aiec-pexels-credit--inline::before {
	content: "— ";
}
