/**
 * Frontend Styles for Bike Shop Manager Plugin
 *
 * @package BikeShopManager
 */

/* Booking Section Styles */
.bsm-booking-section {
	margin: 20px 0;
	padding: 20px;
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.bsm-booking-section h3,
.bsm-booking-section h4 {
	margin-top: 0;
	color: #333;
}

/* Calendar Wrapper */
.bsm-calendar-wrapper {
	margin: 15px 0;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.bsm-date-picker,
.bsm-time-picker {
	flex: 1;
	min-width: 200px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.bsm-date-picker:focus,
.bsm-time-picker:focus {
	outline: none;
	border-color: #0071a1;
	box-shadow: 0 0 0 1px #0071a1;
}

/* Bike Details Form */
.bsm-bike-details {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #ddd;
}

.bsm-bike-details p {
	margin: 0 0 15px;
}

.bsm-bike-details label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
	color: #333;
}

.bsm-bike-details .required {
	color: #f00;
}

.bsm-input {
	width: 100%;
	max-width: 400px;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.bsm-input:focus {
	outline: none;
	border-color: #0071a1;
	box-shadow: 0 0 0 1px #0071a1;
}

/* Subscription Status Box */
.bsm-subscription-status {
	margin: 20px 0;
	padding: 20px;
	background: #e7f7f7;
	border-left: 4px solid #0071a1;
	border-radius: 4px;
}

.bsm-subscription-status h3 {
	margin-top: 0;
	color: #0071a1;
}

.bsm-subscription-status p {
	margin: 10px 0;
}

.bsm-status-active {
	display: inline-block;
	padding: 3px 10px;
	background: #28a745;
	color: #fff;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

/* Loading State */
.bsm-loading {
	opacity: 0.6;
	pointer-events: none;
}

.bsm-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #0071a1;
	border-radius: 50%;
	animation: bsm-spin 1s linear infinite;
}

@keyframes bsm-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Error Messages */
.bsm-error {
	padding: 10px;
	margin: 10px 0;
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
}

/* Success Messages */
.bsm-success {
	padding: 10px;
	margin: 10px 0;
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.bsm-calendar-wrapper {
		flex-direction: column;
	}
	
	.bsm-date-picker,
	.bsm-time-picker {
		min-width: 100%;
	}
	
	.bsm-input {
		max-width: 100%;
	}
}

/* ====================== */
/* Booking Popup Styles   */
/* ====================== */

/* Trigger button */
.bsm-popup-trigger {
	display: inline-block;
	padding: 14px 30px;
	background: #0071a1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.bsm-popup-trigger:hover,
.bsm-popup-trigger:focus {
	background: #005a87;
	color: #fff;
	outline: none;
}

/* Overlay */
.bsm-popup-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	animation: bsmFadeIn 0.25s ease;
	-webkit-overflow-scrolling: touch;
}

@keyframes bsmFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Modal */
.bsm-popup-modal {
	position: relative;
	background: #fff;
	border-radius: 10px;
	padding: 30px;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	max-height: 90dvh;
	overflow-y: auto;
	box-sizing: border-box;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	animation: bsmSlideUp 0.3s ease;
	-webkit-overflow-scrolling: touch;
}

.bsm-popup-modal *,
.bsm-popup-modal *::before,
.bsm-popup-modal *::after {
	box-sizing: border-box;
}

@keyframes bsmSlideUp {
	from { transform: translateY(30px); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.bsm-popup-modal h2 {
	margin: 0 0 5px;
	padding-right: 36px;
	font-size: 22px;
	color: #333;
	word-wrap: break-word;
}

.bsm-popup-price {
	margin: 0 0 20px;
	font-size: 18px;
	color: #0071a1;
	font-weight: 600;
}

/* Close button */
.bsm-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #f0f0f0;
	border: none;
	font-size: 24px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease, color 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	z-index: 1;
}

.bsm-popup-close:hover,
.bsm-popup-close:focus {
	background: #e0e0e0;
	color: #333;
	outline: none;
}

/* Form inside popup */
.bsm-popup-form .bsm-booking-section {
	margin: 0;
	padding: 0;
	background: none;
	border: none;
}

.bsm-popup-form .bsm-input,
.bsm-popup-form .bsm-date-picker,
.bsm-popup-form .bsm-time-picker {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 6px;
	-webkit-appearance: none;
	appearance: none;
}

.bsm-popup-form .bsm-input:focus,
.bsm-popup-form .bsm-date-picker:focus,
.bsm-popup-form .bsm-time-picker:focus {
	outline: none;
	border-color: #0071a1;
	box-shadow: 0 0 0 2px rgba(0, 113, 161, 0.2);
}

.bsm-popup-form textarea.bsm-input {
	resize: vertical;
	min-height: 88px;
}

.bsm-popup-form .bsm-calendar-wrapper {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.bsm-popup-form .bsm-calendar-wrapper > * {
	flex: 1;
	min-width: 0;
}

.bsm-popup-submit {
	display: block;
	width: 100%;
	padding: 14px;
	margin-top: 20px;
	background: #0071a1;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	min-height: 48px;
	transition: background 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.bsm-popup-submit:hover,
.bsm-popup-submit:focus {
	background: #005a87;
	outline: none;
}

.bsm-popup-submit:active {
	transform: scale(0.98);
}

/* =============================== */
/* Popup Responsive – Tablet       */
/* =============================== */
@media (max-width: 768px) {
	.bsm-popup-overlay {
		padding: 12px;
	}

	.bsm-popup-modal {
		padding: 24px 20px;
		border-radius: 12px;
	}

	.bsm-popup-modal h2 {
		font-size: 20px;
	}

	.bsm-popup-price {
		font-size: 16px;
		margin-bottom: 16px;
	}

	.bsm-popup-form .bsm-calendar-wrapper {
		flex-direction: column;
		gap: 8px;
	}

	.bsm-popup-form .bsm-calendar-wrapper > * {
		min-width: 100%;
	}

	.bsm-popup-form .bsm-bike-details h4 {
		font-size: 15px;
	}
}

/* =============================== */
/* Popup Responsive – Small Phone  */
/* =============================== */
@media (max-width: 480px) {
	.bsm-popup-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.bsm-popup-modal {
		width: 100%;
		max-width: 100%;
		max-height: 95vh;
		max-height: 95dvh;
		border-radius: 16px 16px 0 0;
		padding: 20px 16px;
		padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		animation: bsmSlideUpMobile 0.3s ease;
	}

	@keyframes bsmSlideUpMobile {
		from { transform: translateY(100%); opacity: 0; }
		to   { transform: translateY(0);    opacity: 1; }
	}

	.bsm-popup-modal h2 {
		font-size: 18px;
		padding-right: 40px;
	}

	.bsm-popup-price {
		font-size: 15px;
		margin-bottom: 14px;
	}

	.bsm-popup-close {
		top: 8px;
		right: 8px;
		width: 34px;
		height: 34px;
		font-size: 22px;
	}

	.bsm-popup-form .bsm-booking-section h3 {
		font-size: 15px;
		margin-bottom: 10px;
	}

	.bsm-popup-form .bsm-input,
	.bsm-popup-form .bsm-date-picker,
	.bsm-popup-form .bsm-time-picker {
		font-size: 16px;
		padding: 12px;
		min-height: 48px;
	}

	.bsm-popup-form .bsm-bike-details {
		margin-top: 14px;
		padding-top: 14px;
	}

	.bsm-popup-form .bsm-bike-details label {
		font-size: 14px;
	}

	.bsm-popup-submit {
		margin-top: 16px;
		padding: 16px;
		font-size: 16px;
		min-height: 52px;
		border-radius: 8px;
	}

	.bsm-popup-trigger {
		width: 100%;
		text-align: center;
		padding: 16px 20px;
		font-size: 16px;
	}
}
