/**
 * Booking Form Shortcode Styles
 * Mobile-First, Production-Ready CSS
 * @package HolidayHomeBooking
 */

/* ==========================================================================
   CSS Custom Properties (Variables)
   ========================================================================== */

:root {
	/* Colors */
	--hhb-primary: #2563eb;
	--hhb-primary-hover: #1d4ed8;
	--hhb-primary-light: #eff6ff;
	--hhb-success: #10b981;
	--hhb-success-light: #d1fae5;
	--hhb-error: #ef4444;
	--hhb-error-light: #fee2e2;
	--hhb-warning: #f59e0b;
	--hhb-warning-light: #fef3c7;
	
	/* Neutral Colors */
	--hhb-text-primary: #1f2937;
	--hhb-text-secondary: #6b7280;
	--hhb-border: #e5e7eb;
	--hhb-border-dark: #d1d5db;
	--hhb-bg-white: #ffffff;
	--hhb-bg-light: #f9fafb;
	--hhb-bg-gray: #f3f4f6;
	
	/* Spacing */
	--hhb-spacing-xs: 0.5rem;   /* 8px */
	--hhb-spacing-sm: 0.75rem;  /* 12px */
	--hhb-spacing-md: 1rem;     /* 16px */
	--hhb-spacing-lg: 1.5rem;   /* 24px */
	--hhb-spacing-xl: 2rem;     /* 32px */
	
	/* Typography */
	--hhb-font-size-xs: 0.75rem;   /* 12px */
	--hhb-font-size-sm: 0.875rem;  /* 14px */
	--hhb-font-size-base: 1rem;    /* 16px */
	--hhb-font-size-lg: 1.125rem;  /* 18px */
	--hhb-font-size-xl: 1.25rem;   /* 20px */
	--hhb-font-size-2xl: 1.5rem;   /* 24px */
	
	/* Border Radius */
	--hhb-radius-sm: 0.25rem;  /* 4px */
	--hhb-radius-md: 0.5rem;   /* 8px */
	--hhb-radius-lg: 0.75rem;  /* 12px */
	
	/* Shadows */
	--hhb-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--hhb-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--hhb-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	
	/* Touch Targets */
	--hhb-touch-target: 44px;
	
	/* Transitions */
	--hhb-transition: all 0.2s ease;
}

/* ==========================================================================
   Base Form Container - Mobile First
   ========================================================================== */

.hhb-booking-form {
	width: 100%;
	max-width: 100%;
	margin: var(--hhb-spacing-md) 0;
	padding: var(--hhb-spacing-md);
	background: var(--hhb-bg-white);
	border: 1px solid var(--hhb-border);
	border-radius: var(--hhb-radius-md);
	box-shadow: var(--hhb-shadow-sm);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: var(--hhb-font-size-base);
	line-height: 1.5;
	color: var(--hhb-text-primary);
	box-sizing: border-box;
}

/* Tablet and up */
@media (min-width: 768px) {
	.hhb-booking-form {
		max-width: 600px;
		margin: var(--hhb-spacing-xl) auto;
		padding: var(--hhb-spacing-xl);
		box-shadow: var(--hhb-shadow-md);
	}
}

/* Tablet and up */
@media (min-width: 768px) {
	.hhb-booking-form {
		max-width: 600px;
		margin: var(--hhb-spacing-xl) auto;
		padding: var(--hhb-spacing-xl);
		box-shadow: var(--hhb-shadow-md);
	}
}

/* Desktop */
@media (min-width: 1024px) {
	.hhb-booking-form {
		padding: var(--hhb-spacing-xl) 2.5rem;
	}
}

/* ==========================================================================
   Layout Variants
   ========================================================================== */

.hhb-booking-form.hhb-layout-horizontal {
	max-width: 100%;
}

@media (min-width: 768px) {
	.hhb-booking-form.hhb-layout-horizontal {
		max-width: 900px;
	}
}

.hhb-booking-form.hhb-layout-compact {
	max-width: 100%;
	padding: var(--hhb-spacing-md);
}

@media (min-width: 768px) {
	.hhb-booking-form.hhb-layout-compact {
		max-width: 500px;
		padding: var(--hhb-spacing-lg);
	}
}

/* ==========================================================================
   Form Messages
   ========================================================================== */

.hhb-form-messages {
	margin-bottom: var(--hhb-spacing-lg);
}

.hhb-message {
	padding: var(--hhb-spacing-md);
	border-radius: var(--hhb-radius-md);
	margin-bottom: var(--hhb-spacing-md);
	font-size: var(--hhb-font-size-sm);
	line-height: 1.5;
	border: 1px solid transparent;
}

.hhb-message.hhb-error {
	background: var(--hhb-error-light);
	border-color: var(--hhb-error);
	color: #991b1b;
}

.hhb-message.hhb-success {
	background: var(--hhb-success-light);
	border-color: var(--hhb-success);
	color: #065f46;
}

.hhb-message.hhb-warning {
	background: var(--hhb-warning-light);
	border-color: var(--hhb-warning);
	color: #92400e;
}

/* ==========================================================================
   Form Fields - Mobile First
   ========================================================================== */

.hhb-form-field {
	margin-bottom: var(--hhb-spacing-lg);
}

.hhb-form-field label {
	display: block;
	margin-bottom: var(--hhb-spacing-xs);
	font-weight: 600;
	font-size: var(--hhb-font-size-sm);
	color: var(--hhb-text-primary);
	line-height: 1.5;
}

.hhb-required {
	color: var(--hhb-error);
	margin-left: 2px;
}

/* Form Inputs - Touch Friendly */
.hhb-form-field input[type="text"],
.hhb-form-field input[type="email"],
.hhb-form-field input[type="tel"],
.hhb-form-field input[type="number"],
.hhb-form-field select,
.hhb-form-field textarea {
	width: 100%;
	min-height: var(--hhb-touch-target);
	padding: var(--hhb-spacing-sm) var(--hhb-spacing-md);
	border: 1px solid var(--hhb-border-dark);
	border-radius: var(--hhb-radius-sm);
	font-size: var(--hhb-font-size-base);
	line-height: 1.5;
	background: var(--hhb-bg-white);
	color: var(--hhb-text-primary);
	transition: var(--hhb-transition);
	box-sizing: border-box;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.hhb-form-field textarea {
	min-height: 120px;
	resize: vertical;
}

/* Focus State - Accessibility */
.hhb-form-field input:focus,
.hhb-form-field select:focus,
.hhb-form-field textarea:focus {
	outline: none;
	border-color: var(--hhb-primary);
	box-shadow: 0 0 0 3px var(--hhb-primary-light);
}

.hhb-form-field input:read-only {
	background: var(--hhb-bg-light);
	cursor: pointer;
}

/* Disabled State */
.hhb-form-field input:disabled,
.hhb-form-field select:disabled,
.hhb-form-field textarea:disabled {
	background: var(--hhb-bg-gray);
	cursor: not-allowed;
	opacity: 0.6;
}

/* ==========================================================================
   Form Rows (Side by Side Fields)
   ========================================================================== */

.hhb-form-row {
	display: flex;
	flex-direction: column;
	gap: var(--hhb-spacing-lg);
	margin-bottom: var(--hhb-spacing-lg);
}

.hhb-form-row .hhb-form-field {
	flex: 1;
	margin-bottom: 0;
}

/* Tablet and up - Side by side */
@media (min-width: 768px) {
	.hhb-form-row {
		flex-direction: row;
		gap: var(--hhb-spacing-md);
	}
	
	.hhb-layout-compact .hhb-form-row {
		flex-direction: column;
		gap: var(--hhb-spacing-lg);
	}
	
	.hhb-layout-compact .hhb-form-row .hhb-form-field {
		margin-bottom: 0;
	}
}

/* ==========================================================================
   Availability Status
   ========================================================================== */

.hhb-availability-status {
	padding: var(--hhb-spacing-md);
	margin-bottom: var(--hhb-spacing-lg);
	border-radius: var(--hhb-radius-md);
	background: var(--hhb-bg-light);
	font-size: var(--hhb-font-size-sm);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--hhb-spacing-sm);
	border: 1px solid var(--hhb-border);
}

.hhb-availability-label {
	font-weight: 600;
	color: var(--hhb-text-primary);
}

.hhb-availability-result {
	color: var(--hhb-text-secondary);
	font-weight: 500;
}

.hhb-availability-result.hhb-available {
	color: var(--hhb-success);
	font-weight: 600;
}

.hhb-availability-result.hhb-unavailable {
	color: var(--hhb-error);
	font-weight: 600;
}

.hhb-availability-result.hhb-checking {
	color: var(--hhb-primary);
	font-style: italic;
}

/* ==========================================================================
   Price Summary
   ========================================================================== */

.hhb-price-summary {
	padding: var(--hhb-spacing-lg);
	margin-bottom: var(--hhb-spacing-lg);
	border: 2px solid var(--hhb-primary);
	border-radius: var(--hhb-radius-md);
	background: var(--hhb-primary-light);
}

.hhb-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--hhb-spacing-sm);
	font-size: var(--hhb-font-size-sm);
	gap: var(--hhb-spacing-md);
}

.hhb-price-row:last-child {
	margin-bottom: 0;
}

.hhb-price-row.hhb-price-total {
	margin-top: var(--hhb-spacing-md);
	padding-top: var(--hhb-spacing-md);
	border-top: 2px solid var(--hhb-primary);
	font-size: var(--hhb-font-size-lg);
	font-weight: 700;
}

.hhb-price-label {
	color: var(--hhb-text-primary);
	flex-shrink: 0;
}

.hhb-price-value {
	color: var(--hhb-primary);
	font-weight: 600;
	text-align: right;
}

.hhb-price-total .hhb-price-value {
	font-size: var(--hhb-font-size-xl);
}

@media (min-width: 768px) {
	.hhb-price-row {
		font-size: var(--hhb-font-size-base);
	}
	
	.hhb-price-row.hhb-price-total {
		font-size: var(--hhb-font-size-xl);
	}
	
	.hhb-price-total .hhb-price-value {
		font-size: var(--hhb-font-size-2xl);
	}
}

/* ==========================================================================
   Guest Details Section
   ========================================================================== */

.hhb-form-section {
	margin-top: var(--hhb-spacing-xl);
	padding-top: var(--hhb-spacing-xl);
	border-top: 1px solid var(--hhb-border);
}

.hhb-form-section h3 {
	margin-top: 0;
	margin-bottom: var(--hhb-spacing-lg);
	font-size: var(--hhb-font-size-lg);
	font-weight: 600;
	color: var(--hhb-text-primary);
	line-height: 1.3;
}

@media (min-width: 768px) {
	.hhb-form-section h3 {
		font-size: var(--hhb-font-size-xl);
	}
}

/* ==========================================================================
   Form Actions - Touch Friendly
   ========================================================================== */

.hhb-form-actions {
	margin-top: var(--hhb-spacing-xl);
	text-align: center;
}

.hhb-submit-button {
	width: 100%;
	min-height: var(--hhb-touch-target);
	padding: var(--hhb-spacing-md) var(--hhb-spacing-xl);
	font-size: var(--hhb-font-size-base);
	font-weight: 600;
	border: none;
	border-radius: var(--hhb-radius-sm);
	cursor: pointer;
	transition: var(--hhb-transition);
	line-height: 1.5;
	text-align: center;
	display: inline-block;
}

@media (min-width: 768px) {
	.hhb-submit-button {
		width: auto;
		min-width: 180px;
	}
}

.hhb-submit-button:hover {
	transform: translateY(-2px);
	box-shadow: var(--hhb-shadow-lg);
}

.hhb-submit-button:active {
	transform: translateY(0);
}

.hhb-submit-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.hhb-button-primary {
	background: var(--hhb-primary);
	color: var(--hhb-bg-white);
}

.hhb-button-primary:hover:not(:disabled) {
	background: var(--hhb-primary-hover);
}

.hhb-button-secondary {
	background: var(--hhb-text-secondary);
	color: var(--hhb-bg-white);
}

.hhb-button-secondary:hover:not(:disabled) {
	background: var(--hhb-text-primary);
}

.hhb-button-outline {
	background: transparent;
	color: var(--hhb-primary);
	border: 2px solid var(--hhb-primary);
}

.hhb-button-outline:hover:not(:disabled) {
	background: var(--hhb-primary);
	color: var(--hhb-bg-white);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.hhb-booking-form.hhb-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.hhb-booking-form.hhb-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 4px solid var(--hhb-border);
	border-top: 4px solid var(--hhb-primary);
	border-radius: 50%;
	animation: hhb-spin 1s linear infinite;
	z-index: 10;
}

@keyframes hhb-spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   jQuery UI Datepicker Customization
   ========================================================================== */

.ui-datepicker {
	font-family: inherit;
	font-size: var(--hhb-font-size-sm);
	border-radius: var(--hhb-radius-md);
	box-shadow: var(--hhb-shadow-lg);
}

.ui-datepicker .ui-state-disabled {
	background: var(--hhb-bg-gray);
	color: var(--hhb-text-secondary);
	cursor: not-allowed;
	opacity: 0.5;
}

.ui-datepicker .ui-state-disabled .ui-state-default {
	text-decoration: line-through;
}

.ui-datepicker .ui-state-active,
.ui-datepicker .ui-state-highlight {
	background: var(--hhb-primary);
	color: var(--hhb-bg-white);
}

/* ==========================================================================
   Error State
   ========================================================================== */

.hhb-error {
	padding: var(--hhb-spacing-md);
	background: var(--hhb-error-light);
	border: 1px solid var(--hhb-error);
	border-radius: var(--hhb-radius-md);
	color: #991b1b;
	margin: var(--hhb-spacing-lg) 0;
	font-size: var(--hhb-font-size-sm);
	line-height: 1.5;
}

/* ==========================================================================
   Upgrade Notice (Free Version)
   ========================================================================== */

.hhb-booking-form-upgrade-notice {
	max-width: 100%;
	margin: var(--hhb-spacing-md) 0;
}

@media (min-width: 768px) {
	.hhb-booking-form-upgrade-notice {
		max-width: 700px;
		margin: var(--hhb-spacing-xl) auto;
	}
}

.hhb-booking-form-upgrade-notice .button-primary {
	text-decoration: none;
	display: inline-block;
	min-height: var(--hhb-touch-target);
	padding: var(--hhb-spacing-md) var(--hhb-spacing-xl);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.hhb-booking-form {
		border: none;
		box-shadow: none;
		padding: 0;
	}
	
	.hhb-submit-button,
	.hhb-form-actions {
		display: none;
	}
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.rtl .hhb-booking-form {
	direction: rtl;
	text-align: right;
}

.rtl .hhb-required {
	margin-left: 0;
	margin-right: 2px;
}

.rtl .hhb-price-value {
	text-align: left;
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus visible for keyboard navigation */
.hhb-submit-button:focus-visible,
.hhb-form-field input:focus-visible,
.hhb-form-field select:focus-visible,
.hhb-form-field textarea:focus-visible {
	outline: 3px solid var(--hhb-primary);
	outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* High contrast mode */
@media (prefers-contrast: high) {
	.hhb-booking-form {
		border-width: 2px;
	}
	
	.hhb-form-field input,
	.hhb-form-field select,
	.hhb-form-field textarea {
		border-width: 2px;
	}
}

