/* BilBird Booking Calendar 2.0 */

/* جدول الثيم القديم بيتخفى طول ما جدولنا شغال */
#datetimepickershow.bbcal-hidden { display: none !important; }

.bbcal {
	--bbcal-brand: var(--primary, #0e82fd);
	--bbcal-brand-dark: #0f5ea8;
	--bbcal-brand-dark: color-mix(in srgb, var(--bbcal-brand) 68%, #000);
	--bbcal-avail-bg: #e8f1fd;
	--bbcal-avail-bg: color-mix(in srgb, var(--bbcal-brand) 13%, #fff);
	--bbcal-avail-bg-hover: #d3e5fb;
	--bbcal-avail-bg-hover: color-mix(in srgb, var(--bbcal-brand) 24%, #fff);
	--bbcal-ink: #111827;
	--bbcal-muted: #6b7280;
	--bbcal-off: #aeb4bd;
	font-family: inherit;
	color: var(--bbcal-ink);
	padding: 4px;
	width: 100%;
}
.bbcal.is-off { display: none; }
.bbcal.is-off.has-debug { display: block; }
.bbcal.is-off.has-debug > :not(.bbcal__debug) { display: none; }

/* الرأس: الشهر + الأسهم */
.bbcal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 8px;
}
.bbcal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--bbcal-ink);
	text-align: center;
	flex: 1;
}
.bbcal__nav {
	flex: none;
	width: 44px;
	height: 44px;
	border: 1px solid #d9dee5;
	border-radius: 50%;
	background: #fff;
	color: var(--bbcal-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.bbcal__nav:hover:not(:disabled) {
	background: var(--bbcal-brand-dark);
	border-color: var(--bbcal-brand-dark);
	color: #fff;
}
.bbcal__nav:disabled { opacity: .4; cursor: not-allowed; }
.bbcal__nav:focus-visible { outline: 3px solid var(--bbcal-brand-dark); outline-offset: 2px; }
/* الأسهم تتبع اتجاه القراءة */
html[dir="rtl"] .bbcal__nav svg,
.bbcal:dir(rtl) .bbcal__nav svg { transform: scaleX(-1); }
.bbcal__nav--next svg { transform: scaleX(-1); }
html[dir="rtl"] .bbcal__nav--next svg,
.bbcal:dir(rtl) .bbcal__nav--next svg { transform: none; }

/* الشبكة */
.bbcal__grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
	transition: opacity .15s ease;
}
.bbcal.is-loading .bbcal__grid { opacity: .45; pointer-events: none; cursor: progress; }

.bbcal__dow {
	padding: 6px 0;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	color: var(--bbcal-muted);
}

.bbcal__day {
	position: relative;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--bbcal-off);
	font: inherit;
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	cursor: not-allowed;
	transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

/* متاح: خلفية + خط عريض + نقطة (مش اللون لوحده) */
.bbcal__day.is-avail {
	background: var(--bbcal-avail-bg);
	color: var(--bbcal-ink);
	font-weight: 700;
	cursor: pointer;
}
.bbcal__day.is-avail::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 6px;
	margin-inline: auto;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--bbcal-brand-dark);
}
.bbcal__day.is-avail:hover { background: var(--bbcal-avail-bg-hover); transform: translateY(-1px); }

/* المختار */
.bbcal__day.is-selected,
.bbcal__day.is-selected:hover {
	background: #0f5ea8;
	background: var(--bbcal-brand-dark);
	color: #fff;
	transform: none;
}
.bbcal__day.is-selected::after { background: #fff; }

/* النهارده */
.bbcal__day.is-today:not(.is-selected) { box-shadow: inset 0 0 0 2px var(--bbcal-brand-dark); }

.bbcal__day:focus-visible { outline: 3px solid var(--bbcal-brand-dark); outline-offset: 2px; }

/* المفتاح + الرسائل */
.bbcal__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	justify-content: center;
	margin: 12px 0 2px;
	font-size: 13px;
	color: var(--bbcal-muted);
}
.bbcal__legend[hidden], .bbcal__empty[hidden] { display: none !important; }
.bbcal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.bbcal__legend i { display: inline-block; width: 14px; height: 14px; border-radius: 5px; }
.bbcal__legend i.on  { background: var(--bbcal-avail-bg); box-shadow: inset 0 -3px 0 var(--bbcal-brand-dark); }
.bbcal__legend i.off { background: #f3f4f6; border: 1px dashed #aeb4bd; }

.bbcal__empty {
	margin: 12px 4px 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: #fff7e6;
	color: #7a4b00;
	font-size: 14px;
	text-align: center;
}
.bbcal__debug {
	margin: 12px 0 0;
	padding: 8px 10px;
	border-radius: 8px;
	background: #111827;
	color: #d1fae5;
	font-size: 12px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-all;
	direction: ltr;
	text-align: left;
}

/* لوحة المواعيد وقت التحميل */
.bbcal-slots-loading { opacity: .5; transition: opacity .15s ease; }

@media (max-width: 400px) {
	.bbcal__grid { gap: 3px; }
	.bbcal__day { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.bbcal, .bbcal * { transition: none !important; }
	.bbcal__day.is-avail:hover { transform: none; }
}
