/* ==========================================================================
   Event Calendar - Frontend Styles
   ========================================================================== */

/* Calendar Wrapper */
.ec-calendar-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	max-width: 1100px;
	margin: 0 auto;
	color: #333;
	-webkit-font-smoothing: antialiased;
}

/* Calendar Header */
.ec-calendar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 0;
	margin-bottom: 10px;
	flex-wrap: wrap;
	gap: 10px;
}

.ec-nav {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ec-nav-btn {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	width: 36px;
	height: 36px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #555;
	transition: all 0.2s ease;
}

.ec-nav-btn:hover {
	background: #f5f5f5;
	border-color: #bbb;
	color: #333;
}

.ec-current-period {
	font-size: 1.4em;
	font-weight: 600;
	margin: 0;
	min-width: 200px;
	text-align: center;
	color: #222;
}

.ec-view-switcher {
	display: flex;
	gap: 4px;
}

.ec-view-btn {
	background: #fff;
	border: 1px solid #ddd;
	padding: 7px 16px;
	font-size: 13px;
	cursor: pointer;
	color: #555;
	transition: all 0.2s ease;
	font-weight: 500;
}

.ec-view-btn:first-child {
	border-radius: 6px 0 0 6px;
}

.ec-view-btn:nth-last-child(2) {
	border-radius: 0 6px 6px 0;
}

.ec-today-btn {
	border-radius: 6px !important;
	margin-left: 8px;
}

.ec-view-btn.ec-active,
.ec-view-btn:hover {
	background: #ed2736;
	border-color: #ed2736;
	color: #fff;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */

.ec-search-bar {
	margin-bottom: 12px;
}

.ec-search-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	color: #333;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.ec-search-input:focus {
	outline: none;
	border-color: #ed2736;
	box-shadow: 0 0 0 2px rgba(237, 39, 54, 0.15);
}

.ec-search-input::placeholder {
	color: #aaa;
}

/* Loading State */
.ec-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
}

.ec-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid #e0e0e0;
	border-top-color: #ed2736;
	border-radius: 50%;
	animation: ec-spin 0.7s linear infinite;
}

@keyframes ec-spin {
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   Month View
   ========================================================================== */

.ec-month-grid {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ec-weekday-header {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
}

.ec-weekday-header .ec-weekday {
	padding: 10px 8px;
	text-align: center;
	font-size: 0.8em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #666;
}

.ec-days-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}

.ec-day-cell {
	min-height: 110px;
	border-right: 1px solid #eee;
	border-bottom: 1px solid #eee;
	padding: 4px;
	position: relative;
	cursor: default;
	transition: background 0.15s ease;
}

.ec-day-cell:nth-child(7n) {
	border-right: none;
}

.ec-day-cell:hover {
	background: #fef8f8;
}

.ec-day-cell.ec-other-month {
	background: #fafafa;
}

.ec-day-cell.ec-other-month .ec-day-number {
	color: #bbb;
}

.ec-day-cell.ec-today {
	background: #fce9ea;
}

.ec-day-cell.ec-today .ec-day-number {
	background: #ed2736;
	color: #fff;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ec-day-number {
	font-size: 0.85em;
	font-weight: 500;
	color: #444;
	padding: 2px 4px;
	margin-bottom: 2px;
	display: inline-flex;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.15s ease;
}

.ec-day-number:hover {
	background: #e0e0e0;
}

/* Events in day cells */
.ec-day-events {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ec-event-item {
	display: flex;
	align-items: center;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.75em;
	line-height: 1.4;
	cursor: pointer;
	transition: opacity 0.15s ease;
	text-decoration: none;
	color: #fff;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.ec-event-item:hover {
	opacity: 0.85;
}

.ec-event-time {
	font-weight: 600;
	margin-right: 4px;
	flex-shrink: 0;
}

.ec-event-title-text {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ec-more-events {
	font-size: 0.75em;
	color: #ed2736;
	padding: 2px 6px;
	cursor: pointer;
	font-weight: 600;
}

.ec-more-events:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Week View
   ========================================================================== */

.ec-week-grid {
	--ec-time-col: 60px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ec-week-header {
	display: grid;
	grid-template-columns: var(--ec-time-col) repeat(7, 1fr);
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
}

.ec-week-header-cell {
	padding: 10px 5px;
	text-align: center;
	border-right: 1px solid #eee;
}

.ec-week-header-cell:last-child {
	border-right: none;
}

.ec-week-header-cell .ec-week-day-name {
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
	font-weight: 600;
}

.ec-week-header-cell .ec-week-day-number {
	font-size: 1.3em;
	font-weight: 600;
	color: #333;
	margin-top: 2px;
}

.ec-week-header-cell.ec-today .ec-week-day-number {
	background: #ed2736;
	color: #fff;
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ec-week-header-corner {
	border-right: 1px solid #eee;
}

/* All-day events row */
.ec-week-allday-row {
	display: grid;
	grid-template-columns: var(--ec-time-col) repeat(7, 1fr);
	border-bottom: 1px solid #e0e0e0;
	min-height: 30px;
}

.ec-week-allday-label {
	font-size: 0.7em;
	color: #888;
	padding: 6px 4px;
	text-align: center;
	border-right: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ec-week-allday-cell {
	padding: 3px 2px;
	border-right: 1px solid #eee;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ec-week-allday-cell:last-child {
	border-right: none;
}

/* Time grid */
.ec-week-body {
	max-height: 600px;
	overflow-y: auto;
}

.ec-week-time-grid {
	display: grid;
	grid-template-columns: var(--ec-time-col) repeat(7, 1fr);
	position: relative;
}

.ec-week-time-column {
	border-right: 1px solid #eee;
}

.ec-week-time-slot {
	height: 48px;
	border-bottom: 1px solid #f0f0f0;
	padding: 2px 6px;
	font-size: 0.7em;
	color: #999;
	text-align: right;
}

.ec-week-day-column {
	border-right: 1px solid #eee;
	position: relative;
}

.ec-week-day-column:last-child {
	border-right: none;
}

.ec-week-hour-cell {
	height: 48px;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.ec-week-hour-cell:hover {
	background: #fef8f8;
}

.ec-week-event {
	position: absolute;
	left: 2px;
	right: 2px;
	border-radius: 4px;
	padding: 3px 6px;
	font-size: 0.72em;
	line-height: 1.3;
	color: #fff;
	overflow: hidden;
	cursor: pointer;
	z-index: 1;
	transition: opacity 0.15s ease;
	box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ec-week-event:hover {
	opacity: 0.85;
	z-index: 2;
}

.ec-week-event-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ec-week-event-time {
	font-size: 0.9em;
	opacity: 0.9;
}

/* ==========================================================================
   Day View
   ========================================================================== */

.ec-day-grid {
	--ec-time-col: 70px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

/* Day all-day row */
.ec-day-allday-row {
	display: flex;
	align-items: stretch;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f9fa;
	min-height: 36px;
}

.ec-day-allday-label {
	width: var(--ec-time-col);
	flex-shrink: 0;
	font-size: 0.75em;
	color: #888;
	padding: 8px 6px;
	text-align: right;
	border-right: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	font-weight: 600;
}

.ec-day-allday-events {
	flex: 1;
	padding: 4px 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	align-items: center;
}

/* Day time grid */
.ec-day-body {
	max-height: 600px;
	overflow-y: auto;
}

.ec-day-time-grid {
	display: grid;
	grid-template-columns: var(--ec-time-col) 1fr;
	position: relative;
}

.ec-day-time-column {
	border-right: 1px solid #eee;
}

.ec-day-time-slot {
	height: 48px;
	border-bottom: 1px solid #f0f0f0;
	padding: 2px 8px;
	font-size: 0.75em;
	color: #999;
	text-align: right;
}

.ec-day-events-column {
	position: relative;
}

.ec-day-hour-cell {
	height: 48px;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.ec-day-hour-cell:hover {
	background: #fef8f8;
}

.ec-day-event {
	position: absolute;
	left: 4px;
	right: 4px;
	border-radius: 6px;
	padding: 6px 10px;
	font-size: 0.85em;
	line-height: 1.4;
	color: #fff;
	overflow: hidden;
	cursor: pointer;
	z-index: 1;
	transition: opacity 0.15s ease;
	box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.ec-day-event:hover {
	opacity: 0.85;
	z-index: 2;
}

.ec-day-event-title {
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ec-day-event-time {
	font-size: 0.88em;
	opacity: 0.9;
}

.ec-day-event-venue {
	font-size: 0.82em;
	opacity: 0.85;
	margin-top: 2px;
}

/* ==========================================================================
   List View
   ========================================================================== */

.ec-list-view {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ec-list-date-group {
	border-bottom: 1px solid #e0e0e0;
}

.ec-list-date-group:last-child {
	border-bottom: none;
}

.ec-list-date-header {
	background: #f8f9fa;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid #eee;
}

.ec-list-date-day {
	font-weight: 700;
	font-size: 0.95em;
	color: #222;
}

.ec-list-date-weekday {
	font-size: 0.85em;
	color: #888;
	font-weight: 500;
}

.ec-list-event {
	display: flex;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.15s ease;
}

.ec-list-event:last-child {
	border-bottom: none;
}

.ec-list-event:hover {
	background: #fef8f8;
}

.ec-list-event-color {
	width: 4px;
	flex-shrink: 0;
}

.ec-list-event-image {
	width: 100px;
	min-height: 80px;
	flex-shrink: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.ec-list-event-content {
	flex: 1;
	padding: 12px 16px;
	min-width: 0;
}

.ec-list-event-title {
	font-size: 1em;
	font-weight: 600;
	color: #222;
	margin-bottom: 4px;
	line-height: 1.3;
}

.ec-list-event-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 0.85em;
	color: #666;
	margin-bottom: 6px;
}

.ec-list-event-time::before {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 4px;
	vertical-align: -1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
}

.ec-list-event-venue::before {
	content: '';
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 4px;
	vertical-align: -1px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
}

.ec-list-event-excerpt {
	font-size: 0.85em;
	color: #777;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ==========================================================================
   Tooltip
   ========================================================================== */

.ec-tooltip {
	position: fixed;
	z-index: 100000;
	pointer-events: none;
}

.ec-tooltip-inner {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	max-width: 320px;
	min-width: 240px;
}

.ec-tooltip-image {
	width: 100%;
	height: 0;
	overflow: hidden;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.ec-tooltip-image.ec-has-image {
	height: 160px;
}

.ec-tooltip-content {
	padding: 14px 16px;
}

.ec-tooltip-title {
	font-size: 1em;
	font-weight: 700;
	margin: 0 0 8px;
	color: #222;
	line-height: 1.3;
}

.ec-tooltip-date,
.ec-tooltip-time,
.ec-tooltip-venue,
.ec-tooltip-cost {
	font-size: 0.85em;
	color: #555;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ec-tooltip-date::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
	flex-shrink: 0;
}

.ec-tooltip-time::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
	flex-shrink: 0;
}

.ec-tooltip-venue::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
	flex-shrink: 0;
}

.ec-tooltip-cost::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E") no-repeat center;
	background-size: contain;
	flex-shrink: 0;
}

/* ==========================================================================
   No Events / Empty States
   ========================================================================== */

.ec-no-events {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 0.95em;
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.ec-widget-event {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.ec-widget-event:last-child {
	border-bottom: none;
}

.ec-widget-event-thumb {
	width: 50px;
	height: 50px;
	border-radius: 4px;
	overflow: hidden;
	flex-shrink: 0;
}

.ec-widget-event-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ec-widget-event-details {
	flex: 1;
	min-width: 0;
}

.ec-widget-event-title {
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.3;
	margin-bottom: 2px;
}

.ec-widget-event-title a {
	text-decoration: none;
	color: inherit;
}

.ec-widget-event-title a:hover {
	color: #ed2736;
}

.ec-widget-event-date,
.ec-widget-event-time,
.ec-widget-event-venue {
	font-size: 0.8em;
	color: #777;
	line-height: 1.4;
}

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

.ec-upcoming-events {
	margin: 20px 0;
}

.ec-upcoming-event {
	display: flex;
	gap: 14px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
}

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

.ec-upcoming-event-image {
	width: 80px;
	height: 80px;
	border-radius: 6px;
	overflow: hidden;
	flex-shrink: 0;
}

.ec-upcoming-event-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ec-upcoming-event-content {
	flex: 1;
	min-width: 0;
}

.ec-upcoming-event-title {
	font-size: 1em;
	font-weight: 600;
	margin-bottom: 4px;
	line-height: 1.3;
}

.ec-upcoming-event-title a {
	text-decoration: none;
	color: inherit;
}

.ec-upcoming-event-title a:hover {
	color: #ed2736;
}

.ec-upcoming-event-meta {
	font-size: 0.85em;
	color: #666;
	line-height: 1.5;
}

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

@media (max-width: 768px) {
	.ec-calendar-header {
		flex-direction: column;
		align-items: stretch;
	}

	.ec-nav {
		justify-content: center;
	}

	.ec-view-switcher {
		justify-content: center;
		flex-wrap: wrap;
	}

	.ec-current-period {
		font-size: 1.15em;
		min-width: auto;
	}

	.ec-day-cell {
		min-height: 70px;
		padding: 2px;
	}

	.ec-event-item {
		font-size: 0.65em;
		padding: 1px 3px;
	}

	.ec-event-time {
		display: none;
	}

	.ec-weekday-header .ec-weekday {
		font-size: 0.7em;
		padding: 8px 2px;
	}

	.ec-day-number {
		font-size: 0.75em;
	}

	/* Week view responsive */
	.ec-week-grid {
		--ec-time-col: 40px;
	}

	.ec-week-header-cell .ec-week-day-number {
		font-size: 1em;
	}

	.ec-week-event {
		font-size: 0.65em;
	}

	/* Day view responsive */
	.ec-day-grid {
		--ec-time-col: 50px;
	}

	.ec-day-event {
		font-size: 0.78em;
		padding: 4px 6px;
	}

	/* List view responsive */
	.ec-list-event-image {
		width: 70px;
		min-height: 60px;
	}

	.ec-list-event-content {
		padding: 10px 12px;
	}

	.ec-tooltip-inner {
		max-width: 260px;
		min-width: 200px;
	}

	.ec-tooltip-image.ec-has-image {
		height: 120px;
	}
}

@media (max-width: 480px) {
	.ec-day-cell {
		min-height: 50px;
	}

	.ec-event-item {
		font-size: 0.6em;
	}

	.ec-day-events .ec-event-item:nth-child(n+2) {
		display: none;
	}

	.ec-more-events {
		font-size: 0.65em;
	}

	.ec-week-body {
		max-height: 400px;
	}

	.ec-day-body {
		max-height: 400px;
	}

	.ec-list-event-image {
		display: none;
	}

	.ec-list-event-excerpt {
		display: none;
	}

	.ec-view-btn {
		padding: 6px 10px;
		font-size: 12px;
	}
}
