/* =============================================================================
   Booking Calendar Manager — Front-end Styles  v1.0.1
   ============================================================================= */

:root {
	--bcm-primary:      #0D6E6E;
	--bcm-primary-dark: #0a5555;
	--bcm-available:    #16a34a;
	--bcm-avail-bg:     #dcfce7;
	--bcm-full:         #dc2626;
	--bcm-full-bg:      #fee2e2;
	--bcm-disabled-bg:  #f3f4f6;
	--bcm-disabled-fg:  #9ca3af;
	--bcm-today-ring:   #f59e0b;
	--bcm-border:       #e5e7eb;
	--bcm-text:         #111827;
	--bcm-text-muted:   #6b7280;
	--bcm-radius:       10px;
	--bcm-shadow:       0 4px 24px rgba(0,0,0,.09);
	--bcm-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Wrapper ------------------------------------------------------------------*/
.bcm-calendar {
	position: relative;
	font-family: var(--bcm-font);
	max-width: 480px;
	margin: 1.5rem auto;
	background: #fff;
	border: 1px solid var(--bcm-border);
	border-radius: var(--bcm-radius);
	box-shadow: var(--bcm-shadow);
	overflow: hidden;
	-webkit-user-select: none;
	user-select: none;
}

/* ── Optional calendar name banner ─────────────────────────────────────────*/
.bcm-calendar__name {
	background: var(--bcm-primary-dark);
	color: #fff;
	text-align: center;
	padding: .6rem 1.25rem .5rem;
	font-size: .9rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: .95;
}

/* ── Month navigation header ────────────────────────────────────────────────*/
.bcm-calendar__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .9rem 1.25rem;
	background: var(--bcm-primary);
	color: #fff;
}

/* Month + year label (filled by JS) */
.bcm-calendar__month-label {
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: capitalize;
}

/* Prev / Next buttons */
.bcm-calendar__nav {
	background: rgba(255,255,255,.18);
	border: none;
	color: #fff;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .18s;
	flex-shrink: 0;
}
.bcm-calendar__nav:hover  { background: rgba(255,255,255,.32); }
.bcm-calendar__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ── Weekday label row ──────────────────────────────────────────────────────*/
.bcm-calendar__weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	background: #f1f5f9;
	border-bottom: 1px solid var(--bcm-border);
}
.bcm-calendar__weekday {
	text-align: center;
	padding: .4rem 0;
	font-size: .7rem;
	font-weight: 700;
	color: var(--bcm-text-muted);
	text-transform: uppercase;
	letter-spacing: .06em;
}

/* ── Day grid ───────────────────────────────────────────────────────────────*/
.bcm-calendar__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	padding: .5rem;
	gap: .28rem;
}

/* ── Day cells ──────────────────────────────────────────────────────────────*/
.bcm-day {
	aspect-ratio: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border-radius: 7px;
	font-size: .85rem;
	font-weight: 500;
	position: relative;
	cursor: default;
	line-height: 1.1;
	transition: transform .12s, box-shadow .12s;
}

/* Empty padding cells (before the 1st) */
.bcm-day--empty { background: transparent; }

/* Dates with no booking record (future → neutral style) */
.bcm-day--empty-date {
	color: var(--bcm-text-muted);
	background: transparent;
}

/* Past dates */
.bcm-day--past {
	color: #d1d5db;
	background: transparent;
}

/* Explicitly disabled */
.bcm-day--disabled {
	background: var(--bcm-disabled-bg);
	color: var(--bcm-disabled-fg);
}

/* Sold out */
.bcm-day--full {
	background: var(--bcm-full-bg);
	color: var(--bcm-full);
	font-weight: 600;
}

/* Available — clickable */
.bcm-day--available {
	background: var(--bcm-avail-bg);
	color: var(--bcm-available);
	font-weight: 700;
	cursor: pointer;
}
.bcm-day--available:hover,
.bcm-day--available:focus-visible {
	transform: scale(1.1);
	box-shadow: 0 4px 14px rgba(22,163,74,.28);
	z-index: 2;
	outline: none;
}

/* Today ring */
.bcm-day--today::after {
	content: '';
	position: absolute;
	inset: 2px;
	border-radius: 5px;
	border: 2px solid var(--bcm-today-ring);
	pointer-events: none;
}

/* Spots sub-label inside available cells */
.bcm-day__spots {
	font-size: .6rem;
	line-height: 1;
	margin-top: 1px;
	opacity: .75;
}

/* ── Loading overlay ────────────────────────────────────────────────────────*/
.bcm-calendar__loading {
	display: none;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	padding: 2.5rem 1rem;
	color: var(--bcm-text-muted);
	font-size: .88rem;
}
.bcm-calendar__loading.is-visible { display: flex; }

.bcm-spinner {
	display: inline-block;
	width: 18px; height: 18px;
	border: 2px solid var(--bcm-border);
	border-top-color: var(--bcm-primary);
	border-radius: 50%;
	animation: bcm-spin .7s linear infinite;
}
@keyframes bcm-spin { to { transform: rotate(360deg); } }

/* ── Tooltip ────────────────────────────────────────────────────────────────*/
.bcm-tooltip {
	position: absolute;
	background: rgba(17,24,39,.9);
	color: #fff;
	font-size: .75rem;
	padding: .3rem .65rem;
	border-radius: 5px;
	pointer-events: none;
	white-space: nowrap;
	z-index: 100;
	opacity: 0;
	transition: opacity .15s;
	transform: translateX(-50%);
}
.bcm-tooltip.is-visible { opacity: 1; }
.bcm-tooltip::after {
	content: '';
	position: absolute;
	top: 100%; left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: rgba(17,24,39,.9);
}

/* ── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 480px) {
	.bcm-calendar       { margin: .5rem; }
	.bcm-calendar__grid { padding: .25rem; gap: .15rem; }
	.bcm-day            { font-size: .78rem; }
	.bcm-day__spots     { display: none; }
}

/* ── Dark mode ──────────────────────────────────────────────────────────────*/


/* =============================================================================
   Checkbox réduction licenciés — page produit WooCommerce
   ============================================================================= */

.bcm-licence-discount {
	margin: 1.25rem 0;
	padding: 1rem 1.25rem;
	background: #f0fdf4;
	border: 2px solid #86efac;
	border-radius: 8px;
}

.bcm-licence-label {
	display: flex;
	align-items: center;
	gap: .75rem;
	cursor: pointer;
	font-weight: 600;
	font-size: .95rem;
	color: #15803d;
}

.bcm-licence-checkbox {
	width: 20px;
	height: 20px;
	accent-color: #16a34a;
	cursor: pointer;
	flex-shrink: 0;
}

.bcm-licence-text {
	flex: 1;
}

.bcm-licence-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #16a34a;
	color: #fff;
	font-size: .82rem;
	font-weight: 700;
	padding: .2rem .6rem;
	border-radius: 999px;
	white-space: nowrap;
}

.bcm-licence-hint {
	margin: .5rem 0 0 2rem;
	font-size: .8rem;
	color: #6b7280;
}

/* =============================================================================
   Vue annuelle — [booking_calendar year="2026"]
   ============================================================================= */

.bcm-year-view {
	font-family: var(--bcm-font);
	max-width: 960px;
	margin: 1.5rem auto;
}

/* Titre optionnel */
.bcm-year-view__title {
	background: var(--bcm-primary-dark, #0a5555);
	color: #fff;
	text-align: center;
	padding: .6rem 1.25rem;
	font-size: .9rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	border-radius: 10px 10px 0 0;
}

/* Navigation année */
.bcm-year-view__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--bcm-primary);
	color: #fff;
	padding: .8rem 1.25rem;
	border-radius: 10px;
	margin-bottom: 1.25rem;
}
.bcm-year-view__title + .bcm-year-view__header {
	border-radius: 0 0 10px 10px;
	margin-bottom: 1.25rem;
}
.bcm-year-view__year {
	font-size: 1.3rem;
	font-weight: 800;
	letter-spacing: .05em;
}
.bcm-year-nav {
	background: rgba(255,255,255,.18);
	border: none;
	color: #fff;
	padding: .35rem .9rem;
	border-radius: 20px;
	cursor: pointer;
	font-size: .9rem;
	font-weight: 600;
	transition: background .18s;
}
.bcm-year-nav:hover { background: rgba(255,255,255,.32); }

/* Spinner chargement */
.bcm-year-view__loading {
	display: none;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	color: var(--bcm-text-muted);
}

/* Grille des 12 mois */
.bcm-year-view__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
}

@media (max-width: 900px) {
	.bcm-year-view__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
	.bcm-year-view__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
	.bcm-year-view__grid { grid-template-columns: 1fr; }
}

/* Carte d'un mois */
.bcm-month-mini {
	background: #fff;
	border: 1px solid var(--bcm-border);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* En-tête du mois */
.bcm-month-mini__header {
	background: var(--bcm-primary);
	color: #fff;
	text-align: center;
	padding: .45rem;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: capitalize;
}

/* Labels jours de la semaine */
.bcm-month-mini__weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	background: #f1f5f9;
	border-bottom: 1px solid var(--bcm-border);
}
.bcm-month-mini__day-label {
	text-align: center;
	padding: .25rem 0;
	font-size: .65rem;
	font-weight: 700;
	color: var(--bcm-text-muted);
	text-transform: uppercase;
}

/* Grille des jours */
.bcm-month-mini__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	padding: .3rem;
	gap: 2px;
}

/* Cellule d'un jour */
.bcm-mini-day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .72rem;
	border-radius: 4px;
	color: var(--bcm-text-muted);
	position: relative;
}

.bcm-mini-day--empty  { visibility: hidden; }
.bcm-mini-day--past   { color: #d1d5db; }
.bcm-mini-day--disabled { background: var(--bcm-disabled-bg); color: var(--bcm-disabled-fg); }

/* Aujourd'hui */
.bcm-mini-day--today {
	outline: 2px solid var(--bcm-today-ring);
	outline-offset: -2px;
	border-radius: 4px;
}

/* Disponible */
.bcm-mini-day--available {
	background: var(--bcm-avail-bg, #dcfce7);
	color: var(--bcm-available);
	font-weight: 800;
	cursor: pointer;
	transition: transform .1s, box-shadow .1s;
}
.bcm-mini-day--available:hover,
.bcm-mini-day--available:focus-visible {
	transform: scale(1.25);
	box-shadow: 0 2px 8px rgba(22,163,74,.3);
	z-index: 2;
	outline: none;
}

/* Complet */
.bcm-mini-day--full {
	background: var(--bcm-full-bg, #fee2e2);
	color: var(--bcm-full);
	font-weight: 600;
}

/* Dark mode */


/* =============================================================================
   Cellules colorées dynamiquement (couleur par calendrier)
   ============================================================================= */

/* En mode single, la couleur vient de --bcm-cell-color */
.bcm-day--available {
	background: var(--bcm-cell-bg, var(--bcm-avail-bg));
	color: var(--bcm-cell-color, var(--bcm-available));
}
.bcm-day--available:hover,
.bcm-day--available:focus-visible {
	filter: brightness(0.92);
	transform: scale(1.1);
	box-shadow: 0 4px 14px rgba(0,0,0,.18);
	z-index: 2;
}

/* Pastilles de couleur sur les cellules multi-calendriers */
.bcm-day__dots {
	display: flex;
	justify-content: center;
	gap: 2px;
	margin-top: 2px;
	line-height: 1;
}
.bcm-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	flex-shrink: 0;
}
.bcm-dot--full { opacity: .45; }

/* Légende des calendriers */
.bcm-calendar__legend,
.bcm-year-view__legend {
	padding: .6rem 1rem;
	border-top: 1px solid var(--bcm-border);
	background: var(--bcm-disabled-bg, #f3f4f6);
}
.bcm-legend {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem .75rem;
}
.bcm-legend__item {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	font-size: .78rem;
	color: var(--bcm-text, #111827);
}
.bcm-legend__dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.bcm-legend__name { font-weight: 500; }

/* Popup multi-sélection */
.bcm-multi-popup {
	background: #fff;
	border: 1px solid var(--bcm-border, #e5e7eb);
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0,0,0,.16);
	padding: .75rem;
	min-width: 200px;
	max-width: 280px;
}
.bcm-multi-popup__title {
	font-size: .8rem;
	font-weight: 700;
	color: var(--bcm-text-muted, #6b7280);
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: .5rem;
	padding-bottom: .4rem;
	border-bottom: 1px solid var(--bcm-border, #e5e7eb);
}
.bcm-multi-popup__btn {
	display: flex;
	align-items: center;
	gap: .5rem;
	width: 100%;
	background: none;
	border: 1px solid var(--bcm-border, #e5e7eb);
	border-radius: 6px;
	padding: .45rem .7rem;
	margin-bottom: .35rem;
	cursor: pointer;
	font-size: .88rem;
	text-align: left;
	transition: background .15s;
}
.bcm-multi-popup__btn:hover { background: var(--bcm-disabled-bg, #f3f4f6); }
.bcm-multi-popup__dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.bcm-multi-popup__spots {
	margin-left: auto;
	font-size: .78rem;
	color: var(--bcm-text-muted, #6b7280);
}
.bcm-multi-popup__close {
	display: block;
	width: 100%;
	background: none;
	border: none;
	color: var(--bcm-text-muted, #6b7280);
	font-size: .82rem;
	cursor: pointer;
	padding: .25rem;
	text-align: center;
	margin-top: .1rem;
}
.bcm-multi-popup__close:hover { color: var(--bcm-danger, #dc2626); }

/* Pastilles vue annuelle */
.bcm-mini-dots {
	display: flex;
	justify-content: center;
	gap: 1px;
	margin-top: 1px;
}
.bcm-mini-dot {
	display: inline-block;
	width: 4px;
	height: 4px;
	border-radius: 50%;
}

/* =============================================================================
   Popup multi-événements — sélection d'une session
   ============================================================================= */

/* Overlay semi-transparent */
.bcm-multi-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .45);
	z-index: 9998;
	animation: bcm-fade-in .15s ease;
}

/* Popup centré */
.bcm-multi-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 9999;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0,0,0,.25);
	min-width: 260px;
	max-width: 340px;
	width: calc(100vw - 32px);
	overflow: hidden;
	animation: bcm-popup-in .18s ease;
}

@keyframes bcm-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes bcm-popup-in { from { opacity: 0; transform: translate(-50%,-48%) scale(.95); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* En-tête */
.bcm-multi-popup__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem .75rem;
	border-bottom: 1px solid var(--bcm-border, #e5e7eb);
	gap: .5rem;
}
.bcm-multi-popup__title {
	font-size: .9rem;
	font-weight: 700;
	color: var(--bcm-text, #111827);
	flex: 1;
}
.bcm-multi-popup__date {
	font-size: .78rem;
	color: var(--bcm-text-muted, #6b7280);
	font-weight: 500;
}
.bcm-multi-popup__close {
	background: none;
	border: none;
	font-size: 1.3rem;
	line-height: 1;
	color: var(--bcm-text-muted, #6b7280);
	cursor: pointer;
	padding: 0 .2rem;
	border-radius: 4px;
	transition: color .15s, background .15s;
}
.bcm-multi-popup__close:hover {
	color: var(--bcm-danger, #dc2626);
	background: #fee2e2;
}

/* Corps */
.bcm-multi-popup__body {
	padding: .5rem .75rem .75rem;
}

/* Bouton session */
.bcm-multi-popup__btn {
	display: flex;
	align-items: center;
	gap: .65rem;
	width: 100%;
	background: none;
	border: 1.5px solid var(--bcm-border, #e5e7eb);
	border-radius: 8px;
	padding: .65rem .9rem;
	margin-bottom: .4rem;
	cursor: pointer;
	font-size: .9rem;
	text-align: left;
	transition: border-color .15s, background .15s, transform .1s;
	color: var(--bcm-text, #111827);
}
.bcm-multi-popup__btn:last-child { margin-bottom: 0; }
.bcm-multi-popup__btn:hover,
.bcm-multi-popup__btn:focus-visible {
	border-color: var(--bcm-primary, #0D6E6E);
	background: var(--bcm-primary-lt, #e8f5f5);
	transform: translateX(2px);
	outline: none;
}
.bcm-multi-popup__dot {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 2px solid rgba(0,0,0,.1);
}
.bcm-multi-popup__name {
	flex: 1;
	font-weight: 600;
}
.bcm-multi-popup__spots {
	font-size: .78rem;
	color: var(--bcm-text-muted, #6b7280);
	white-space: nowrap;
}

/* Dark mode */


/* =============================================================================
   Tooltip enrichi — multi-lignes avec pastilles et places
   ============================================================================= */

.bcm-tooltip {
	min-width: 120px;
	max-width: 220px;
	padding: .5rem .75rem;
	text-align: left;
	white-space: normal;
}

.bcm-tt-row {
	display: flex;
	align-items: center;
	gap: .4rem;
	padding: .2rem 0;
	font-size: .82rem;
	line-height: 1.3;
}
.bcm-tt-row + .bcm-tt-row {
	border-top: 1px solid rgba(255,255,255,.15);
	margin-top: .2rem;
	padding-top: .3rem;
}
.bcm-tt-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 1px solid rgba(255,255,255,.3);
}
.bcm-tt-name {
	flex: 1;
	font-weight: 600;
	color: #fff;
}
.bcm-tt-spots {
	color: #86efac;
	font-weight: 700;
	white-space: nowrap;
	font-size: .78rem;
}
.bcm-tt-avail {
	color: #86efac;
	font-size: .78rem;
}
.bcm-tt-full {
	color: #fca5a5;
	font-weight: 600;
	font-size: .78rem;
}

/* Tooltip vue annuelle — position fixed (attaché au body) */
.bcm-year-tooltip {
	position: fixed;
	z-index: 9990;
	background: #1e293b;
	border-radius: 8px;
	padding: .5rem .75rem;
	min-width: 140px;
	max-width: 220px;
	box-shadow: 0 4px 16px rgba(0,0,0,.25);
	pointer-events: none;
	transition: opacity .12s ease;
}
