/**
 * Frontend Styles for Simple Event Calendar
 */

:root {
	--sec-accent: #2563eb;
	--sec-accent-hover: #1d4ed8;
	--sec-accent-light: #eff6ff;
	--sec-btn-bg: var(--sec-accent);
	--sec-btn-hover-bg: var(--sec-accent-hover);
	--sec-btn-text: #ffffff;
	--sec-btn-radius: 8px;
	--sec-btn-padding: 10px 18px;
	--sec-btn-font-size: 14px;
	--sec-max-width: 1100px;
	--sec-text-main: #1e293b;
	--sec-text-muted: #475569;
	--sec-bg-card: #ffffff;
	--sec-border: #e2e8f0;
	--sec-radius: 12px;
	--sec-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
	--sec-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.sec-calendar-container {
	width: 100%;
	max-width: var(--sec-max-width);
	margin: 0 auto 40px auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--sec-text-main);
	box-sizing: border-box;
}

.sec-calendar-container.sec-align-left {
	margin-left: 0;
	margin-right: auto;
}

.sec-calendar-container.sec-align-center {
	margin-left: auto;
	margin-right: auto;
}

.sec-calendar-container.sec-align-right {
	margin-left: auto;
	margin-right: 0;
}

.sec-calendar-container *,
.sec-calendar-container *::before,
.sec-calendar-container *::after,
.sec-single-event-wrapper *,
.sec-single-event-wrapper *::before,
.sec-single-event-wrapper *::after {
	box-sizing: border-box;
}

/* Keyboard focus accessibility */
.sec-calendar-container button:focus-visible,
.sec-calendar-container a:focus-visible,
.sec-calendar-container input:focus-visible,
.sec-calendar-container select:focus-visible,
.sec-single-event-wrapper button:focus-visible,
.sec-single-event-wrapper a:focus-visible,
.sec-single-event-wrapper input:focus-visible,
.sec-single-event-wrapper select:focus-visible {
	outline: 2px solid var(--sec-accent);
	outline-offset: 2px;
}

.sec-main-title {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 24px;
	color: var(--sec-text-main);
}

/* View Toggle Bar */
.sec-view-toggle-bar {
	display: inline-flex;
	background: #f1f5f9;
	padding: 4px;
	border-radius: var(--sec-btn-radius);
	margin-bottom: 24px;
	border: 1px solid var(--sec-border);
}

.sec-toggle-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: transparent;
	border: none;
	padding: 8px 18px;
	border-radius: var(--sec-btn-radius);
	font-size: var(--sec-btn-font-size);
	font-weight: 600;
	color: var(--sec-text-muted);
	cursor: pointer;
	transition: all 0.2s ease;
}

.sec-toggle-btn.active {
	background: #ffffff;
	color: var(--sec-accent);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sec-hidden {
	display: none !important;
}

/* Calendar Card */
.sec-calendar-card {
	background: var(--sec-bg-card);
	border: 1px solid var(--sec-border);
	border-radius: var(--sec-radius);
	box-shadow: var(--sec-shadow);
	overflow: hidden;
	position: relative;
}

.sec-calendar-card.sec-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	backdrop-filter: blur(2px);
}

.sec-calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--sec-border);
	background: #fafafa;
}

.sec-month-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0;
	color: var(--sec-text-main);
}

.sec-nav-btn {
	background: #ffffff;
	border: 1px solid var(--sec-border);
	border-radius: var(--sec-btn-radius);
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	font-weight: 600;
	color: var(--sec-text-main);
	cursor: pointer;
	transition: all 0.15s ease;
}

.sec-nav-btn:hover {
	background: var(--sec-btn-bg);
	color: var(--sec-btn-text);
	border-color: var(--sec-btn-bg);
}

/* Weekdays Grid */
.sec-weekdays-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	background: #f8fafc;
	border-bottom: 1px solid var(--sec-border);
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--sec-text-muted);
	padding: 12px 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Days Grid */
.sec-days-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
}

.sec-day-cell {
	min-height: 110px;
	border-right: 1px solid var(--sec-border);
	border-bottom: 1px solid var(--sec-border);
	padding: 8px;
	position: relative;
	background: #ffffff;
	transition: background 0.15s ease;
}

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

.sec-empty-cell {
	background: #fbfcfe;
}

.sec-day-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	font-size: 13px;
	font-weight: 600;
	color: var(--sec-text-muted);
	border-radius: 50%;
	margin-bottom: 4px;
}

.sec-today .sec-day-number {
	background: var(--sec-accent);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
}

.sec-day-events {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sec-calendar-event-pill {
	display: block;
	width: 100%;
	text-align: left;
	background: var(--sec-accent-light);
	color: var(--sec-accent);
	border: none;
	border-left: 3px solid var(--sec-accent);
	padding: 3px 6px;
	border-radius: 4px;
	font-family: inherit;
	font-size: 11px;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	cursor: pointer;
	transition: all 0.15s ease;
}

.sec-calendar-event-pill:hover {
	background: var(--sec-accent);
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sec-pill-time {
	font-weight: 700;
	margin-right: 2px;
}

/* Size Presets */
.sec-size-compact .sec-calendar-header {
	padding: 12px 16px;
}

.sec-size-compact .sec-month-title {
	font-size: 16px;
}

.sec-size-compact .sec-weekdays-grid {
	font-size: 11px;
	padding: 8px 0;
}

.sec-size-compact .sec-day-cell {
	min-height: 70px;
	padding: 4px;
}

.sec-size-compact .sec-day-number {
	width: 22px;
	height: 22px;
	font-size: 12px;
}

.sec-size-compact .sec-pill-time {
	display: none;
}

.sec-size-medium .sec-day-cell {
	min-height: 92px;
	padding: 6px;
}

.sec-size-full .sec-day-cell {
	min-height: 120px;
}

/* List View */
.sec-cards-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.sec-event-card {
	display: flex;
	align-items: stretch;
	background: var(--sec-bg-card);
	border: 1px solid var(--sec-border);
	border-radius: var(--sec-radius);
	padding: 18px 20px;
	box-shadow: var(--sec-shadow);
	gap: 20px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sec-event-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--sec-shadow-lg);
}

.sec-card-date-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--sec-accent-light);
	border: 1px solid var(--sec-border);
	border-radius: var(--sec-btn-radius);
	min-width: 65px;
	height: 70px;
	padding: 8px;
	text-align: center;
	flex-shrink: 0;
}

.sec-badge-month {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: var(--sec-accent);
	letter-spacing: 0.5px;
}

.sec-badge-day {
	font-size: 24px;
	font-weight: 800;
	color: var(--sec-accent);
	line-height: 1.1;
}

.sec-card-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.sec-card-title {
	margin: 0 0 6px 0;
	font-size: 18px;
	font-weight: 700;
}

.sec-card-title-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: var(--sec-text-main);
	text-align: left;
	cursor: pointer;
	transition: color 0.15s ease;
}

.sec-card-title-btn:hover {
	color: var(--sec-accent);
}

.sec-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	font-size: 13px;
	color: var(--sec-text-muted);
	margin-bottom: 8px;
}

.sec-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.sec-meta-item .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #64748b;
}

.sec-meta-cost {
	font-weight: 600;
	color: #047857;
}

.sec-meta-cost .dashicons {
	color: #047857;
}

.sec-card-excerpt {
	font-size: 14px;
	color: var(--sec-text-muted);
	margin: 0 0 10px 0;
	line-height: 1.5;
}

.sec-btn-link {
	background: none;
	border: none;
	color: var(--sec-accent);
	font-weight: 600;
	font-size: 14px;
	padding: 0;
	cursor: pointer;
	text-align: left;
}

.sec-btn-link:hover {
	color: var(--sec-accent-hover);
	text-decoration: underline;
}

/* Empty State */
.sec-empty-state {
	text-align: center;
	padding: 50px 20px;
	background: #f8fafc;
	border: 1px dashed var(--sec-border);
	border-radius: var(--sec-radius);
	color: var(--sec-text-muted);
}

.sec-empty-state .dashicons {
	font-size: 40px;
	width: 40px;
	height: 40px;
	margin-bottom: 10px;
	color: #94a3b8;
}

/* Modal Window */
.sec-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	padding: 16px;
}

.sec-modal.sec-active {
	opacity: 1;
	pointer-events: auto;
}

.sec-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
}

.sec-modal-dialog {
	position: relative;
	background: #ffffff;
	width: 100%;
	max-width: 600px;
	max-height: 90vh;
	border-radius: var(--sec-radius);
	box-shadow: var(--sec-shadow-lg);
	overflow-y: auto;
	transform: scale(0.95);
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 1;
}

.sec-modal.sec-active .sec-modal-dialog {
	transform: scale(1);
}

.sec-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #334155;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease;
}

.sec-modal-close:hover {
	background: #ffffff;
	color: #000000;
}

.sec-modal-image img {
	width: 100%;
	max-height: 240px;
	object-fit: cover;
	border-top-left-radius: var(--sec-radius);
	border-top-right-radius: var(--sec-radius);
}

.sec-modal-title {
	font-size: 22px;
	font-weight: 700;
	padding: 20px 24px 0 24px;
	margin: 0;
	color: var(--sec-text-main);
}

.sec-modal-body {
	padding: 16px 24px 24px 24px;
}

.sec-single-event-wrapper .sec-modal-body {
	padding: 20px 0 0 0;
}

.sec-modal-error-msg {
	padding: 24px;
	color: #b91c1c;
	font-weight: 600;
}

.sec-modal-info-bar {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	background: #f8fafc;
	border: 1px solid var(--sec-border);
	border-radius: 8px;
	padding: 14px;
	margin-bottom: 20px;
}

.sec-info-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}

.sec-info-item .dashicons {
	font-size: 20px;
	color: var(--sec-accent);
	margin-top: 2px;
}

.sec-info-item strong {
	display: block;
	font-size: 12px;
	text-transform: uppercase;
	color: var(--sec-text-muted);
}

.sec-info-item p {
	margin: 2px 0 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--sec-text-main);
}

.sec-modal-description {
	font-size: 15px;
	line-height: 1.6;
	color: #334155;
	margin-bottom: 24px;
}

.sec-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	border-top: 1px solid var(--sec-border);
	padding-top: 20px;
}

.sec-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: var(--sec-btn-padding);
	border-radius: var(--sec-btn-radius);
	font-size: var(--sec-btn-font-size);
	font-weight: 600;
	text-decoration: none;
	transition: all 0.15s ease;
	cursor: pointer;
}

.sec-btn-primary {
	background: var(--sec-btn-bg);
	color: var(--sec-btn-text);
	border: none;
}

.sec-btn-primary:hover {
	background: var(--sec-btn-hover-bg);
	color: var(--sec-btn-text);
}

.sec-calendar-export-group {
	display: flex;
	gap: 10px;
}

.sec-calendar-export-group .sec-action-btn {
	flex: 1;
}

.sec-btn-secondary {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid var(--sec-border);
}

.sec-btn-secondary:hover {
	background: #e2e8f0;
	color: #1e293b;
}

/* Spinner */
.sec-modal-spinner {
	width: 36px;
	height: 36px;
	margin: 40px auto;
	border: 3px solid #e2e8f0;
	border-top-color: var(--sec-accent);
	border-radius: 50%;
	animation: sec-spin 0.8s linear infinite;
}

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

/* Ticketing & Registration Box */
.sec-modal-ticketing-section {
	margin-bottom: 24px;
}

.sec-free-ticket-box {
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: var(--sec-radius);
	padding: 20px;
}

.sec-ticket-box-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 4px 0;
	color: var(--sec-text-main);
}

.sec-tickets-remaining-text {
	font-size: 13px;
	color: var(--sec-accent);
	font-weight: 600;
	margin: 0 0 16px 0;
}

.sec-tickets-low-warning {
	color: #9a3412;
	margin-bottom: 10px;
}

.sec-hp-wrap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sec-required-mark {
	color: #b91c1c;
}

.sec-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr 80px;
	gap: 12px;
	margin-bottom: 14px;
}

.sec-form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sec-form-field label {
	font-size: 12px;
	font-weight: 600;
	color: #334155;
}

.sec-form-field input,
.sec-form-field select {
	padding: 9px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sec-btn-claim {
	width: 100%;
}

.sec-form-feedback {
	margin-top: 14px;
	padding: 14px;
	border-radius: 8px;
	font-size: 14px;
}

.sec-form-feedback.sec-feedback-success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.sec-form-feedback.sec-feedback-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.sec-soldout-banner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 15px;
}

.sec-meta-soldout {
	font-weight: 700;
	color: #b91c1c !important;
}

.sec-meta-soldout .dashicons {
	color: #b91c1c !important;
}

/* WCAG AA compliant contrast (>= 5.18:1 on #ffffff) */
.sec-meta-urgency {
	font-weight: 700;
	color: #c2410c;
}

.sec-ticket-pass-btn {
	display: inline-block;
	background: #15803d;
	color: #ffffff;
	padding: var(--sec-btn-padding);
	border-radius: var(--sec-btn-radius);
	font-size: var(--sec-btn-font-size);
	text-decoration: none;
	font-weight: 700;
	margin-top: 10px;
	transition: background 0.15s ease;
}

.sec-ticket-pass-btn:hover {
	background: #166534;
	color: #ffffff;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.sec-day-cell {
		min-height: 70px;
		padding: 4px;
	}

	.sec-pill-time {
		display: none;
	}

	.sec-calendar-event-pill {
		font-size: 10px;
		padding: 2px 4px;
	}

	.sec-event-card {
		flex-direction: column;
		gap: 12px;
	}

	.sec-card-date-badge {
		flex-direction: row;
		width: 100%;
		height: auto;
		gap: 8px;
		justify-content: flex-start;
	}

	.sec-badge-day {
		font-size: 18px;
	}

	.sec-form-row {
		grid-template-columns: 1fr;
	}

	.sec-calendar-export-group {
		flex-direction: column;
	}
}
