.gpb-booking-time-picker {
	max-width: 600px;
}

.gpb-booking-time-picker__content {
	display: grid;
	grid-template-columns: 1fr;
	min-height: 300px;
}

/* Ensure all direct children share the same grid cell */
.gpb-booking-time-picker__content > * {
	grid-row: 1;
	grid-column: 1;
}

/* Calendar container */
.gpb-booking-time-picker__calendar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* DayPicker overrides */
.gpb-booking-time-picker .rdp {
	--rdp-cell-size: 40px;
	--rdp-accent-color: #4299e1;
	--rdp-background-color: #e6f2ff;
	margin: 0;
}

.gpb-booking-time-picker .rdp-months {
	justify-content: center;
}

/* Range info box */
.gpb-booking-time-picker__range-info {
	padding: 1rem;
	background: #f7fafc;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	margin-top: auto; /* Push to bottom of container */
}

.gpb-booking-time-picker__range-info p {
	margin: 0;
	line-height: 1.6;
}

.gpb-booking-time-picker__header {
	display: flex;
	align-items: center;
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #ddd;
}

/* Back Button Focus Styles */
.gpb-booking-time-picker__back {
	background: none;
	border: none;
	padding: 0.5rem;
	margin-right: 1rem;
	color: #4299e1;
	cursor: pointer;
	font-size: 0.9rem;
	transition: all 0.2s ease;
	border-radius: 4px;
}

.gpb-booking-time-picker__back:hover {
	color: #3182ce;
	transform: translateX(-2px);
}

.gpb-booking-time-picker__back:focus {
	outline: none;
	box-shadow: 0 0 0 2px #4299e1, 0 0 0 4px rgba(66, 153, 225, 0.3);
}

.gpb-booking-time-picker__back:focus:not(:focus-visible) {
	box-shadow: none;
}

.gpb-booking-time-picker__slots {
	margin-top: 1rem;
}

.gpb-booking-time-picker__duration {
	margin-left: 0.5rem;
	font-weight: normal;
	color: #666;
}

.gpb-booking-time-picker__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.5rem;
	margin-top: 1rem;
}

/* Loading Animation */
@keyframes shimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

.gpb-booking-time-picker__loading {
	margin: 1rem 0;
}

.gpb-booking-time-picker__skeleton {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.5rem;
	margin-top: 1rem;
}

.gpb-booking-time-picker__skeleton-slot {
	height: 48px;
	border-radius: 4px;
	background: linear-gradient(
		90deg,
		#f0f0f0 25%,
		#f8f8f8 50%,
		#f0f0f0 75%
	);
	background-size: 200% 100%;
	animation: shimmer 1.5s infinite linear;
}

.gpb-booking-time-picker__skeleton-slot:nth-child(even) {
	animation-delay: 0.2s;
}

.gpb-booking-time-picker__skeleton-slot:nth-child(3n) {
	animation-delay: 0.4s;
}

/* Time Slot Styles */
.gpb-booking-time-picker__slot {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	position: relative;
	transition: all 0.2s ease;
}

.gpb-booking-time-picker__slot:not(.gpb-booking-time-picker__slot--selected):not(.gpb-booking-time-picker__slot--unavailable):hover {
	background: #f5f5f5;
	border-color: #ccc;
	transform: translateY(-1px);
}

.gpb-booking-time-picker__slot:focus {
	outline: none;
}

.gpb-booking-time-picker__slot:focus-visible {
	box-shadow: 0 0 0 2px #4299e1, 0 0 0 4px rgba(66, 153, 225, 0.3);
}

.gpb-booking-time-picker__slot--selected:focus-visible {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #4299e1, 0 0 0 6px rgba(66, 153, 225, 0.3);
}

.gpb-booking-time-picker__slot--selected {
	background: #4299e1;
	border-color: #4299e1;
	color: white;
	transform: scale(1.02);
	cursor: default;
}

.gpb-booking-time-picker__slot--selected:hover {
	background: #4299e1;
	border-color: #4299e1;
	transform: scale(1.02);
}

.gpb-booking-time-picker__slot--unavailable:not(.gpb-booking-time-picker__slot--selected) {
	opacity: 0.5;
	cursor: not-allowed;
	background: #f5f5f5;
}

.gpb-booking-time-picker__slot--unavailable:focus-visible {
	box-shadow: 0 0 0 2px #cbd5e0, 0 0 0 4px rgba(203, 213, 224, 0.3);
}

.gpb-booking-time-picker__slot-time {
	font-size: 0.9rem;
}

.gpb-booking-time-picker__error {
	margin: 1rem 0;
	padding: 1rem;
	border-radius: 4px;
	background: #fff5f5;
	color: #c53030;
}

/* Make sure the Book Now button appears below the content */
.gform_footer {
	margin-top: 1rem;
	clear: both;
	position: relative;
	z-index: 1;
}

/* Ensure form footer is above any absolute content */
.gform_wrapper.gravity-theme .gform_footer {
	position: relative;
	z-index: 1;
}

/* Calendar Loading Overlay */
.gpb-booking-time-picker__calendar .rdp-month.loading .rdp-month_grid {
	opacity: .5;
}

.gpb-booking-time-picker__calendar-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
	border-radius: 4px;
}

.gpb-booking-time-picker__calendar-loading-text {
	background: #fff;
	padding: 0.5rem 1rem;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	color: #666;
}
