/**
 * Customer Portal Styles
 * Frontend styles for customer-facing booking portal
 * 
 * @package HolidayHomeBooking
 */

/* ========================================================================
   My Bookings List
   ======================================================================== */

.hhb-my-bookings {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.hhb-my-bookings h2 {
	font-size: 28px;
	margin-bottom: 20px;
	color: #333;
}

.hhb-bookings-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.hhb-bookings-table thead {
	background: #f5f5f5;
	border-bottom: 2px solid #ddd;
}

.hhb-bookings-table th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #555;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hhb-bookings-table td {
	padding: 15px;
	border-bottom: 1px solid #eee;
	color: #333;
}

.hhb-bookings-table tbody tr:hover {
	background: #fafafa;
	transition: background 0.2s ease;
}

.hhb-bookings-table tbody tr:last-child td {
	border-bottom: none;
}

/* Status Badges */
.hhb-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.hhb-status-badge.hhb-status-confirmed {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.hhb-status-badge.hhb-status-pending,
.hhb-status-badge.hhb-status-pending_payment,
.hhb-status-badge.hhb-status-request_pending {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeaa7;
}

.hhb-status-badge.hhb-status-cancelled,
.hhb-status-badge.hhb-status-request_declined {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.hhb-status-badge.hhb-status-completed {
	background: #e2e3e5;
	color: #383d41;
	border: 1px solid #d6d8db;
}

.hhb-status-badge.hhb-status-hold {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

/* Payment Status Badges */
.hhb-status-badge.hhb-payment-status-paid {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.hhb-status-badge.hhb-payment-status-pending {
	background: #fff3cd;
	color: #856404;
	border: 1px solid #ffeaa7;
}

.hhb-status-badge.hhb-payment-status-failed {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.hhb-status-badge.hhb-payment-status-refunded,
.hhb-status-badge.hhb-payment-status-cancelled {
	background: #e2e3e5;
	color: #383d41;
	border: 1px solid #d6d8db;
}


/* ========================================================================
   Booking Detail
   ======================================================================== */

.hhb-booking-detail {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px;
}

.hhb-booking-detail h2 {
	font-size: 28px;
	margin-bottom: 20px;
	color: #333;
}

.hhb-booking-summary {
	background: #f9f9f9;
	padding: 30px;
	margin: 20px 0;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
}

.hhb-booking-summary h3 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 24px;
	color: #333;
}

.hhb-booking-summary > div {
	margin: 15px 0;
	line-height: 1.6;
}

.hhb-booking-summary strong {
	color: #555;
	font-weight: 600;
}

/* Pricing Breakdown */
.hhb-pricing-breakdown {
	margin: 30px 0 0 0;
	padding-top: 20px;
	border-top: 2px solid #ddd;
}

.hhb-pricing-breakdown h3 {
	font-size: 20px;
	margin-top: 0;
	margin-bottom: 15px;
	color: #333;
}

.hhb-pricing-breakdown table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
	background: #fff;
}

.hhb-pricing-breakdown table tr {
	border-bottom: 1px solid #ddd;
}

.hhb-pricing-breakdown table tr:last-child {
	border-bottom: none;
	background: #f5f5f5;
	font-weight: bold;
}

.hhb-pricing-breakdown table td {
	padding: 12px;
}

.hhb-pricing-breakdown table td:last-child {
	text-align: right;
	font-weight: 600;
}

/* Access Information */
.hhb-access-info {
	background: #e7f7e7;
	padding: 25px;
	margin: 30px 0 0 0;
	border-radius: 8px;
	border: 1px solid #4caf50;
}

.hhb-access-info h3 {
	margin-top: 0;
	margin-bottom: 20px;
	color: #2e7d32;
	font-size: 20px;
}

.hhb-access-info > div {
	margin: 15px 0;
	line-height: 1.6;
}

.hhb-access-info strong {
	color: #1b5e20;
	display: block;
	margin-bottom: 8px;
}

/* Access Information Pending */
.hhb-access-info-pending {
	background: #fff3cd;
	padding: 25px;
	margin: 30px 0 0 0;
	border-radius: 8px;
	border: 1px solid #ffc107;
}

.hhb-access-info-pending h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #856404;
	font-size: 20px;
}

.hhb-access-info-pending p {
	margin: 0;
	color: #856404;
	line-height: 1.6;
}

/* Payment Schedule */
.hhb-payment-schedule {
	margin: 30px 0 0 0;
	padding-top: 20px;
	border-top: 2px solid #ddd;
}

.hhb-payment-schedule h3 {
	font-size: 20px;
	margin-top: 0;
	margin-bottom: 15px;
	color: #333;
}

.hhb-payment-schedule-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.hhb-payment-schedule-table thead {
	background: #f5f5f5;
	border-bottom: 2px solid #ddd;
}

.hhb-payment-schedule-table th {
	padding: 12px;
	text-align: left;
	font-weight: 600;
	color: #555;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hhb-payment-schedule-table td {
	padding: 12px;
	border-bottom: 1px solid #ddd;
	color: #333;
}

.hhb-payment-schedule-table tbody tr:hover {
	background: #fafafa;
	transition: background 0.2s ease;
}

.hhb-payment-schedule-table tbody tr:last-child td {
	border-bottom: none;
}

.hhb-pay-now-btn {
	display: inline-block;
	padding: 6px 12px;
	background: #4caf50;
	color: #fff;
	text-decoration: none;
	border-radius: 3px;
	font-size: 13px;
	font-weight: 500;
	transition: background 0.2s ease;
}

.hhb-pay-now-btn:hover {
	background: #45a049;
	color: #fff;
}

/* ========================================================================
   My Payments
   ======================================================================== */

.hhb-my-payments {
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
}

.hhb-my-payments h2 {
	font-size: 28px;
	margin-bottom: 20px;
	color: #333;
}

.hhb-payments-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.hhb-payments-table thead {
	background: #f5f5f5;
	border-bottom: 2px solid #ddd;
}

.hhb-payments-table th {
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	color: #555;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.hhb-payments-table td {
	padding: 15px;
	border-bottom: 1px solid #eee;
	color: #333;
}

.hhb-payments-table tbody tr:hover {
	background: #fafafa;
	transition: background 0.2s ease;
}

.hhb-payments-table tbody tr:last-child td {
	border-bottom: none;
}

.hhb-payments-table small {
	display: block;
	color: #666;
	font-size: 13px;
	margin-top: 4px;
}

.hhb-payments-table tfoot tr {
	background: #f9f9f9;
	border-top: 2px solid #ddd;
	font-weight: bold;
}

.hhb-payments-table tfoot td {
	padding: 15px;
}

/* Payment Filters */
.hhb-payments-filters {
	margin: 20px 0;
}

.hhb-payments-filters .button {
	margin-right: 10px;
}


/* ========================================================================
   Notices
   ======================================================================== */

.hhb-notice {
	padding: 15px 20px;
	margin: 20px 0;
	border-left: 4px solid;
	border-radius: 4px;
}

.hhb-notice p {
	margin: 0;
	line-height: 1.5;
}

.hhb-notice-info {
	background: #d1ecf1;
	color: #0c5460;
	border-color: #17a2b8;
}

.hhb-notice-error {
	background: #f8d7da;
	color: #721c24;
	border-color: #dc3545;
}

.hhb-notice-upgrade {
	background: #fff3cd;
	padding: 25px;
	border-left: 4px solid #ffc107;
}

.hhb-notice-upgrade h3 {
	margin-top: 0;
	margin-bottom: 15px;
	color: #856404;
}

.hhb-notice-upgrade p {
	color: #856404;
	line-height: 1.6;
}

.hhb-notice-upgrade ul {
	margin: 15px 0;
	padding-left: 20px;
	color: #856404;
}

.hhb-notice-upgrade ul li {
	margin: 8px 0;
}

/* ========================================================================
   Buttons & Actions
   ======================================================================== */

.hhb-my-bookings .button,
.hhb-booking-detail .button,
.hhb-my-payments .button {
	display: inline-block;
	padding: 8px 16px;
	background: #0073aa;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: background 0.2s ease;
}

.hhb-my-bookings .button:hover,
.hhb-booking-detail .button:hover,
.hhb-my-payments .button:hover {
	background: #005a87;
	color: #fff;
}

.hhb-my-payments .button-primary {
	background: #4caf50;
}

.hhb-my-payments .button-primary:hover {
	background: #45a049;
}

/* ========================================================================
   Responsive Design - Mobile Only (<768px)
   ======================================================================== */

@media screen and (max-width: 599px) {
	/* Container with max-width */
	.hhb-my-bookings,
	.hhb-booking-detail,
	.hhb-my-payments {
		max-width: 680px;
		margin: 0 auto;
		padding: 16px;
		overflow-x: hidden;
	}
	
	/* Mobile: Convert tables to card layout */
	.hhb-bookings-table,
	.hhb-payments-table,
	.hhb-payment-schedule-table {
		display: block;
		width: 100%;
		box-shadow: none;
	}
	
	.hhb-bookings-table thead,
	.hhb-payments-table thead,
	.hhb-payment-schedule-table thead {
		display: none;
	}
	
	.hhb-bookings-table tbody,
	.hhb-payments-table tbody,
	.hhb-payment-schedule-table tbody {
		display: block;
	}
	
	/* Modern Card Design */
	.hhb-bookings-table tr,
	.hhb-payments-table tr,
	.hhb-payment-schedule-table tr {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px 12px;
		grid-auto-flow: dense;
		background: #fff;
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 14px;
		padding: 14px;
		margin-bottom: 14px;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
	}
	
	/* Card Header - Property/Booking name with status pill */
	.hhb-bookings-table td[data-label*="Property"],
	.hhb-payments-table td[data-label*="Booking"],
	.hhb-payments-table td[data-label*="Property"] {
		grid-column: 1 / -1;
		display: flex;
		gap: 12px;
		align-items: flex-start;
		justify-content: space-between;
		margin-bottom: 0;
		padding-bottom: 10px;
		border-bottom: 1px solid rgba(0, 0, 0, 0.06);
		font-size: 20px;
		font-weight: 600;
		line-height: 1.2;
	}
	
	/* Hide the label for header fields */
	.hhb-bookings-table td[data-label*="Property"]::before,
	.hhb-payments-table td[data-label*="Booking"]::before,
	.hhb-payments-table td[data-label*="Property"]::before {
		display: none;
	}
	
	/* Status pill positioning in header */
	.hhb-bookings-table td[data-label*="Status"],
	.hhb-payments-table td[data-label*="Status"],
	.hhb-payment-schedule-table td[data-label*="Status"] {
		order: -1;
		align-self: flex-start;
	}
	
	.hhb-status-badge {
		font-size: 12px;
		padding: 6px 10px;
		border-radius: 999px;
		border: 1px solid rgba(0, 0, 0, 0.08);
		white-space: nowrap;
		font-weight: 600;
		display: inline-block;
		min-width: auto;
	}
	
	/* All table cells */
	.hhb-bookings-table td,
	.hhb-payments-table td,
	.hhb-payment-schedule-table td {
		display: block;
		padding: 0;
		margin-bottom: 0;
		font-size: 14px;
		line-height: 1.4;
		border-bottom: none;
	}
	
	/* Labels styling */
	.hhb-bookings-table td::before,
	.hhb-payments-table td::before,
	.hhb-payment-schedule-table td::before {
		content: attr(data-label);
		font-weight: 600;
		display: block;
		margin-bottom: 4px;
		color: rgba(0, 0, 0, 0.6);
		font-size: 11px;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}
	
	/* Hide labels if data-label is empty */
	.hhb-bookings-table td[data-label=""]::before,
	.hhb-payments-table td[data-label=""]::before,
	.hhb-payment-schedule-table td[data-label=""]::before {
		display: none;
	}
	
	/* Actions row spans full width */
	.hhb-bookings-table td[data-label*="Actions"],
	.hhb-payments-table td[data-label*="Actions"],
	.hhb-payment-schedule-table td[data-label*="Actions"] {
		grid-column: 1 / -1;
		margin-top: 2px;
	}
	
	/* Buttons full-width on mobile */
	.hhb-my-bookings .button,
	.hhb-booking-detail .button,
	.hhb-my-payments .button,
	.hhb-pay-now-btn {
		width: 100%;
		min-height: 44px;
		padding: 12px 14px;
		font-size: 15px;
		border-radius: 12px;
		display: inline-flex;
		justify-content: center;
		align-items: center;
		font-weight: 600;
	}
	
	/* Filter buttons stack vertically on mobile */
	.hhb-payments-filters {
		display: flex;
		flex-direction: column;
		gap: 10px;
		margin-bottom: 20px;
	}
	
	.hhb-payments-filters .button {
		width: 100%;
		margin-right: 0;
	}
	
	/* Booking summary and access info */
	.hhb-booking-summary,
	.hhb-access-info,
	.hhb-access-info-pending {
		padding: 20px;
		margin: 16px 0;
	}
}
