/**
 * Slotify Calendar admin page.
 * Status palette (CSS variables), event hierarchy, today line, empty state, drawer.
 */

/* -------------------------------------------------------------------------
   Status palette (global for calendar; align with bookings badges)
   ------------------------------------------------------------------------- */
:root {
	--slotify-status-pending: #d97706;
	--slotify-status-pending-bg: #fef3c7;
	--slotify-status-pending-border: #f59e0b;

	--slotify-status-confirmed: #059669;
	--slotify-status-confirmed-bg: #d1fae5;
	--slotify-status-confirmed-border: #10b981;

	--slotify-status-cancelled: #dc2626;
	--slotify-status-cancelled-bg: #fee2e2;
	--slotify-status-cancelled-border: #ef4444;

	--slotify-status-no-show: #6b7280;
	--slotify-status-no-show-bg: #f3f4f6;
	--slotify-status-no-show-border: #9ca3af;

	--slotify-status-completed: #2563eb;
	--slotify-status-completed-bg: #dbeafe;
	--slotify-status-completed-border: #3b82f6;
}

/* -------------------------------------------------------------------------
   Event blocks: hierarchy (time small, service bold, customer regular, badge)
   ------------------------------------------------------------------------- */
.slotify-cal-event {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 6px 8px;
	border-radius: 3px;
	border-left: 4px solid;
	cursor: pointer;
	text-align: left;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.15s ease;
}

.slotify-cal-event:hover {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.slotify-cal-event__time {
	font-size: 10px;
	opacity: 0.9;
	line-height: 1.2;
}

.slotify-cal-event__service {
	font-weight: 700;
	font-size: 12px;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.slotify-cal-event__customer {
	font-size: 11px;
	font-weight: 400;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.slotify-cal-event__badge {
	display: inline-block;
	align-self: flex-start;
	font-size: 9px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	margin-top: 2px;
	text-transform: capitalize;
}

/* Status colors: tinted background + left border */
.slotify-cal-event--pending {
	background: var(--slotify-status-pending-bg);
	border-left-color: var(--slotify-status-pending);
	color: #78350f;
}

.slotify-cal-event--pending .slotify-cal-event__badge {
	background: var(--slotify-status-pending);
	color: #fff;
}

.slotify-cal-event--confirmed {
	background: var(--slotify-status-confirmed-bg);
	border-left-color: var(--slotify-status-confirmed);
	color: #064e3b;
}

.slotify-cal-event--confirmed .slotify-cal-event__badge {
	background: var(--slotify-status-confirmed);
	color: #fff;
}

.slotify-cal-event--cancelled {
	background: var(--slotify-status-cancelled-bg);
	border-left-color: var(--slotify-status-cancelled);
	color: #7f1d1d;
}

.slotify-cal-event--cancelled .slotify-cal-event__badge {
	background: var(--slotify-status-cancelled);
	color: #fff;
}

.slotify-cal-event--no_show {
	background: var(--slotify-status-no-show-bg);
	border-left-color: var(--slotify-status-no-show);
	color: #374151;
}

.slotify-cal-event--no_show .slotify-cal-event__badge {
	background: var(--slotify-status-no-show);
	color: #fff;
}

/* Month view: compact */
.slotify-cal-month-events {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 10px;
}

.slotify-cal-event--month {
	padding: 2px 4px;
	min-height: auto;
}

.slotify-cal-event--month .slotify-cal-event__time {
	font-size: 9px;
}

.slotify-cal-event--month .slotify-cal-event__service {
	font-size: 10px;
}

.slotify-cal-event--month .slotify-cal-event__customer {
	font-size: 9px;
}

.slotify-cal-event--month .slotify-cal-event__badge {
	font-size: 8px;
	padding: 1px 4px;
}

.slotify-cal-more-events {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 2px;
}

.slotify-cal-more-toggle {
	display: inline-block;
	margin-top: 2px;
	padding: 0;
	border: 0;
	background: none;
	color: #2271b1;
	font-size: 9px;
	cursor: pointer;
	text-decoration: underline;
	line-height: 1.3;
}

.slotify-cal-more-toggle:hover {
	color: #135e96;
}

/* Week view: absolute positioned; min height so time/service/customer/badge all visible */
.slotify-cal-event--week {
	padding: 4px 6px;
	overflow: hidden;
	min-height: 72px;
}

.slotify-cal-event--week .slotify-cal-event__time {
	font-size: 10px;
}

.slotify-cal-event--week .slotify-cal-event__service {
	font-size: 11px;
}

.slotify-cal-event--week .slotify-cal-event__customer {
	font-size: 10px;
}

.slotify-cal-event--week .slotify-cal-event__time,
.slotify-cal-event--week .slotify-cal-event__service,
.slotify-cal-event--week .slotify-cal-event__customer {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Day view: block with inner wrapper; status colors on inner (like month view) */
.slotify-cal-event--day .slotify-cal-event-inner {
	position: absolute;
	left: 4px;
	right: 4px;
	top: 0;
	min-height: 100%;
	padding: 6px 8px;
	border-radius: 3px;
	border-left-width: 4px;
	border-left-style: solid;
	display: flex;
	flex-direction: column;
	gap: 2px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.slotify-cal-event--day {
	padding: 0;
	background: transparent;
	border-left: none;
}

.slotify-cal-event--day.slotify-cal-event--pending .slotify-cal-event-inner {
	background: var(--slotify-status-pending-bg);
	border-left-color: var(--slotify-status-pending);
	color: #78350f;
}

.slotify-cal-event--day.slotify-cal-event--confirmed .slotify-cal-event-inner {
	background: var(--slotify-status-confirmed-bg);
	border-left-color: var(--slotify-status-confirmed);
	color: #064e3b;
}

.slotify-cal-event--day.slotify-cal-event--cancelled .slotify-cal-event-inner {
	background: var(--slotify-status-cancelled-bg);
	border-left-color: var(--slotify-status-cancelled);
	color: #7f1d1d;
}

.slotify-cal-event--day.slotify-cal-event--no_show .slotify-cal-event-inner {
	background: var(--slotify-status-no-show-bg);
	border-left-color: var(--slotify-status-no-show);
	color: #374151;
}

/* -------------------------------------------------------------------------
   Today line (Day / Week views)
   ------------------------------------------------------------------------- */
.slotify-cal-day-table-wrap,
.slotify-cal-week-table-wrap {
	position: relative;
}

.slotify-cal-day-table-wrap > .slotify-cal-today-line,
.slotify-cal-week-table-wrap > .slotify-cal-today-line {
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: #d63638;
	z-index: 50;
	pointer-events: none;
}

.slotify-cal-day-table-wrap > .slotify-cal-today-line::before,
.slotify-cal-week-table-wrap > .slotify-cal-today-line::before {
	content: "";
	position: absolute;
	left: 0;
	top: -3px;
	width: 8px;
	height: 8px;
	background: #d63638;
	border-radius: 50%;
}

/* -------------------------------------------------------------------------
   Empty state (no bookings in staff column)
   ------------------------------------------------------------------------- */
.slotify-cal-empty-col {
	text-align: center;
	font-size: 12px;
	color: #8c8f94;
	padding: 2rem 0.5rem;
	pointer-events: none;
	min-height: 60px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.slotify-cal-day-cell {
	position: relative;
	min-height: 30px;
}

/* -------------------------------------------------------------------------
   Drawer (reuse same structure as Bookings list)
   ------------------------------------------------------------------------- */
.slotify-drawer {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 100000;
	pointer-events: none;
}

.slotify-drawer[aria-hidden="false"] {
	display: block;
	pointer-events: auto;
}

.slotify-drawer-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.4);
	transition: opacity 0.2s ease;
}

.slotify-drawer-panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-left: 1px solid #c3c4c7;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.25s ease;
}

.slotify-drawer[aria-hidden="false"] .slotify-drawer-panel {
	transform: translateX(0);
}

body.slotify-drawer-open {
	overflow: hidden;
}

.slotify-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #c3c4c7;
	flex-shrink: 0;
}

.slotify-drawer-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
}

.slotify-drawer-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	padding: 0.25rem;
	cursor: pointer;
	color: #646970;
}

.slotify-drawer-close:hover {
	color: #1d2327;
}

.slotify-drawer-body {
	padding: 1.25rem;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.slotify-booking-detail-loading {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: #646970;
}

.slotify-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #c3c4c7;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: slotify-spin 0.7s linear infinite;
}

@keyframes slotify-spin {
	to { transform: rotate(360deg); }
}

.slotify-drawer-body .slotify-booking-detail-dl,
.slotify-drawer-body .slotify-drawer-actions {
	margin-top: 1rem;
}

.slotify-drawer-body .slotify-error {
	color: #b32d2e;
	margin: 0;
}
