/**
 * HHB Frontend UI - Modern Card-Based Design
 * Scoped to .hhb-ui to prevent conflicts with themes and page builders
 * Mobile-first, builder-proof design
 *
 * @package Holiday_Home_Booking
 */

/* ========================================================================
   CORE HHB UI WRAPPER - Builder-Proof Foundation
   ======================================================================== */

.hhb-ui {
	/* CSS Variables for customizable styling */
	--hhb-accent-color: #2563eb;
	--hhb-text-color: #1a1a1a;
	--hhb-muted-text-color: #6b7280;
	--hhb-base-font-size: 16px;
	--hhb-font-weight: 600;
	--hhb-border-width: 1px;
	--hhb-border-opacity: 0.08;
	--hhb-corner-radius: 12px;
	
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: var(--hhb-base-font-size);
	line-height: 1.6;
	color: var(--hhb-text-color);
}

/* Force left-align and stretch in Breakdance flex containers */
.breakdance .hhb-ui {
	align-self: stretch;
	text-align: left;
	width: 100%;
	max-width: 100%;
}

.hhb-ui *,
.hhb-ui *::before,
.hhb-ui *::after {
	box-sizing: border-box;
}

/* ========================================================================
   CARD COMPONENTS
   ======================================================================== */

.hhb-card {
	background: #ffffff;
	border: var(--hhb-border-width) solid rgba(0, 0, 0, var(--hhb-border-opacity));
	border-radius: var(--hhb-corner-radius);
	padding: 24px;
	margin: 16px 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: box-shadow 0.2s ease;
}

.hhb-card:first-child {
	margin-top: 0;
}

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

.hhb-card__title {
	font-size: 24px;
	font-weight: var(--hhb-font-weight);
	margin: 0 0 16px 0;
	color: var(--hhb-text-color);
	line-height: 1.3;
}

.hhb-card__body {
	/* Body wrapper for card content */
}

/* ========================================================================
   FORM STYLING
   ======================================================================== */

.hhb-ui .hhb-form-field {
	margin-bottom: 20px;
}

.hhb-ui .hhb-form-field:last-child {
	margin-bottom: 0;
}

.hhb-ui label {
	display: block;
	font-weight: var(--hhb-font-weight);
	margin-bottom: 8px;
	color: var(--hhb-text-color);
	font-size: 15px;
}

.hhb-ui .hhb-required {
	color: #dc3545;
	margin-left: 2px;
}

.hhb-ui input[type="text"],
.hhb-ui input[type="email"],
.hhb-ui input[type="tel"],
.hhb-ui input[type="number"],
.hhb-ui input[type="date"],
.hhb-ui select,
.hhb-ui textarea {
	width: 100%;
	max-width: 100%;
	padding: 12px 16px;
	border: 1px solid #d1d5db;
	border-radius: var(--hhb-corner-radius);
	font-size: var(--hhb-base-font-size);
	line-height: 1.5;
	color: var(--hhb-text-color);
	background: #ffffff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.hhb-ui input[type="text"]:focus,
.hhb-ui input[type="email"]:focus,
.hhb-ui input[type="tel"]:focus,
.hhb-ui input[type="number"]:focus,
.hhb-ui input[type="date"]:focus,
.hhb-ui select:focus,
.hhb-ui textarea:focus {
	outline: none;
	border-color: var(--hhb-accent-color);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hhb-ui textarea {
	resize: vertical;
	min-height: 100px;
}

/* Form rows for side-by-side fields */
.hhb-ui .hhb-form-row {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

/* ========================================================================
   RESPONSIVE FORM LAYOUT
   ======================================================================== */

@media (min-width: 900px) {
	.hhb-ui .hhb-form-row {
		flex-direction: row;
	}
	
	.hhb-ui .hhb-form-row .hhb-form-field {
		flex: 1;
		margin-bottom: 0;
	}
	
	/* Max width for larger screens to maintain readability */
	.hhb-ui input[type="text"],
	.hhb-ui input[type="email"],
	.hhb-ui input[type="tel"],
	.hhb-ui input[type="number"],
	.hhb-ui select {
		max-width: 600px;
	}
	
	.hhb-ui textarea {
		max-width: 100%;
	}
	
	.hhb-card {
		padding: 32px;
	}
}

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

.hhb-ui button,
.hhb-ui .hhb-submit-button,
.hhb-ui .hhb-button-primary {
	display: inline-block;
	padding: 14px 28px;
	font-size: var(--hhb-base-font-size);
	font-weight: var(--hhb-font-weight);
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: var(--hhb-corner-radius);
	cursor: pointer;
	transition: all 0.2s ease;
	background: var(--hhb-accent-color);
	color: #ffffff;
}

.hhb-ui button:hover,
.hhb-ui .hhb-submit-button:hover,
.hhb-ui .hhb-button-primary:hover {
	background: var(--hhb-accent-color);
	filter: brightness(0.9);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

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

.hhb-ui button:disabled,
.hhb-ui .hhb-submit-button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hhb-ui .hhb-form-actions {
	margin-top: 24px;
	text-align: left;
}

/* ========================================================================
   PRICE SUMMARY & AVAILABILITY
   ======================================================================== */

.hhb-ui .hhb-price-summary {
	background: #f8f9fa;
	border-radius: var(--hhb-corner-radius);
	padding: 16px;
	margin: 20px 0;
}

.hhb-ui .hhb-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	font-size: 15px;
}

.hhb-ui .hhb-price-row.hhb-price-total {
	border-top: 2px solid #dee2e6;
	margin-top: 8px;
	padding-top: 12px;
	font-size: 18px;
	font-weight: 700;
}

.hhb-ui .hhb-price-label {
	color: var(--hhb-muted-text-color);
}

.hhb-ui .hhb-price-value {
	font-weight: var(--hhb-font-weight);
	color: var(--hhb-text-color);
}

.hhb-ui .hhb-availability-status {
	background: #f8f9fa;
	border-radius: var(--hhb-corner-radius);
	padding: 12px 16px;
	margin: 16px 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

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

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

/* ========================================================================
   MESSAGES & ALERTS
   ======================================================================== */

.hhb-ui .hhb-error {
	background: #fee2e2;
	border: 1px solid #fca5a5;
	border-left: 4px solid #dc2626;
	border-radius: var(--hhb-corner-radius);
	padding: 12px 16px;
	margin: 16px 0;
	color: #991b1b;
}

.hhb-ui .hhb-success {
	background: #d1fae5;
	border: 1px solid #6ee7b7;
	border-left: 4px solid #059669;
	border-radius: var(--hhb-corner-radius);
	padding: 12px 16px;
	margin: 16px 0;
	color: #065f46;
}

.hhb-ui .hhb-form-messages {
	margin-bottom: 16px;
}

/* ========================================================================
   PROPERTY DISPLAY COMPONENTS
   ======================================================================== */

.hhb-ui .hhb-property-header {
	margin-bottom: 24px;
}

.hhb-ui .hhb-property-title {
	font-size: 32px;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: #1a1a1a;
	line-height: 1.2;
}

.hhb-ui .hhb-property-featured,
.hhb-ui .hhb-property-quick-facts,
.hhb-ui .hhb-property-description,
.hhb-ui .hhb-property-house-rules,
.hhb-ui .hhb-property-photo-gallery,
.hhb-ui .hhb-property-booking-section {
	margin-bottom: 32px;
}

.hhb-ui .hhb-property-description h2,
.hhb-ui .hhb-property-photo-gallery h2,
.hhb-ui .hhb-property-booking-section h2 {
	font-size: 24px;
	font-weight: 600;
	margin: 0 0 16px 0;
	color: #1a1a1a;
}

/* ========================================================================
   MOBILE OPTIMIZATIONS
   ======================================================================== */

@media (max-width: 600px) {
	.hhb-ui {
		font-size: 15px;
	}
	
	.hhb-card {
		padding: 16px;
		margin: 12px 0;
		border-radius: 8px;
	}
	
	.hhb-card__title {
		font-size: 20px;
	}
	
	.hhb-ui .hhb-property-title {
		font-size: 24px;
	}
	
	.hhb-ui button,
	.hhb-ui .hhb-submit-button {
		width: 100%;
		padding: 16px;
	}
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */

.hhb-ui .hhb-text-center {
	text-align: center;
}

.hhb-ui .hhb-mt-0 {
	margin-top: 0 !important;
}

.hhb-ui .hhb-mb-0 {
	margin-bottom: 0 !important;
}
