/* 
 * Customer Reviews Styles
 */

/* ==========================================================================
   Form Styles
   ========================================================================== */
.cr-form-wrapper {
	max-width: 600px;
	margin: 0 auto;
	padding: 30px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.05);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cr-form-group {
	margin-bottom: 20px;
}

/* Optimized Grid Layout for the Form */
.cr-review-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 20px;
}

@media (max-width: 600px) {
	.cr-review-form {
		grid-template-columns: 1fr;
	}
	.cr-review-form .cr-form-group:nth-child(n) {
		grid-column: 1 / -1;
	}
}

.cr-review-form .cr-form-group:nth-child(5), /* Rating */
.cr-review-form .cr-form-group:nth-child(6), /* Review Text */
.cr-review-form .cr-form-response,
.cr-review-form .cr-submit-btn {
	grid-column: 1 / -1;
}

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

.cr-form-group input[type="text"],
.cr-form-group input[type="email"],
.cr-form-group input[type="tel"],
.cr-form-group textarea {
	width: 100%;
	padding: 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-sizing: border-box;
	font-size: 16px;
	transition: border-color 0.3s ease;
}

.cr-form-group input:focus,
.cr-form-group textarea:focus {
	border-color: #0073aa;
	outline: none;
}

/* Star Rating Input */
.cr-rating-stars {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
}

.cr-rating-stars input {
	display: none;
}

.cr-rating-stars label {
	font-size: 30px;
	color: #ddd;
	cursor: pointer;
	transition: color 0.2s;
	margin: 0 2px;
}

.cr-rating-stars input:checked ~ label,
.cr-rating-stars label:hover,
.cr-rating-stars label:hover ~ label {
	color: #f5b301;
}

.cr-submit-btn {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 12px 24px;
	font-size: 16px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	transition: background 0.3s ease;
}

.cr-submit-btn:hover {
	background: #005177;
}

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

.cr-form-response {
	margin-bottom: 20px;
	padding: 15px;
	border-radius: 4px;
	font-weight: 500;
}

.cr-form-response.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.cr-form-response.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Review Display Styles
   ========================================================================== */
.cr-reviews-container {
	margin: 30px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.cr-review-item {
	background: #fff;
	padding: 25px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.05);
	margin-bottom: 20px;
	border: 1px solid #eee;
}

.cr-reviews-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
}

.cr-reviews-grid .cr-review-item {
	margin-bottom: 0;
}

.cr-review-header {
	margin-bottom: 10px;
}

.cr-reviewer-name {
	margin: 0 0 5px 0;
	font-size: 18px;
	color: #222;
}

.cr-reviewer-profession {
	font-size: 14px;
	color: #666;
	display: block;
}

.cr-review-rating {
	margin-bottom: 15px;
}

.cr-star {
	font-size: 20px;
}

.cr-star.filled {
	color: #f5b301;
}

.cr-star.empty {
	color: #ddd;
}

.cr-review-content {
	color: #444;
	line-height: 1.6;
	font-size: 15px;
}

.cr-review-content p:last-child {
	margin-bottom: 0;
}

.cr-no-reviews {
	color: #666;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.cr-reviews-actions {
	margin-bottom: 20px;
	text-align: right;
}

.cr-btn {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 10px 20px;
	font-size: 16px;
	border-radius: 4px;
	cursor: pointer;
	font-weight: 600;
	transition: background 0.3s ease;
}

.cr-btn:hover {
	background: #005177;
}

.cr-btn.cr-btn-alt {
	background: transparent;
	color: #0073aa;
	border: 2px solid #0073aa;
	text-decoration: none;
}

.cr-btn.cr-btn-alt:hover {
	background: #0073aa;
	color: #fff;
}

/* The Modal (background) */
.cr-modal {
	display: none; /* Hidden by default */
	position: fixed; /* Stay in place */
	z-index: 99999; /* Sit on top */
	left: 0;
	top: 0;
	width: 100%; /* Full width */
	height: 100%; /* Full height */
	overflow: auto; /* Enable scroll if needed */
	background-color: rgba(0,0,0,0.5); /* Black w/ opacity */
}

/* Modal Content/Box */
.cr-modal-content {
	background-color: #fefefe;
	margin: 5% auto; /* 5% from the top and centered */
	padding: 0;
	border: 1px solid #888;
	width: 90%; /* Could be more or less, depending on screen size */
	max-width: 650px;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
	position: relative;
	animation: cr-modal-anim 0.3s ease-out;
}

@keyframes cr-modal-anim {
	from { transform: translateY(-50px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.cr-modal-header {
	padding: 20px 30px;
	border-bottom: 1px solid #eee;
}

.cr-modal-header h2 {
	margin: 0;
	font-size: 22px;
}

.cr-modal-body {
	padding: 10px 0;
}

.cr-modal-body .cr-form-wrapper {
	box-shadow: none; /* Remove shadow since it's in a modal */
	padding: 20px 30px 30px;
}

/* The Close Button */
.cr-close-modal {
	color: #aaa;
	position: absolute;
	right: 25px;
	top: 15px;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	transition: color 0.2s;
}

.cr-close-modal:hover,
.cr-close-modal:focus {
	color: #333;
	text-decoration: none;
}
