/* ===== OCCA School Calendar — Frontend ===== */

.occa-calendar-wrap {
	font-family: inherit;
	max-width: 100%;
	--occa-color-accent: #E27B1B;
}

/* ----- Header ----- */
.occa-cal-header {
	margin-bottom: 20px;
}

.occa-cal-title {
	font-size: 2rem;
	font-weight: 700;
	color: #374151;
	margin: 0 0 8px;
}

.occa-cal-desc {
	color: #535962;
	font-size: 1rem;
	margin: 0;
}

/* ----- Toolbar ----- */
.occa-cal-toolbar {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	margin-bottom: 16px;
}

/* ----- Category filter dropdown ----- */
.occa-cal-filter-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.occa-filter-label {
	font-size: 0.75rem;
	font-weight: 500;
	color: #6F7C8E;
	letter-spacing: 0.02em;
}

.occa-filter-select-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.occa-filter-select {
	appearance: none;
	-webkit-appearance: none;
	background: #fff;
	border: 1px solid #DFE4E8;
	border-radius: 6px;
	padding: 8px 36px 8px 12px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	min-width: 180px;
	transition: border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
}

.occa-filter-select:hover {
	border-color: #c8d0d8;
}

.occa-filter-select:focus {
	outline: none;
	border-color: var(--occa-color-accent);
	box-shadow: 0 0 0 2px rgba(226,123,27,0.18);
}

.occa-filter-chevron {
	position: absolute;
	right: 10px;
	pointer-events: none;
	color: #6F7C8E;
	display: flex;
	align-items: center;
}

/* ----- Action buttons (bottom) ----- */
.occa-cal-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: flex-end;
	margin-top: 20px;
}

.occa-btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s;
	white-space: nowrap;
}

.occa-btn:hover { opacity: 0.88; text-decoration: none; }

.occa-btn-primary { color: #fff; }

.occa-btn-secondary {
	border: 2px solid #DFE4E8;
	background: #fff;
	color: #374151;
}

/* ----- FullCalendar global overrides ----- */
#occa-calendar-fc {
	border: 1px solid #DFE4E8;
	border-radius: 10px;
	overflow: hidden;
}

.occa-calendar-wrap .fc {
	font-family: inherit;
	font-size: 0.9rem;
}

/* Column headers (MON, TUE …) */
.occa-calendar-wrap .fc-col-header-cell {
	background: #F6F7F9;
	padding: 8px 0;
}

.occa-calendar-wrap .fc-col-header-cell-cushion {
	font-size: 0.75rem;
	font-weight: 600;
	color: #6F7C8E;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
}

/* Day number in month grid */
.occa-calendar-wrap .fc-daygrid-day-number {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #374151;
	text-decoration: none;
	padding: 6px 8px;
}

/* Today highlight */
.occa-calendar-wrap .fc-day-today {
	background: #fff !important;
}

.occa-calendar-wrap .fc-day-today .fc-daygrid-day-number {
	color: var(--occa-color-accent);
	font-weight: 700;
	background: rgba(226,123,27,0.12);
	border-radius: 50%;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

/* Other-month days */
.occa-calendar-wrap .fc-day-other .fc-daygrid-day-number {
	color: #B6C1CA;
}

.occa-calendar-wrap .fc-day-other {
	background: #F9FAFB;
}

/* ----- Event pills ----- */
.occa-calendar-wrap .fc-event {
	border: none;
	border-radius: 4px;
	padding: 1px 5px;
	font-size: 0.6875rem;
	font-weight: 500;
	cursor: pointer;
	transition: filter 0.15s, box-shadow 0.15s;
}

.occa-calendar-wrap .fc-event:hover {
	filter: brightness(0.92);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.occa-calendar-wrap .fc-event-title,
.occa-calendar-wrap .fc-event-time {
	font-weight: 500;
}

.occa-pill-text {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.6875rem;
	line-height: 1.4;
}

/* Block (all-day) events */
.occa-calendar-wrap .fc-daygrid-event.fc-daygrid-block-event {
	border-radius: 4px;
	padding: 2px 6px;
}

/* Dot events (when too many to show) */
.occa-calendar-wrap .fc-daygrid-event-dot {
	border-color: currentColor;
}

/* "+N more" link */
.occa-calendar-wrap .fc-daygrid-more-link {
	font-size: 0.6875rem;
	color: #6F7C8E;
	text-decoration: none;
	font-weight: 500;
}

.occa-calendar-wrap .fc-daygrid-more-link:hover {
	color: var(--occa-color-accent);
}

/* Time grid (week/day) events */
.occa-calendar-wrap .fc-timegrid-event {
	border-radius: 4px;
	border: none;
	padding: 3px 6px;
	font-size: 0.6875rem;
}

/* List view */
.occa-calendar-wrap .fc-list-event {
	cursor: pointer;
}

.occa-calendar-wrap .fc-list-event:hover td {
	background: #F9FAFB;
}

.occa-calendar-wrap .fc-list-event-dot {
	border-radius: 50%;
}

.occa-calendar-wrap .fc-list-day-cushion {
	background: #F6F7F9;
}

/* Toolbar nav buttons */
.occa-calendar-wrap .fc-button {
	background: #fff;
	border: 1px solid #DFE4E8;
	color: #374151;
	font-size: 0.8125rem;
	font-weight: 500;
	transition: background 0.15s;
}

.occa-calendar-wrap .fc-button:hover,
.occa-calendar-wrap .fc-button-active {
	background: #F6F7F9 !important;
	border-color: #c8d0d8 !important;
	color: #374151 !important;
}

.occa-calendar-wrap .fc-button-active {
	font-weight: 700 !important;
}

.occa-calendar-wrap .fc-button:focus {
	box-shadow: 0 0 0 2px rgba(226,123,27,0.3) !important;
}

.occa-calendar-wrap .fc-toolbar-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #374151;
}

/* ----- Event popup ----- */
.occa-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* [hidden] sets display:none via UA sheet; .is-open overrides it */
.occa-popup.is-open {
	display: flex !important;
}

.occa-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	animation: occaFadeIn 0.2s ease;
}

.occa-popup__card {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
	padding: 32px;
	width: 100%;
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	animation: occaSlideUp 0.25s ease;
}

.occa-popup__close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #9CA3AF;
	padding: 4px 8px;
	border-radius: 4px;
	transition: color 0.15s, background 0.15s;
}

.occa-popup__close:hover {
	color: #374151;
	background: #F3F4F6;
}

.occa-popup__header {
	margin-bottom: 10px;
}

.occa-popup__category-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: #DFE4E8;
	color: #374151;
}

.occa-popup__title {
	font-size: 1.25rem;
	font-weight: 700;
	color: #1F2937;
	margin: 0 0 18px;
	padding-right: 20px;
	line-height: 1.3;
}

.occa-popup__meta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.occa-popup__meta-row {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.occa-popup__meta-icon {
	color: #9CA3AF;
	flex-shrink: 0;
	margin-top: 1px;
}

.occa-popup__meta-text {
	font-size: 0.875rem;
	color: #4B5563;
	line-height: 1.5;
}

.occa-popup__description {
	font-size: 0.875rem;
	color: #374151;
	line-height: 1.7;
	margin-bottom: 20px;
	padding-top: 16px;
	border-top: 1px solid #EDF0F2;
}

.occa-popup__description:empty {
	display: none;
}

.occa-popup__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 20px;
	border-radius: 6px;
	background: var(--occa-color-accent, #E27B1B);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: opacity 0.15s;
}

.occa-popup__link:hover {
	opacity: 0.88;
	text-decoration: none;
	color: #fff;
}

/* Animations */
@keyframes occaFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

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

/* ----- Responsive ----- */
@media (max-width: 640px) {
	.occa-cal-toolbar {
		justify-content: flex-start;
	}

	.occa-filter-select {
		min-width: 0;
		width: 100%;
	}

	.occa-cal-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.occa-cal-actions .occa-btn {
		justify-content: center;
		width: 100%;
	}

	.occa-calendar-wrap .fc-toolbar {
		flex-wrap: wrap;
		gap: 6px;
	}

	.occa-calendar-wrap .fc-toolbar-title {
		font-size: 0.95rem;
	}

	.occa-calendar-wrap {
		padding: 0;
	}
}

@media (max-width: 600px) {
	.occa-popup {
		align-items: flex-end;
		padding: 0;
	}

	.occa-popup__card {
		max-width: 100%;
		border-radius: 12px 12px 0 0;
		padding: 24px 20px 32px;
		max-height: 92vh;
		animation: occaSlideUpMobile 0.25s ease;
	}

	@keyframes occaSlideUpMobile {
		from { transform: translateY(100%); }
		to   { transform: translateY(0); }
	}
}
