/* ============================================================
   Gestion Stage Parapente — Calendrier public
   Préfixes .gsp- pour éviter les collisions avec le thème.
   Design "moderne" v1.35.19 : barre de filtres par type + panneau
   latéral de détail (clic sur un stage) au lieu du survol.
   ============================================================ */

.gsp-calendar-wrapper {
	margin: 24px 0;
	font-size: 14px;
	line-height: 1.4;
	--gsp-cal-radius: 14px;
}

/* ----- Barre de filtres par type ----- */
.gsp-calendar-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.gsp-cal-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #fff;
	border: 1px solid #e2e5e9;
	border-radius: 999px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.gsp-cal-pill:hover {
	border-color: #c3c7cd;
}
.gsp-cal-pill-all.gsp-cal-pill-active {
	background: #1c2733;
	border-color: #1c2733;
	color: #fff;
}
.gsp-cal-pill:not(.gsp-cal-pill-all).gsp-cal-pill-active {
	border-color: currentColor;
	background: #f5f6f8;
}
.gsp-cal-pill-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* ----- Mise en page : calendrier + panneau latéral -----
   Reste côte à côte au-dessus du breakpoint mobile, MÊME dans une
   colonne de contenu de thème étroite (le `flex-wrap` testé en v1.35.20
   faisait passer le panneau sous le calendrier dès que le conteneur
   était plus étroit que ~780px, ce qu'Alexis ne voulait pas — il
   préfère que les deux rétrécissent proportionnellement plutôt que de
   voir le panneau descendre tant qu'on est au-dessus du breakpoint
   mobile). Le calendrier reçoit 2x plus d'espace disponible que le
   panneau (`flex-grow` 2 contre 1), avec des `min-width` qui évitent
   que l'un des deux devienne illisible. */
.gsp-calendar-layout {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.gsp-calendar {
	flex: 2 1 0%;
	min-width: 300px; /* en dessous, mieux vaut un scroll interne que 7 colonnes illisibles */
	background: #fff;
	border-radius: var(--gsp-cal-radius);
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
}

.gsp-calendar-sidebar {
	flex: 1 1 0%;
	min-width: 220px;
	max-width: 300px;
	position: sticky;
	top: 20px;
}

@media (max-width: 900px) {
	.gsp-calendar-layout {
		flex-direction: column;
	}
	.gsp-calendar-sidebar {
		width: 100%;
		max-width: none;
		min-width: 0;
		flex-basis: auto;
		position: static;
	}
}

.gsp-calendar-loading {
	padding: 60px 20px;
	text-align: center;
	color: #777;
	font-style: italic;
}

.gsp-calendar-is-loading {
	opacity: 0.6;
	transition: opacity 0.2s;
}

/* ----- Panneau latéral : détail du stage sélectionné ----- */
.gsp-sidebar-empty {
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: var(--gsp-cal-radius);
	padding: 24px 18px;
	text-align: center;
	color: #6b7280;
	font-size: 13px;
}
.gsp-sidebar-card {
	background: #fdf6ec;
	border: 1px solid #f0e2cc;
	border-left: 5px solid #3788d8;
	border-radius: var(--gsp-cal-radius);
	padding: 20px;
}
.gsp-sidebar-finished-badge {
	display: inline-block;
	background: #e5e7eb;
	color: #4b5563;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	padding: 2px 8px;
	border-radius: 999px;
}
.gsp-sidebar-type {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #6b7280;
	margin-bottom: 8px;
}
.gsp-sidebar-title {
	font-size: 22px;
	font-weight: 700;
	color: #1c2733;
	line-height: 1.2;
	margin-bottom: 2px;
}
.gsp-sidebar-subtitle {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 16px;
}
.gsp-sidebar-info-row {
	font-size: 13px;
	color: #374151;
	margin-bottom: 8px;
}
.gsp-sidebar-full {
	color: #b91c1c;
	font-weight: 600;
}
.gsp-sidebar-reserve {
	display: block;
	text-align: center;
	background: #0f5c66;
	color: #fff !important;
	font-weight: 600;
	padding: 12px 16px;
	border-radius: 999px;
	margin-top: 16px;
	text-decoration: none;
	transition: background 0.15s;
}
.gsp-sidebar-reserve:hover {
	background: #0a454d;
}
.gsp-sidebar-reserve-disabled {
	background: #d1d5db;
	color: #6b7280 !important;
	cursor: not-allowed;
}
.gsp-sidebar-reserve-pack {
	background: #1a7f37;
}
.gsp-sidebar-reserve-pack:hover {
	background: #14662c;
}
.gsp-sidebar-pack-note {
	margin-top: 8px;
	text-align: center;
	font-size: 12px;
	color: #1a7f37;
	font-weight: 600;
}
.gsp-sidebar-reserve-alt {
	display: block;
	margin-top: 8px;
	text-align: center;
	font-size: 12px;
	color: #6b7280;
	text-decoration: underline;
}
.gsp-sidebar-pack {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding: 11px 16px;
	border: 2px solid #0f5c66;
	border-radius: 999px;
	color: #0f5c66 !important;
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
	transition: background 0.15s, color 0.15s;
}
.gsp-sidebar-pack:hover {
	background: #0f5c66;
	color: #fff !important;
}
.gsp-sidebar-pack-price {
	white-space: nowrap;
}
.gsp-sidebar-program {
	display: block;
	width: 100%;
	text-align: center;
	font-size: 13px;
	color: #0f5c66;
	margin-top: 10px;
	text-decoration: underline;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}

/* ----- Popup "Voir le programme" ----- */
.gsp-program-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(28, 39, 51, 0.55);
	z-index: 100000;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.gsp-program-modal-overlay.gsp-program-modal-open {
	display: flex;
}
.gsp-program-modal {
	position: relative;
	background: #fff;
	/* Valeur fixe (pas var(--gsp-cal-radius)) : la modale est ajoutée à
	   document.body en JS, donc hors du scope où cette variable est
	   définie (.gsp-calendar-wrapper) — elle ne l'hériterait jamais. */
	border-radius: 14px;
	padding: 28px 24px 24px;
	max-width: 520px;
	width: 100%;
	max-height: 80vh;
	overflow-y: auto;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.gsp-program-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	background: none;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	padding: 4px;
}
.gsp-program-modal-close:hover {
	color: #1c2733;
}
.gsp-program-modal-type {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #6b7280;
	margin-bottom: 6px;
}
.gsp-program-modal-title {
	font-size: 20px;
	font-weight: 700;
	color: #1c2733;
	margin: 0 0 14px;
}
.gsp-program-modal-body {
	font-size: 14px;
	line-height: 1.6;
	color: #374151;
}
.gsp-sidebar-others-title {
	font-size: 13px;
	font-weight: 600;
	color: #1c2733;
	margin-top: 20px;
	padding-top: 14px;
	border-top: 1px solid #f0e2cc;
}
.gsp-sidebar-others-empty {
	font-size: 12px;
	color: #9ca3af;
	margin-top: 8px;
}
.gsp-sidebar-others-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
}
.gsp-sidebar-others-list li {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 0;
	font-size: 13px;
	color: #374151;
	border-bottom: 1px solid #f3ead9;
	cursor: pointer;
}
.gsp-sidebar-others-list li:last-child {
	border-bottom: 0;
}
.gsp-sidebar-others-list li:hover {
	color: #0f5c66;
}
.gsp-sidebar-others-full {
	color: #b91c1c;
	font-weight: 600;
}
/* « Afficher plus / moins » sous la liste des autres dates : simple lien texte. Les thèmes (Astra…)
   donnent un fond coloré à tous les <button>, survol et focus compris : on l'annule dans tous les états. */
.gsp-calendar-sidebar .gsp-sidebar-others-more,
.gsp-calendar-sidebar .gsp-sidebar-others-more:hover,
.gsp-calendar-sidebar .gsp-sidebar-others-more:focus,
.gsp-calendar-sidebar .gsp-sidebar-others-more:active {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 8px 0;
	min-height: 36px;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0;
	box-shadow: none !important;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	color: #0f5c66 !important;
	text-decoration: underline;
	text-align: left;
	cursor: pointer;
}
.gsp-calendar-sidebar .gsp-sidebar-others-more:hover {
	color: #0a3f46 !important;
}
.gsp-calendar-sidebar .gsp-sidebar-others-more:focus-visible {
	outline: 2px solid #0f5c66;
	outline-offset: 2px;
}

/* ----- Surcharges FullCalendar pour un look plus moderne ----- */
.gsp-calendar .fc-toolbar-title {
	font-size: 18px;
	font-weight: 700;
	text-transform: capitalize;
	color: #1c2733;
}

.gsp-calendar .fc-button {
	border-radius: 999px !important;
	text-transform: none;
	box-shadow: none !important;
}
.gsp-calendar .fc-button-primary {
	background: #fff;
	border-color: #e2e5e9;
	color: #333;
}
.gsp-calendar .fc-button-primary:not(:disabled):hover {
	background: #f5f6f8;
	border-color: #c3c7cd;
	color: #333;
}
.gsp-calendar .fc-button-primary:not(:disabled).fc-button-active,
.gsp-calendar .fc-button-primary:not(:disabled):active {
	background: #1c2733;
	border-color: #1c2733;
	color: #fff;
}
.gsp-calendar .fc-button:focus {
	box-shadow: 0 0 0 2px rgba(28, 39, 51, 0.25) !important;
}
.gsp-calendar .fc-today-button {
	text-transform: capitalize;
}

.gsp-calendar .fc-daygrid-day-number {
	font-size: 13px;
	color: #6b7280;
	padding: 6px;
}
.gsp-calendar .fc-day-today {
	background: transparent !important;
}
.gsp-calendar .fc-day-today .fc-daygrid-day-number {
	background: #1c2733;
	color: #fff;
	border-radius: 50%;
	width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 4px;
}
.gsp-calendar .fc-col-header-cell {
	background: transparent;
	border: none;
	padding: 8px 0;
}
.gsp-calendar .fc-col-header-cell-cushion {
	font-weight: 600;
	color: #6b7280;
	text-transform: capitalize;
	font-size: 12px;
}
.gsp-calendar table.fc-scrollgrid,
.gsp-calendar .fc-scrollgrid td,
.gsp-calendar .fc-scrollgrid th {
	border-color: #f0f1f3;
}

.gsp-calendar .fc-event {
	cursor: pointer;
	background: transparent;
	border: none;
	padding: 1px 2px;
	transition: opacity 0.15s;
}
.gsp-calendar .fc-event:hover {
	opacity: 0.8;
}
.gsp-calendar .fc-event.gsp-event-selected {
	background: #eef2f6;
	border-radius: 4px;
}

.gsp-calendar .fc-event.gsp-event-full {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ----- Contenu enrichi des events : pastille + titre + statut ----- */
.gsp-event-grid {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 2px 0;
	line-height: 1.2;
	color: #1c2733;
	font-weight: 500;
}
.gsp-event-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}
.gsp-event-grid-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.gsp-event-grid-status {
	font-size: 10px;
	font-weight: 400;
	color: #9ca3af;
	white-space: nowrap;
}
.gsp-event-list-title {
	font-weight: 600;
}
.gsp-event-list-places {
	color: #6b7280;
	font-size: 13px;
}
.gsp-calendar .fc-event.gsp-event-full .gsp-event-grid-status {
	color: #b91c1c;
}

/* Vue liste — un peu plus aérée */
.gsp-calendar .fc-list-event:hover td {
	background: #f3f6fb;
}
.gsp-calendar .fc-list-day-cushion {
	background: #f5f6f8;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
	.gsp-calendar {
		padding: 8px;
		font-size: 13px;
	}
	.gsp-calendar .fc-toolbar {
		flex-direction: column;
		gap: 8px;
	}
	.gsp-calendar .fc-toolbar-title {
		font-size: 16px;
	}
	.gsp-calendar .fc-button {
		font-size: 13px;
		padding: 4px 10px !important;
	}
	.gsp-cal-pill {
		padding: 6px 12px;
		font-size: 12px;
	}
}

/* ----- Sélection de plusieurs dates (réservation groupée, un seul paiement) ----- */
.gsp-calendar .fc-event.gsp-event-picked {
	box-shadow: 0 0 0 2px #1a7f37;
	background: #e8f5ec;
}
.gsp-calendar .fc-event.gsp-event-picked .gsp-event-grid-title::before {
	content: '✓ ';
	color: #1a7f37;
	font-weight: 700;
}
.gsp-sidebar-pick-toggle {
	display: block;
	width: 100%;
	margin-top: 10px;
	padding: 10px 16px;
	border: 2px dashed #1a7f37;
	border-radius: 999px;
	background: transparent;
	color: #1a7f37;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.gsp-sidebar-pick-toggle:hover,
.gsp-sidebar-pick-toggle-on {
	background: #1a7f37;
	border-style: solid;
	color: #fff;
}
.gsp-calendar-tray {
	margin-top: 16px;
	padding: 18px 20px;
	background: #f0f9f2;
	border: 1px solid #b7dfc2;
	border-left: 5px solid #1a7f37;
	border-radius: var(--gsp-cal-radius);
}
.gsp-tray-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 8px;
}
.gsp-tray-clear {
	margin-left: auto;
	background: none;
	border: none;
	color: #6b7280;
	text-decoration: underline;
	font-size: 12px;
	cursor: pointer;
	padding: 0;
}
.gsp-tray-list {
	list-style: none;
	margin: 10px 0;
	padding: 0;
}
.gsp-tray-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
	border-bottom: 1px solid #dcebdf;
}
.gsp-tray-list li > span:nth-child(2) {
	flex: 1;
}
.gsp-tray-remove {
	background: none;
	border: none;
	color: #6b7280;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}
.gsp-tray-remove:hover {
	color: #b91c1c;
}
.gsp-tray-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: stretch;
}
.gsp-tray-actions > a {
	flex: 1 1 220px;
	margin-top: 8px;
}
.gsp-tray-hint {
	margin: 10px 0 0;
	font-size: 12px;
	color: #4b5563;
}
.gsp-tray-warn {
	color: #b45309;
	font-weight: 600;
}

/* ----- Stage où la personne connectée est déjà inscrite ----- */
.gsp-calendar .fc-event.gsp-event-mine {
	border-left: 4px solid #1a7f37;
	background: #eaf6ee;
}
.gsp-calendar .fc-event.gsp-event-mine .gsp-event-grid-status {
	color: #1a7f37;
	font-weight: 700;
}
.gsp-event-list-mine {
	color: #1a7f37;
}
.gsp-sidebar-mine {
	margin: 10px 0 4px;
	padding: 9px 12px;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}
.gsp-sidebar-mine-confirmed {
	background: #e3f4e8;
	color: #14662c;
	border: 1px solid #b7dfc2;
}
.gsp-sidebar-mine-pending {
	background: #fff4dd;
	color: #8a5a00;
	border: 1px solid #f0d9a4;
}
/* Descriptions : les retours à la ligne saisis dans l'administration sont conservés. */
.gsp-program-modal-body {
	white-space: pre-line;
}
