/* ==========================================================================
   EVD Datepicker Theme — Navy/Gold for Ethic Village Djerba
   Loaded AFTER jquery.datepick.css.
   Targets both .datepick-popup (search popups) and .mphb-datepick (inline).
   Both now on dark backgrounds.
   ========================================================================== */

.datepick-popup,
.mphb-datepick .datepick {
	background-color: #1a2744 !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	border-radius: 16px !important;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4) !important;
	overflow: hidden !important;
	font-family: 'Josefin Sans', 'Jost', sans-serif !important;
}
.datepick-popup .datepick,
.datepick-popup > .datepick {
	background-color: #1a2744 !important;
	background: #1a2744 !important;
	color: #fff !important;
	border: none !important;
	border-radius: 0 !important;
}

/* Nav */
.datepick-popup .datepick-nav,
.mphb-datepick .datepick-nav {
	background-color: rgba(255, 255, 255, 0.05) !important;
	color: #fff !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.datepick-popup .datepick-nav a,
.mphb-datepick .datepick-nav a {
	color: #b99d75 !important;
	font-weight: 600 !important;
}
.datepick-popup .datepick-nav a:hover,
.mphb-datepick .datepick-nav a:hover {
	background-color: rgba(255, 255, 255, 0.08) !important;
	color: #fff !important;
}
.datepick-popup .datepick-nav a.datepick-disabled,
.mphb-datepick .datepick-nav a.datepick-disabled {
	color: rgba(255, 255, 255, 0.2) !important;
}

/* Month header */
.datepick-popup .datepick-month-header,
.mphb-datepick .datepick-month-header {
	background-color: transparent !important;
	color: #fff !important;
	font-family: 'Cinzel', serif !important;
	font-weight: 600 !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.datepick-popup .datepick-month-header select,
.datepick-popup .datepick-month-header input,
.mphb-datepick .datepick-month-header select,
.mphb-datepick .datepick-month-header input {
	background-color: rgba(255, 255, 255, 0.12) !important;
	color: #fff !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	border-radius: 6px !important;
}
.datepick-popup .datepick-month-header select option,
.mphb-datepick .datepick-month-header select option {
	background-color: #1a2744 !important;
	color: #fff !important;
}

/* Month panel */
.datepick-popup .datepick-month,
.mphb-datepick .datepick-month {
	background-color: transparent !important;
	border-color: transparent !important;
}
.datepick-popup .datepick-month + .datepick-month,
.mphb-datepick .datepick-month + .datepick-month {
	border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Day-of-week headers */
.datepick-popup .datepick-month th,
.datepick-popup .datepick-month th a,
.mphb-datepick .datepick-month th,
.mphb-datepick .datepick-month th a {
	background-color: transparent !important;
	color: #b99d75 !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	text-transform: uppercase !important;
	letter-spacing: 0.05em !important;
	border-color: transparent !important;
}

/* Day cells */
.datepick-popup .datepick-month td,
.mphb-datepick .datepick-month td {
	background-color: transparent !important;
	border-color: transparent !important;
}
.datepick-popup .datepick-month td a,
.mphb-datepick .datepick-month td a {
	color: rgba(255, 255, 255, 0.85) !important;
	border-radius: 50% !important;
	background-color: transparent !important;
}

/* Anneau vert autour des jours disponibles — les <td a> représentent les
   jours cliquables (jours libres), <td span> les jours pris. Le ring vert
   pop bien sur le fond navy et signale visuellement "réservable".
   On exclut today/selected/highlight/other-month pour que leur style
   propre (or, fond plein) prime. */
.datepick-popup .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today),
.mphb-datepick .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today) {
	box-shadow: inset 0 0 0 1.5px rgba(34, 197, 94, 0.6);
}
.datepick-popup .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today):hover,
.mphb-datepick .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today):hover {
	box-shadow: inset 0 0 0 1.5px rgba(34, 197, 94, 0.9);
}
.datepick-popup .datepick-month td span,
.mphb-datepick .datepick-month td span {
	color: rgba(255, 255, 255, 0.2) !important;
	background-color: transparent !important;
}
.datepick-popup .datepick-month td a:hover,
.mphb-datepick .datepick-month td a:hover {
	background-color: #b99d75 !important;
	color: #1a2744 !important;
}

/* Today */
.datepick-popup .datepick-month td a.datepick-today,
.mphb-datepick .datepick-month td a.datepick-today {
	background-color: rgba(185, 157, 117, 0.25) !important;
	color: #fff !important;
	font-weight: 700 !important;
}

/* Selected / highlighted — both <a> (available) and <span> (booked) */
.datepick-popup .datepick-month td a.datepick-selected,
.datepick-popup .datepick-month td a.datepick-highlight,
.datepick-popup .datepick-month td span.datepick-selected,
.datepick-popup .datepick-month td span.datepick-highlight,
.mphb-datepick .datepick-month td a.datepick-selected,
.mphb-datepick .datepick-month td a.datepick-highlight,
.mphb-datepick .datepick-month td span.datepick-selected,
.mphb-datepick .datepick-month td span.datepick-highlight {
	background-color: #b99d75 !important;
	color: #1a2744 !important;
	font-weight: 700 !important;
}

/* Other month */
.datepick-popup .datepick-month td .datepick-other-month,
.mphb-datepick .datepick-month td .datepick-other-month {
	background-color: transparent !important;
	color: rgba(255, 255, 255, 0.1) !important;
}

/* Weekend */
.datepick-popup .datepick-weekend,
.mphb-datepick .datepick-weekend {
	background-color: transparent !important;
}

/* Ctrl bar */
.datepick-popup .datepick-ctrl,
.mphb-datepick .datepick-ctrl {
	background-color: rgba(255, 255, 255, 0.04) !important;
	color: #fff !important;
	border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.datepick-popup .datepick-ctrl:before,
.mphb-datepick .datepick-ctrl:before {
	border-left-color: rgba(255, 255, 255, 0.1) !important;
}
.datepick-popup .datepick-ctrl a,
.mphb-datepick .datepick-ctrl a {
	color: #b99d75 !important;
}
.datepick-popup .datepick-ctrl a:hover,
.mphb-datepick .datepick-ctrl a:hover {
	background-color: rgba(255, 255, 255, 0.08) !important;
	color: #fff !important;
}

/* Status bar */
.datepick-popup .datepick-status,
.mphb-datepick .datepick-status {
	background-color: rgba(255, 255, 255, 0.04) !important;
	color: rgba(255, 255, 255, 0.7) !important;
	border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* MPHB availability — simple: white = free, grey = booked.
   Kill ALL MPHB gradients globally, then re-set colors per state. */

/* Nuclear: remove ALL gradients from every calendar cell element */
.mphb-datepick .mphb-date-cell,
.mphb-datepick a.mphb-date-cell,
.mphb-datepick span.mphb-date-cell,
.mphb-datepick td a[class*="mphb-"],
.mphb-datepick td span[class*="mphb-"] {
	background: transparent !important;
	background-image: none !important;
	background-color: transparent !important;
}

/* Available: ALWAYS white — even if check-in/out is restricted.
   mphb-mark-as-unavailable--check-in just means "can't start here"
   but the date itself is free. Only mphb-booked-date is truly taken. */
.mphb-datepick .mphb-available-date a,
.mphb-datepick .mphb-available-date span,
.mphb-datepick .mphb-available-date[class*="mark-as-unavailable"] a,
.mphb-datepick .mphb-available-date[class*="mark-as-unavailable"] span,
.mphb-datepick td a.mphb-available-date,
.mphb-datepick td span.mphb-available-date {
	color: #fff !important;
}

/* Booked: soft coral disc + coral number — only truly booked, non-past dates.
   MPHB puts its state classes on the inner <a>/<span> cell element (not the
   <td>), so the selectors target the cell element directly. Colors use the
   shared calendar tokens (--lw-cal-booked-*): the vars are undefined in dark
   mode so the fallbacks apply, and the light-mode JS remap provides the light
   values. Specificity (0,6,2) keeps the background above the nuclear reset
   (0,2,2); :not(.datepick-selected)/:not(.datepick-highlight) keeps the gold
   selection styles on top, :not(.mphb-past-date) keeps past days dim grey. */
.mphb-datepick td a.mphb-booked-date:not(.mphb-available-date):not(.mphb-past-date):not(.datepick-selected):not(.datepick-highlight),
.mphb-datepick td span.mphb-booked-date:not(.mphb-available-date):not(.mphb-past-date):not(.datepick-selected):not(.datepick-highlight) {
	background-color: var(--lw-cal-booked-bg, rgba(239, 83, 80, 0.13)) !important;
	color: var(--lw-cal-booked-text, #e79f9c) !important;
	border-radius: 50% !important;
}

/* Selected dates: gold — override everything including booked/nuclear reset */
.mphb-datepick .mphb-selected-date a,
.mphb-datepick .mphb-selected-date span,
.mphb-datepick td .mphb-date-cell.datepick-selected,
.mphb-datepick td .mphb-date-cell.datepick-highlight,
.mphb-datepick .mphb-booked-date a.datepick-selected,
.mphb-datepick .mphb-booked-date span.datepick-selected {
	background: #b99d75 !important;
	background-color: #b99d75 !important;
	color: #1a2744 !important;
	font-weight: 700 !important;
}

/* Ctrl bar layout — row 1: date + effacer, row 2: info centered */
.mphb-datepick .datepick-ctrl {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 0;
	padding: 10px 12px !important;
	font-size: 0.82rem !important;
}

/* Row 1 left: dates */
.mphb-datepick .mphb-calendar__selected-dates {
	flex: 1;
	color: rgba(255, 255, 255, 0.7) !important;
}

/* Row 1 right: Effacer */
.mphb-datepick .datepick-cmd-clear {
	flex: 0 0 auto;
}

/* Force line break after Effacer — everything below is row 2+ */
.mphb-datepick .datepick-cmd-clear + *,
.mphb-datepick .mphb-calendar__nights-count,
.mphb-datepick .datepick-ctrl .cs-rate-drop-badge {
	flex-basis: 100%;
	text-align: center;
}

.mphb-datepick .mphb-calendar__nights-count {
	color: rgba(255, 255, 255, 0.7) !important;
	margin-top: 4px;
}

.mphb-datepick .cs-rate-nudge--applied {
	display: inline-block;
	margin-top: 4px;
	padding: 4px 12px;
	background: rgba(46, 125, 50, 0.2);
	color: #81c784;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.78rem;
}

.mphb-datepick .cs-rate-nudge--pending {
	display: inline-block;
	margin-top: 4px;
	padding: 4px 12px;
	background: rgba(230, 81, 0, 0.15);
	color: #ffb74d;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.78rem;
}

/* Mobile (≤500px): show only first month for inline 2-month datepickers — prevents horizontal overflow. */
@media (max-width: 500px) {
	.mphb-datepick .datepick-multi .datepick-month.last,
	.datepick-popup.datepick-multi .datepick-month.last {
		display: none;
	}
	.mphb-datepick .datepick-multi .datepick-month,
	.datepick-popup.datepick-multi .datepick-month {
		width: 100%;
	}
	.mphb-datepick .datepick-multi,
	.datepick-popup.datepick-multi {
		max-width: 100%;
	}
}

/* ===== LIGHT MODE (body[data-pp-theme="light"]) =====
   The rules above assume a dark navy calendar background and hardcode
   white text — unreadable once the site is in light mode (light
   background, white text on white text = invisible day numbers, faint
   selection). These overrides mirror every meaningful dark rule above
   with a light-readable palette. They are additive only: the dark rules
   are left untouched for dark mode; these win via extra specificity
   (body[data-pp-theme="light"] prefix) and matching !important. */

/* Container */
body[data-pp-theme="light"] .datepick-popup,
body[data-pp-theme="light"] .mphb-datepick .datepick {
	background-color: #ffffff !important;
	color: #1e3750 !important;
	border: 1px solid rgba(30, 55, 80, 0.12) !important;
	box-shadow: 0 12px 48px rgba(30, 55, 80, 0.15) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick,
body[data-pp-theme="light"] .datepick-popup > .datepick {
	background-color: #ffffff !important;
	background: #ffffff !important;
	color: #1e3750 !important;
}

/* Nav */
body[data-pp-theme="light"] .datepick-popup .datepick-nav,
body[data-pp-theme="light"] .mphb-datepick .datepick-nav {
	background-color: rgba(30, 55, 80, 0.04) !important;
	color: #1e3750 !important;
	border-bottom: 1px solid rgba(30, 55, 80, 0.1) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-nav a,
body[data-pp-theme="light"] .mphb-datepick .datepick-nav a {
	color: #6b5a42 !important;
	font-weight: 600 !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-nav a:hover,
body[data-pp-theme="light"] .mphb-datepick .datepick-nav a:hover {
	background-color: rgba(30, 55, 80, 0.06) !important;
	color: #1e3750 !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-nav a.datepick-disabled,
body[data-pp-theme="light"] .mphb-datepick .datepick-nav a.datepick-disabled {
	color: rgba(30, 55, 80, 0.2) !important;
}

/* Month header */
body[data-pp-theme="light"] .datepick-popup .datepick-month-header,
body[data-pp-theme="light"] .mphb-datepick .datepick-month-header {
	color: #1e3750 !important;
	border-bottom: 1px solid rgba(30, 55, 80, 0.08) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-month-header select,
body[data-pp-theme="light"] .datepick-popup .datepick-month-header input,
body[data-pp-theme="light"] .mphb-datepick .datepick-month-header select,
body[data-pp-theme="light"] .mphb-datepick .datepick-month-header input {
	background-color: rgba(30, 55, 80, 0.06) !important;
	color: #1e3750 !important;
	border: 1px solid rgba(30, 55, 80, 0.25) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-month-header select option,
body[data-pp-theme="light"] .mphb-datepick .datepick-month-header select option {
	background-color: #ffffff !important;
	color: #1e3750 !important;
}

/* Month panel */
body[data-pp-theme="light"] .datepick-popup .datepick-month + .datepick-month,
body[data-pp-theme="light"] .mphb-datepick .datepick-month + .datepick-month {
	border-left: 1px solid rgba(30, 55, 80, 0.08) !important;
}

/* Day-of-week headers — muted, not full-strength navy */
body[data-pp-theme="light"] .datepick-popup .datepick-month th,
body[data-pp-theme="light"] .datepick-popup .datepick-month th a,
body[data-pp-theme="light"] .mphb-datepick .datepick-month th,
body[data-pp-theme="light"] .mphb-datepick .datepick-month th a {
	color: #555555 !important;
}

/* Day cells — the main fix: dark text instead of white-on-light */
body[data-pp-theme="light"] .datepick-popup .datepick-month td a,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a {
	color: #1e3750 !important;
	background-color: transparent !important;
}

/* Available-day ring — darker green so it still pops against white */
body[data-pp-theme="light"] .datepick-popup .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today),
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today) {
	box-shadow: inset 0 0 0 1.5px rgba(46, 125, 50, 0.5) !important;
	color: #2e7d32 !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today):hover,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a:not(.datepick-other-month):not(.datepick-selected):not(.datepick-highlight):not(.datepick-today):hover {
	box-shadow: inset 0 0 0 1.5px rgba(46, 125, 50, 0.8) !important;
	background-color: rgba(76, 175, 80, 0.12) !important;
}

/* Booked (span, not clickable) — faded dark, never white */
body[data-pp-theme="light"] .datepick-popup .datepick-month td span,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td span {
	color: rgba(30, 55, 80, 0.3) !important;
	background-color: transparent !important;
}

/* Hover on an available day */
body[data-pp-theme="light"] .datepick-popup .datepick-month td a:hover,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a:hover {
	background-color: rgba(30, 55, 80, 0.06) !important;
	color: #1e3750 !important;
}

/* Today */
body[data-pp-theme="light"] .datepick-popup .datepick-month td a.datepick-today,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a.datepick-today {
	background-color: rgba(107, 90, 66, 0.15) !important;
	color: #1e3750 !important;
}

/* Selected / highlighted — the check-in → check-out range must read clearly:
   dark navy text on gold background. */
body[data-pp-theme="light"] .datepick-popup .datepick-month td a.datepick-selected,
body[data-pp-theme="light"] .datepick-popup .datepick-month td a.datepick-highlight,
body[data-pp-theme="light"] .datepick-popup .datepick-month td span.datepick-selected,
body[data-pp-theme="light"] .datepick-popup .datepick-month td span.datepick-highlight,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a.datepick-selected,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td a.datepick-highlight,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td span.datepick-selected,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td span.datepick-highlight {
	background-color: #b99d75 !important;
	color: #1e3750 !important;
}

/* Other month */
body[data-pp-theme="light"] .datepick-popup .datepick-month td .datepick-other-month,
body[data-pp-theme="light"] .mphb-datepick .datepick-month td .datepick-other-month {
	color: rgba(30, 55, 80, 0.25) !important;
}

/* Ctrl bar */
body[data-pp-theme="light"] .datepick-popup .datepick-ctrl,
body[data-pp-theme="light"] .mphb-datepick .datepick-ctrl {
	background-color: rgba(30, 55, 80, 0.03) !important;
	color: #1e3750 !important;
	border-top: 1px solid rgba(30, 55, 80, 0.1) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-ctrl:before,
body[data-pp-theme="light"] .mphb-datepick .datepick-ctrl:before {
	border-left-color: rgba(30, 55, 80, 0.1) !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-ctrl a,
body[data-pp-theme="light"] .mphb-datepick .datepick-ctrl a {
	color: #6b5a42 !important;
}
body[data-pp-theme="light"] .datepick-popup .datepick-ctrl a:hover,
body[data-pp-theme="light"] .mphb-datepick .datepick-ctrl a:hover {
	background-color: rgba(30, 55, 80, 0.06) !important;
	color: #1e3750 !important;
}

/* Status bar */
body[data-pp-theme="light"] .datepick-popup .datepick-status,
body[data-pp-theme="light"] .mphb-datepick .datepick-status {
	background-color: rgba(30, 55, 80, 0.03) !important;
	color: rgba(30, 55, 80, 0.7) !important;
	border-top: 1px solid rgba(30, 55, 80, 0.08) !important;
}

/* MPHB availability — available date text */
body[data-pp-theme="light"] .mphb-datepick .mphb-available-date a,
body[data-pp-theme="light"] .mphb-datepick .mphb-available-date span,
body[data-pp-theme="light"] .mphb-datepick .mphb-available-date[class*="mark-as-unavailable"] a,
body[data-pp-theme="light"] .mphb-datepick .mphb-available-date[class*="mark-as-unavailable"] span,
body[data-pp-theme="light"] .mphb-datepick td a.mphb-available-date,
body[data-pp-theme="light"] .mphb-datepick td span.mphb-available-date {
	color: #1e3750 !important;
}

/* MPHB availability — booked dates need no light override: the token-based
   coral rule in the dark section reads --lw-cal-booked-bg/--lw-cal-booked-text,
   which the light-mode JS remap defines, and its specificity (0,6,2) already
   beats the generic light td span rule (0,3,2). */

/* MPHB availability — selected dates, gold bg / navy text */
body[data-pp-theme="light"] .mphb-datepick .mphb-selected-date a,
body[data-pp-theme="light"] .mphb-datepick .mphb-selected-date span,
body[data-pp-theme="light"] .mphb-datepick td .mphb-date-cell.datepick-selected,
body[data-pp-theme="light"] .mphb-datepick td .mphb-date-cell.datepick-highlight,
body[data-pp-theme="light"] .mphb-datepick .mphb-booked-date a.datepick-selected,
body[data-pp-theme="light"] .mphb-datepick .mphb-booked-date span.datepick-selected {
	background: #b99d75 !important;
	background-color: #b99d75 !important;
	color: #1e3750 !important;
}

/* Ctrl bar row 1: selected dates text */
body[data-pp-theme="light"] .mphb-datepick .mphb-calendar__selected-dates {
	color: rgba(30, 55, 80, 0.7) !important;
}

/* Ctrl bar row 2: nights count */
body[data-pp-theme="light"] .mphb-datepick .mphb-calendar__nights-count {
	color: rgba(30, 55, 80, 0.7) !important;
}

/* "Remise 7 nuits" rate-drop badges — darker text so it reads on a white background */
body[data-pp-theme="light"] .mphb-datepick .cs-rate-nudge--applied {
	background: rgba(76, 175, 80, 0.12) !important;
	color: #2e7d32 !important;
}
body[data-pp-theme="light"] .mphb-datepick .cs-rate-nudge--pending {
	background: rgba(230, 81, 0, 0.12) !important;
	color: #e65100 !important;
}
