/**
 * Frontend Styles for LEGO Rentals Plugin
 */

/* Products Grid */
.rentals-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 30px;
	margin: 30px 0;
}

.rental-product-card {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	transition: transform 0.3s, box-shadow 0.3s;
	display: flex;
	flex-direction: column;
}

.rental-product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.rental-product-image {
	width: 100%;
	height: 200px;
	object-fit: cover;
	background: #f5f5f5;
}

.rental-product-content {
	padding: 20px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.rental-product-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 10px 0;
	color: #333;
}

.rental-product-meta {
	color: #666;
	font-size: 14px;
	margin-bottom: 15px;
}

.rental-product-price {
	font-size: 24px;
	font-weight: 700;
	color: #2271b1;
	margin-bottom: 5px;
}

.rental-product-price-period {
	font-size: 14px;
	font-weight: normal;
	color: #666;
}

.rental-product-availability {
	margin-top: auto;
	padding-top: 15px;
	border-top: 1px solid #eee;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.availability-status {
	display: flex;
	align-items: center;
	font-size: 14px;
}

.availability-indicator {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 8px;
}

.availability-indicator.available {
	background-color: #00a32a;
}

.availability-indicator.limited {
	background-color: #dba617;
}

.availability-indicator.unavailable {
	background-color: #d63638;
}

.rental-product-action {
	margin-top: 15px;
}

.btn-view-product {
	display: inline-block;
	padding: 10px 20px;
	background: #2271b1;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	transition: background 0.3s;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.btn-view-product:hover {
	background: #135e96;
	color: #fff;
}

/* Booking Calendar */
.rentals-booking-calendar {
	background: #fff;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	margin: 30px 0;
}

.calendar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #f0f0f0;
}

.calendar-month {
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.calendar-nav {
	display: flex;
	gap: 10px;
}

.calendar-nav button {
	padding: 8px 12px;
	background: #f0f0f0;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s;
}

.calendar-nav button:hover {
	background: #e0e0e0;
}

.calendar-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
}

.calendar-day-header {
	padding: 10px;
	text-align: center;
	font-weight: 600;
	background: #f8f8f8;
	font-size: 14px;
	color: #666;
}

.calendar-day {
	aspect-ratio: 1;
	padding: 8px;
	background: #fff;
	border: 1px solid #e0e0e0;
	cursor: pointer;
	transition: all 0.3s;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: relative;
}

.calendar-day:hover {
	background: #f0f8ff;
	border-color: #2271b1;
}

.calendar-day.selected {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.calendar-day.in-range {
	background: #e3f2fd;
}

.calendar-day.unavailable {
	background: #f5f5f5;
	color: #999;
	cursor: not-allowed;
}

.calendar-day.unavailable:hover {
	background: #f5f5f5;
	border-color: #e0e0e0;
}

.calendar-day.sunday {
	background: #fffbf0;
}

.calendar-day.no-sunday-start {
	cursor: not-allowed;
	opacity: 0.5;
}

.calendar-day-number {
	font-size: 16px;
	font-weight: 500;
}

.calendar-legend {
	display: flex;
	gap: 20px;
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
	flex-wrap: wrap;
}

.legend-item {
	display: flex;
	align-items: center;
	font-size: 14px;
}

.legend-color {
	width: 20px;
	height: 20px;
	border-radius: 3px;
	margin-right: 8px;
}

/* Booking Form */
.rentals-booking-form {
	background: #fff;
	padding: 30px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
	margin: 30px 0;
}

.booking-form-group {
	margin-bottom: 25px;
}

.booking-form-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #333;
}

.booking-form-group input,
.booking-form-group select {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	transition: border-color 0.3s;
}

.booking-form-group input:focus,
.booking-form-group select:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.date-selection {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.delivery-options {
	display: flex;
	gap: 20px;
}

.delivery-option {
	flex: 1;
	padding: 15px;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
	text-align: center;
}

.delivery-option:hover {
	border-color: #2271b1;
	background: #f8fbff;
}

.delivery-option.selected {
	border-color: #2271b1;
	background: #f8fbff;
}

.delivery-option-icon {
	font-size: 24px;
	margin-bottom: 8px;
}

.delivery-address-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
	margin-top: 20px;
	padding: 20px;
	background: #f8f8f8;
	border-radius: 4px;
}

.booking-summary {
	background: #f8fbff;
	padding: 20px;
	border-radius: 4px;
	margin-bottom: 25px;
	border-left: 4px solid #2271b1;
}

.booking-summary h3 {
	margin-top: 0;
	color: #2271b1;
}

.summary-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e0e0e0;
}

.summary-row:last-child {
	border-bottom: none;
	font-weight: 600;
	font-size: 18px;
}

.btn-submit-booking {
	width: 100%;
	padding: 15px 30px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.3s;
}

.btn-submit-booking:hover {
	background: #135e96;
}

.btn-submit-booking:disabled {
	background: #ccc;
	cursor: not-allowed;
}

/* My Account Sections */
.rentals-account-section {
	margin: 30px 0;
}

.rentals-bookings-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.rentals-bookings-table th,
.rentals-bookings-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
}

.rentals-bookings-table th {
	background: #f8f8f8;
	font-weight: 600;
	color: #333;
}

.rentals-bookings-table tr:hover {
	background: #f8fbff;
}

.booking-status {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

.booking-status.pending {
	background: #fff3cd;
	color: #856404;
}

.booking-status.confirmed {
	background: #cce5ff;
	color: #004085;
}

.booking-status.active {
	background: #d4edda;
	color: #155724;
}

.booking-status.returned {
	background: #e2e3e5;
	color: #383d41;
}

.booking-status.cancelled {
	background: #f8d7da;
	color: #721c24;
}

.booking-actions {
	display: flex;
	gap: 10px;
}

.btn-action {
	padding: 6px 12px;
	background: #f0f0f0;
	border: 1px solid #ddd;
	border-radius: 3px;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.3s;
	text-decoration: none;
	color: #333;
}

.btn-action:hover {
	background: #e0e0e0;
	color: #333;
}

.btn-action.primary {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.btn-action.primary:hover {
	background: #135e96;
	color: #fff;
}

/* No Results */
.no-rentals {
	text-align: center;
	padding: 60px 20px;
	background: #f8f8f8;
	border-radius: 8px;
	color: #666;
}

.no-rentals h3 {
	color: #333;
	margin-bottom: 10px;
}

/* Loading States */
.rentals-loading {
	text-align: center;
	padding: 40px;
}

.rentals-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #2271b1;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
	.rentals-products-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 20px;
	}
	
	.date-selection {
		grid-template-columns: 1fr;
	}
	
	.delivery-options {
		flex-direction: column;
	}
	
	.delivery-address-fields {
		grid-template-columns: 1fr;
	}
	
	.calendar-grid {
		gap: 1px;
	}
	
	.calendar-day {
		font-size: 14px;
	}
	
	.rentals-bookings-table {
		font-size: 14px;
	}
	
	.rentals-bookings-table th,
	.rentals-bookings-table td {
		padding: 8px;
	}
}

@media (max-width: 480px) {
	.rentals-products-grid {
		grid-template-columns: 1fr;
	}
	
	.calendar-legend {
		flex-direction: column;
		gap: 10px;
	}
}
