/**
 * Appointment Booking Pro - Frontend Styles
 * Mobile-first, compact card/modal style (following Motorhome Booking reference pattern)
 */

/* =====================================================
   BASE & RESET
   ===================================================== */

.apt-booking-form {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	box-sizing: border-box;
	max-width: 500px;
	margin: 20px auto;
	padding: 0;
}

.apt-booking-form *,
.apt-booking-form *::before,
.apt-booking-form *::after {
	box-sizing: inherit;
}

/* =====================================================
   CARD/STEP CONTAINER
   ===================================================== */

.apt-step {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.apt-step h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #2271b1;
	font-size: 20px;
	font-weight: 600;
	text-align: center;
}

.apt-step-back {
	margin-bottom: 15px;
	font-size: 14px;
}

.apt-step-back a {
	color: #2271b1;
	text-decoration: none;
}

.apt-step-back a:hover {
	text-decoration: underline;
}

/* =====================================================
   BUTTONS
   ===================================================== */

.apt-btn {
	display: inline-block;
	padding: 10px 20px;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	line-height: 1.5;
	width: 100%;
}

.apt-btn:active {
	transform: scale(0.98);
}

.apt-btn-primary {
	background: #2271b1;
	color: white;
}

.apt-btn-primary:hover {
	background: #135e96;
}

.apt-btn-large {
	padding: 15px 30px;
	font-size: 18px;
}

.apt-btn-sm {
	padding: 6px 12px;
	font-size: 14px;
	width: auto;
}

/* =====================================================
   SERVICE LIST (STEP 1)
   ===================================================== */

.apt-service-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.apt-service-card {
	background: #f9f9f9;
	border: 2px solid #ddd;
	border-radius: 6px;
	padding: 15px;
	cursor: pointer;
	transition: all 0.2s;
}

.apt-service-card:hover {
	border-color: #2271b1;
	background: #fff;
	box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2);
}

.apt-service-card.selected {
	border-color: #2271b1;
	background: #e7f3ff;
}

.apt-service-card h4 {
	margin: 0 0 8px 0;
	font-size: 18px;
	color: #333;
}

.apt-service-duration {
	margin: 0 0 5px 0;
	font-size: 14px;
	color: #666;
}

.apt-service-price {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #2271b1;
}

/* =====================================================
   RESOURCE LIST (STEP 2)
   ===================================================== */

.apt-resource-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.apt-resource-card {
	background: #f9f9f9;
	border: 2px solid #ddd;
	border-radius: 6px;
	padding: 15px;
	cursor: pointer;
	transition: all 0.2s;
	text-align: center;
	font-size: 16px;
	font-weight: 500;
}

.apt-resource-card:hover {
	border-color: #2271b1;
	background: #fff;
	box-shadow: 0 2px 6px rgba(34, 113, 177, 0.2);
}

.apt-resource-card.selected {
	border-color: #2271b1;
	background: #e7f3ff;
}

/* =====================================================
   CALENDAR (STEP 3)
   ===================================================== */

.apt-calendar-controls {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	gap: 10px;
}

.apt-calendar-controls span {
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	flex-grow: 1;
}

.apt-calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 5px;
	margin-bottom: 15px;
}

.apt-calendar-day {
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	border: 1px solid #ddd;
	background: #f9f9f9;
	cursor: default;
}

.apt-calendar-day.header {
	background: #2271b1;
	color: white;
	font-weight: 600;
	border-color: #2271b1;
}

.apt-calendar-day.empty {
	background: transparent;
	border: none;
}

.apt-calendar-day.available {
	background: #d4edda;
	border-color: #c3e6cb;
	cursor: pointer;
}

.apt-calendar-day.available:hover {
	background: #b8dcc0;
}

.apt-calendar-day.booked {
	background: #f8d7da;
	border-color: #f5c6cb;
	color: #721c24;
}

.apt-calendar-day.pending {
	background: #fff3cd;
	border-color: #ffeaa7;
	color: #856404;
}

.apt-calendar-day.unavailable {
	background: #e9ecef;
	border-color: #dee2e6;
	color: #6c757d;
}

.apt-calendar-day.past {
	background: #f5f5f5;
	border-color: #e0e0e0;
	color: #999;
}

.apt-calendar-day.selected {
	background: #2271b1;
	color: white;
	border-color: #2271b1;
	font-weight: 700;
}

.apt-calendar-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 12px;
	margin-top: 10px;
}

.apt-legend-item {
	display: flex;
	align-items: center;
	gap: 5px;
}

.apt-legend-swatch {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 1px solid #ddd;
	border-radius: 3px;
}

.apt-legend-available {
	background: #d4edda;
}

.apt-legend-booked {
	background: #f8d7da;
}

.apt-legend-pending {
	background: #fff3cd;
}

.apt-legend-unavailable {
	background: #e9ecef;
}

/* =====================================================
   TIME SLOTS (STEP 4)
   ===================================================== */

#apt-selected-date-display {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 15px;
	text-align: center;
	color: #2271b1;
}

.apt-time-slot-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 10px;
}

.apt-time-slot {
	padding: 12px 8px;
	text-align: center;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	font-weight: 500;
	background: #f9f9f9;
	cursor: default;
}

.apt-time-slot.available {
	background: #d4edda;
	border-color: #c3e6cb;
	cursor: pointer;
}

.apt-time-slot.available:hover {
	background: #b8dcc0;
	border-color: #a8d4b0;
}

.apt-time-slot.available.selected {
	background: #2271b1;
	color: white;
	border-color: #2271b1;
}

.apt-time-slot.unavailable {
	background: #e9ecef;
	border-color: #dee2e6;
	color: #6c757d;
}

/* =====================================================
   FORM FIELDS (STEP 5)
   ===================================================== */

.apt-form-group {
	margin-bottom: 15px;
}

.apt-form-group label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
	font-size: 14px;
	color: #333;
}

.apt-required {
	color: #dc3545;
}

.apt-input {
	width: 100%;
	padding: 12px 16px;
	font-size: 16px;
	line-height: 1.5;
	border: 2px solid #ccc;
	border-radius: 4px;
	transition: border-color 0.2s;
}

.apt-input:focus {
	outline: none;
	border-color: #2271b1;
}

/* =====================================================
   BOOKING SUMMARY (STEP 6)
   ===================================================== */

.apt-booking-summary {
	background: #f9f9f9;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 15px;
	margin-bottom: 20px;
}

.apt-summary-row {
	display: flex;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.apt-summary-row:last-child {
	border-bottom: none;
	font-weight: 600;
	font-size: 18px;
	color: #2271b1;
}

.apt-summary-label {
	font-weight: 500;
	color: #666;
}

.apt-summary-value {
	font-weight: 600;
	color: #333;
}

/* =====================================================
   MESSAGES & NOTICES
   ===================================================== */

.apt-messages {
	margin-bottom: 20px;
}

.apt-notice {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 15px;
	font-size: 14px;
}

.apt-notice-warning {
	background: #fff3cd;
	border: 1px solid #ffeaa7;
	color: #856404;
}

.apt-notice-error {
	background: #f8d7da;
	border: 1px solid #f5c6cb;
	color: #721c24;
}

.apt-notice-success {
	background: #d4edda;
	border: 1px solid #c3e6cb;
	color: #155724;
}

.apt-notice-info {
	background: #d1ecf1;
	border: 1px solid #bee5eb;
	color: #0c5460;
}

/* =====================================================
   LOADING INDICATOR
   ===================================================== */

.apt-loading {
	text-align: center;
	padding: 40px 20px;
}

.apt-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: apt-spin 1s linear infinite;
	margin: 0 auto 15px auto;
}

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

.apt-loading p {
	font-size: 16px;
	color: #666;
}

/* =====================================================
   RESPONSIVE (MOBILE-FIRST)
   ===================================================== */

@media (max-width: 480px) {
	.apt-booking-form {
		margin: 10px;
	}

	.apt-step {
		padding: 15px;
	}

	.apt-step h3 {
		font-size: 18px;
	}

	.apt-calendar-day {
		font-size: 12px;
	}

	.apt-time-slot-list {
		grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
		gap: 8px;
	}

	.apt-time-slot {
		padding: 10px 6px;
		font-size: 14px;
	}
}

/* =====================================================
   UTILITIES
   ===================================================== */

.apt-hidden {
	display: none !important;
}

.apt-text-center {
	text-align: center;
}

.apt-mt-20 {
	margin-top: 20px;
}

.apt-mb-20 {
	margin-bottom: 20px;
}
