/**
 * FashionPoint Booking - Calendar & Timeslot Styles
 *
 * @since 2.5.0
 */

/* ==========================================================================
	Date & Time Selection
	========================================================================== */

.fp-booking .datetime-selection {
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	box-sizing: border-box;
	overflow: visible;
}

.fp-booking .datetime-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
	overflow: visible;
	width: 100%;
	max-width: 100%;
	margin: 0;
	box-sizing: border-box;
}

.fp-booking .calendar-section {
	background: #ffffff;
	border-radius: var(--fp-radius-lg);
	padding: 1rem;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	width: 100%;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.fp-booking .calendar-section {
		padding: 2rem;
	}
}

.fp-booking .calendar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.fp-booking .datetime-selection .step-intro {
	display: none;
}

.fp-booking .calendar-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}

.fp-booking .calendar-nav {
	width: 36px;
	height: 36px;
	border: none;
	background: #f6f6f6;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 160ms ease;
}

.fp-booking .calendar-nav:hover {
	background: #d6ae47;
	color: #fff;
}

.fp-booking .calendar-nav:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

.fp-booking .calendar-weekdays {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	margin: 0 0 2px;
}

.fp-booking .weekday {
	display: none;
}

.fp-booking .calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	box-sizing: border-box;
}

@media (min-width: 768px) {
	.fp-booking .calendar-grid {
		gap: 12px;
	}
}

.fp-booking .calendar-day {
	height: 52px;
	border: 2px solid #e5e7eb;
	background: #ffffff;
	border-radius: var(--fp-radius);
	font-size: 14px;
	font-weight: 700;
	color: var(--fp-text);
	cursor: pointer;
	transition: var(--fp-transition);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
	box-sizing: border-box;
	width: 100%;
}

@media (min-width: 768px) {
	.fp-booking .calendar-day {
		height: 72px;
		font-size: 16px;
		border-radius: var(--fp-radius-lg);
	}
}

.fp-booking .calendar-day.empty {
	background: transparent;
	pointer-events: none;
}

.fp-booking .calendar-day.past,
.fp-booking .calendar-day.unavailable {
	background: var(--fp-surface);
	color: var(--fp-text-lighter);
	cursor: not-allowed;
	border-color: var(--fp-border);
	opacity: 0.5;
}

.fp-booking .calendar-day.available:hover {
	background: var(--fp-surface);
	border-color: var(--fp-primary-light);
	transform: translateY(-2px);
	box-shadow: var(--fp-shadow);
}

.fp-booking .calendar-day.selected {
	background: linear-gradient(135deg, var(--fp-primary), var(--fp-primary-dark));
	color: #fff;
	border-color: transparent;
	box-shadow: 0 4px 12px rgba(var(--fp-primary-rgb), 0.3);
	transform: translateY(-2px);
}

.fp-booking .calendar-day.strip {
	flex-direction: column;
	gap: 4px;
}

.fp-booking .calendar-day .day-week {
	font-size: 11px;
	font-weight: 600;
	color: #9ca3af;
}

.fp-booking .calendar-day.selected .day-week,
.fp-booking .calendar-day.selected .day-num {
	color: #fff;
}

/* ==========================================================================
   Calendar View Toggle
   ========================================================================== */

.fp-booking .calendar-view-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	margin-bottom: 16px;
	background: #f3f4f6;
	border-radius: 10px;
	padding: 4px;
}

.fp-booking .calendar-view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: #6b7280;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 200ms ease;
	flex: 1;
	white-space: nowrap;
}

.fp-booking .calendar-view-btn:hover {
	color: #374151;
	background: rgba(255, 255, 255, 0.5);
}

.fp-booking .calendar-view-btn.active {
	background: #ffffff;
	color: #0f172a;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.fp-booking .calendar-view-btn svg {
	flex-shrink: 0;
}

/* ==========================================================================
   Month View Styles
   ========================================================================== */

.fp-booking .calendar-weekdays.month-visible {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 6px;
	margin-bottom: 6px;
}

.fp-booking .calendar-weekdays.month-visible .weekday {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 6px 0;
}

@media (min-width: 768px) {
	.fp-booking .calendar-weekdays.month-visible .weekday {
		font-size: 13px;
		padding: 8px 0;
	}
}

.fp-booking .calendar-grid.month-view {
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

@media (min-width: 768px) {
	.fp-booking .calendar-grid.month-view {
		gap: 6px;
	}
}

.fp-booking .calendar-day.month {
	height: 40px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	border-width: 1.5px;
	box-shadow: none;
	flex-direction: column;
}

@media (min-width: 768px) {
	.fp-booking .calendar-day.month {
		height: 48px;
		font-size: 15px;
		border-radius: 10px;
	}
}

.fp-booking .calendar-day.month.empty {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
}

.fp-booking .calendar-day.month.today:not(.selected) {
	border-color: var(--fp-primary, #d6ae47);
	background: rgba(214, 174, 71, 0.06);
}

.fp-booking .calendar-day.month.available {
	background: #ffffff;
	border-color: #e5e7eb;
	color: #1f2937;
}

.fp-booking .calendar-day.month.available:hover {
	background: rgba(214, 174, 71, 0.08);
	border-color: var(--fp-primary-light, #e8ca6e);
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.fp-booking .calendar-day.month.unavailable {
	background: #f9fafb;
	border-color: transparent;
	color: #d1d5db;
	opacity: 0.6;
}

.fp-booking .calendar-day.month.selected {
	background: linear-gradient(135deg, var(--fp-primary, #d6ae47), var(--fp-primary-dark, #b8922f));
	color: #fff;
	border-color: transparent;
	box-shadow: 0 3px 10px rgba(var(--fp-primary-rgb, 214, 174, 71), 0.35);
	transform: translateY(-1px);
}

/* Calendar Promo Indicators */
.fp-booking .calendar-day.promo-indicator {
	position: relative;
}

.fp-booking .calendar-day.promo-indicator::before {
	content: '%';
	position: absolute;
	top: -9px;
	right: 4px;
	width: 18px;
	height: 18px;
	background: linear-gradient(135deg, #c9963a 0%, #b8852e 100%);
	color: #000000;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	z-index: 2;
	box-shadow: 0 2px 4px rgba(201, 150, 58, 0.3);
}

/* Week view promo indicator */
.fp-booking .calendar-day.strip.promo-indicator::before {
	top: -8px;
	right: 2px;
	width: 16px;
	height: 16px;
	font-size: 9px;
}

/* Month view promo indicator */
.fp-booking .calendar-day.month.promo-indicator::before {
	top: -8px;
	right: 3px;
	width: 17px;
	height: 17px;
	font-size: 9px;
}

/* Selected state - keep same colors as normal state */
.fp-booking .calendar-day.selected.promo-indicator::before {
	background: linear-gradient(135deg, #c9963a 0%, #b8852e 100%);
	color: #000000;
	box-shadow: 0 2px 4px rgba(201, 150, 58, 0.3);
}

/* Ensure calendar day text remains centered */
.fp-booking .calendar-day.promo-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.fp-booking .calendar-day.strip.promo-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.fp-booking .calendar-day.month.promo-indicator {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Theme-specific promo indicator colors */
.fp-booking .theme-premium-black .calendar-day.promo-indicator::before {
	background: linear-gradient(135deg, #c9963a 0%, #b8852e 100%);
	color: #000000;
	box-shadow: 0 2px 4px rgba(201, 150, 58, 0.3);
}

.fp-booking .theme-premium-gold .calendar-day.promo-indicator::before {
	background: #d4af37;
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.fp-booking .theme-default .calendar-day.promo-indicator::before {
	background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
	color: #ffffff;
	box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.fp-booking .calendar-loading,
.fp-booking .timeslots-loading {
	text-align: center;
	padding: 40px 20px;
}

.fp-booking .spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #f3f4f6;
	border-top-color: #d6ae47;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	margin: 0 auto 12px;
}

/* Smaller spinner for buttons */
.fp-booking .btn-send-code .spinner,
.fp-booking .btn-verify .spinner {
	width: 20px;
	height: 20px;
	border: 2px solid #f3f4f6;
	border-top-color: #ffffff;
	margin: 0 auto 0;
	display: inline-block;
	vertical-align: middle;
	margin-right: 8px;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

.fp-booking .timeslots-section {
	background: transparent;
	padding: 20px 0 0 0;
	width: 100%;
	margin: 0;
	box-sizing: border-box;
	overflow: visible;
}

@media (min-width: 768px) {
	.fp-booking .timeslots-section {
		padding: 0;
		width: 100%;
		overflow: visible;
	}
}

.fp-booking .timeslots-title {
	margin: 0 0 16px 0;
	font-size: 18px;
	font-weight: 700;
	color: #101827;
	text-align: center;
}

.fp-booking .timeslots-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	box-sizing: border-box;
	overflow: visible;
	padding: 15px 5px 5px 5px;
}

/* Wrapper for time slots with promo badges */
.fp-booking .timeslots-grid > div {
	flex: 0 0 calc(50% - 5px);
	min-width: 0;
	position: relative;
	overflow: visible;
}

.fp-booking .timeslot-button {
	width: 100%;
	overflow: visible;
	position: relative;
}

/* Remove all old pseudo-element promo indicators */
.fp-booking .timeslot-button.promo-indicator::before,
.fp-booking .timeslot-button.promo-indicator::after {
	display: none !important;
	content: none !important;
}

@media (min-width: 768px) {
	.fp-booking .timeslots-grid {
		max-width: 600px;
		margin: 0 auto;
	}
	
	.fp-booking .timeslots-grid > div {
		flex: 0 0 calc(33.333% - 7px);
	}
}

@media (min-width: 1024px) {
	.fp-booking .timeslots-grid > div {
		flex: 0 0 calc(25% - 8px);
	}
}

.fp-booking .timeslot {
	padding: 12px 10px;
	border: 2px solid #e5e7eb;
	border-radius: var(--fp-radius-lg);
	background: #ffffff;
	box-sizing: border-box;
	width: 100%;
	font-size: 15px;
	font-weight: 700;
	color: var(--fp-text);
	cursor: pointer;
	transition: var(--fp-transition);
	text-align: center;
	width: 100%;
	min-height: 56px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (min-width: 768px) {
	.fp-booking .timeslot {
		padding: 16px 14px;
		font-size: 16px;
	}
}

.fp-booking .timeslot-button {
	padding: 10px 12px;
	border: none;
	border-radius: 6px;
	background: transparent;
	font-size: 15px;
	font-weight: 600;
	color: #1f2937;
	width: 100%;
	min-height: auto;
	text-align: center;
	cursor: pointer;
	transition: all 160ms ease;
	box-shadow: none;
}

.fp-booking .timeslot-button:hover {
	background: rgba(214, 174, 71, 0.1);
	color: #d6ae47;
}

.fp-booking .timeslot-button.selected {
	background: #d6ae47 !important;
	color: #fff !important;
	font-weight: 700 !important;
}

.fp-booking .timeslot:hover {
	background: var(--fp-surface);
	border-color: var(--fp-primary-light);
	box-shadow: var(--fp-shadow);
	transform: translateY(-2px);
}

.fp-booking .timeslot.selected {
	background: linear-gradient(135deg, var(--fp-primary), var(--fp-primary-dark));
	color: #fff;
	border-color: transparent;
	box-shadow: 0 4px 12px rgba(var(--fp-primary-rgb), 0.3);
	transform: translateY(-2px);
}

.fp-booking .timeslots-empty {
	text-align: center;
	padding: 40px 20px;
	color: #6b7280;
}

.fp-booking .timeslots-empty svg {
	color: #d1d5db;
	margin-bottom: 12px;
}

.fp-booking .datetime-summary {
	margin: 16px 0;
	padding: 12px 16px;
	background: rgba(214, 174, 71, 0.1);
	border-radius: 8px;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
}

.fp-booking .datetime-summary h4 {
	margin: 0 0 6px 0;
	font-size: 13px;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
}

.fp-booking .datetime-summary__content {
	font-weight: 700;
	font-size: 16px;
	color: #1f2937;
}
