/* ================================================================
 * UDC Cours de cuisine - calendrier moderne
 * ================================================================ */
:root {
	--udc-cc-primary: #EDBF14;
	--udc-cc-primary-dark: #C9A00F;
	--udc-cc-primary-soft: rgba(237, 191, 20, 0.14);
	--udc-cc-success: #16a34a;
	--udc-cc-success-soft: rgba(22, 163, 74, 0.12);
	--udc-cc-warning: #f97316;
	--udc-cc-warning-soft: rgba(249, 115, 22, 0.14);
	--udc-cc-danger: #dc2626;
	--udc-cc-danger-soft: rgba(220, 38, 38, 0.12);
	--udc-cc-text: #0f172a;
	--udc-cc-text-muted: #64748b;
	--udc-cc-border: #e2e8f0;
	--udc-cc-bg: #ffffff;
	--udc-cc-bg-alt: #f8fafc;
}

.udc-cours-calendar {
	max-width: min(1100px, 100%);
	margin: 48px auto;
	padding: 32px;
	background: var(--udc-cc-bg);
	border-radius: 24px;
	box-shadow: 0 4px 32px rgba(15, 23, 42, 0.06);
	border: 1px solid var(--udc-cc-border);
	font-family: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
	color: var(--udc-cc-text);
	box-sizing: border-box;
	overflow: hidden;
}
.udc-cours-calendar *,
.udc-cours-calendar *::before,
.udc-cours-calendar *::after {
	box-sizing: border-box;
}

/* -------- Header navigation mois -------- */
.udc-cc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}
.udc-cc-title {
	margin: 0;
	font-size: 1.6rem;
	font-weight: 700;
	text-transform: capitalize;
	letter-spacing: -0.02em;
}
.udc-cc-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	border: 1px solid var(--udc-cc-border);
	background: var(--udc-cc-bg);
	color: var(--udc-cc-text);
	cursor: pointer;
	transition: all 0.25s ease;
}
.udc-cc-nav:hover:not(:disabled) {
	background: var(--udc-cc-primary);
	border-color: var(--udc-cc-primary);
	color: #fff;
	transform: translateY(-1px);
}
.udc-cc-nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}
.udc-cc-nav svg {
	width: 20px;
	height: 20px;
}

/* -------- Weekdays -------- */
.udc-cc-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 8px;
	margin-bottom: 12px;
	padding: 0 4px;
}
.udc-cc-weekdays span {
	text-align: center;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--udc-cc-text-muted);
}

/* -------- Grid -------- */
.udc-cc-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
	min-width: 0;
}
.udc-cc-day {
	min-width: 0;
	border-radius: 14px;
	background: var(--udc-cc-bg-alt);
	border: 1px solid transparent;
	padding: 8px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	transition: all 0.2s ease;
}
/* Desktop uniquement : aspect-ratio + min-height (interdit sur mobile car ça calcule width depuis height) */
@media (min-width: 769px) {
	.udc-cc-day {
		aspect-ratio: 1 / 1;
		min-height: 72px;
	}
}
.udc-cc-day--outside {
	opacity: 0.3;
}
.udc-cc-day--today {
	border-color: var(--udc-cc-primary);
}
.udc-cc-day--today::after {
	content: '';
	position: absolute;
	top: 6px;
	right: 6px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--udc-cc-primary);
}
.udc-cc-day-number {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--udc-cc-text);
}
.udc-cc-day--outside .udc-cc-day-number {
	color: var(--udc-cc-text-muted);
}
.udc-cc-day-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	padding: 3px 8px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}
.udc-cc-day--has-session {
	cursor: pointer;
	background: var(--udc-cc-primary-soft);
	border-color: var(--udc-cc-primary);
}
.udc-cc-day--has-session:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(237, 191, 20, 0.25);
}
.udc-cc-day--full {
	background: var(--udc-cc-danger-soft);
	border-color: var(--udc-cc-danger);
}
.udc-cc-day--full .udc-cc-day-badge {
	background: var(--udc-cc-danger);
	color: #fff;
}
.udc-cc-day--few {
	background: var(--udc-cc-warning-soft);
	border-color: var(--udc-cc-warning);
}
.udc-cc-day--few .udc-cc-day-badge {
	background: var(--udc-cc-warning);
	color: #fff;
}
.udc-cc-day--available .udc-cc-day-badge {
	background: var(--udc-cc-primary);
	color: var(--udc-cc-text);
}

/* -------- Liste prochaines sessions (mobile + desktop) -------- */
.udc-cc-upcoming {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--udc-cc-border);
}
.udc-cc-upcoming--top {
	margin-top: 0;
	margin-bottom: 32px;
	padding-top: 0;
	padding-bottom: 24px;
	border-top: none;
	border-bottom: 1px solid var(--udc-cc-border);
}
.udc-cc-upcoming h3 {
	margin: 0 0 16px;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--udc-cc-text);
}
.udc-cc-upcoming-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 12px;
}
.udc-cc-upcoming-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	background: var(--udc-cc-bg-alt);
	border: 1px solid var(--udc-cc-border);
	border-radius: 14px;
	transition: all 0.2s ease;
}
.udc-cc-upcoming-item:hover {
	border-color: var(--udc-cc-primary);
	transform: translateY(-1px);
}
.udc-cc-upcoming-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 52px;
	padding: 8px 6px;
	background: var(--udc-cc-bg);
	border-radius: 10px;
	border: 1px solid var(--udc-cc-border);
	text-align: center;
}
.udc-cc-upcoming-date-day {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1;
	color: var(--udc-cc-text);
}
.udc-cc-upcoming-date-month {
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--udc-cc-text-muted);
	margin-top: 3px;
}
.udc-cc-upcoming-info {
	flex: 1;
	min-width: 0;
}
.udc-cc-upcoming-time {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--udc-cc-text);
	margin-bottom: 4px;
}
.udc-cc-upcoming-meta {
	font-size: 0.78rem;
	color: var(--udc-cc-text-muted);
}
.udc-cc-upcoming-places {
	font-size: 0.78rem;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 999px;
	white-space: nowrap;
}
.udc-cc-upcoming-places--available {
	background: var(--udc-cc-success-soft);
	color: var(--udc-cc-success);
}
.udc-cc-upcoming-places--few {
	background: var(--udc-cc-warning-soft);
	color: var(--udc-cc-warning);
}
.udc-cc-upcoming-places--full {
	background: var(--udc-cc-danger-soft);
	color: var(--udc-cc-danger);
}

/* -------- Legend -------- */
.udc-cc-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 20px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--udc-cc-border);
	font-size: 0.82rem;
	color: var(--udc-cc-text-muted);
}
.udc-cc-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.udc-cc-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
}
.udc-cc-dot--available {
	background: var(--udc-cc-primary);
}
.udc-cc-dot--few {
	background: var(--udc-cc-warning);
}
.udc-cc-dot--full {
	background: var(--udc-cc-danger);
}

/* -------- Loading / Empty / Error states -------- */
.udc-cc-loading,
.udc-cc-empty,
.udc-cc-error {
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	text-align: center;
	color: var(--udc-cc-text-muted);
	font-size: 0.95rem;
}
.udc-cc-spinner {
	width: 38px;
	height: 38px;
	border: 3px solid var(--udc-cc-border);
	border-top-color: var(--udc-cc-primary);
	border-radius: 50%;
	animation: udc-cc-spin 0.9s linear infinite;
	margin-bottom: 14px;
}
@keyframes udc-cc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* -------- Responsive -------- */
@media screen and (max-width: 768px) {
	.udc-cours-calendar {
		margin: 24px 8px;
		padding: 16px 10px;
		border-radius: 18px;
	}
	.udc-cc-header {
		margin-bottom: 16px;
	}
	.udc-cc-title {
		font-size: 1.15rem;
	}
	.udc-cc-nav {
		width: 36px;
		height: 36px;
	}
	.udc-cc-weekdays {
		gap: 3px;
		padding: 0;
	}
	.udc-cc-weekdays span {
		font-size: 0.62rem;
	}
	.udc-cc-grid {
		gap: 3px;
	}
	.udc-cc-day {
		height: 52px;
		padding: 4px 2px;
		border-radius: 8px;
		justify-content: flex-start;
		gap: 2px;
	}
	.udc-cc-day-number {
		font-size: 0.78rem;
	}
	.udc-cc-day-badge {
		font-size: 0.56rem;
		padding: 1px 4px;
		align-self: center;
	}
	.udc-cc-upcoming-list {
		grid-template-columns: 1fr;
	}
}
@media screen and (max-width: 400px) {
	.udc-cours-calendar {
		margin: 20px 4px;
		padding: 14px 8px;
	}
	.udc-cc-grid {
		gap: 2px;
	}
	.udc-cc-day {
		height: 48px;
		padding: 3px 1px;
	}
	.udc-cc-day-number {
		font-size: 0.72rem;
	}
	.udc-cc-day-badge {
		font-size: 0.52rem;
		padding: 1px 3px;
	}
}
