/* ============================================================
 * WooCommerce Reviews Pro - Frontend Styles
 * Prefix: .wcrp-
 * Dark theme compatible, mobile responsive, minimal design
 * ============================================================ */

/* --- Photo Upload --- */
.wcrp-photo-upload {
	margin: 15px 0;
	padding: 12px;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 6px;
}

.wcrp-photo-upload label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
	color: #374151;
}

.wcrp-photo-upload input[type="file"] {
	font-size: 14px;
	color: #6b7280;
}

.wcrp-photo-hint {
	margin: 6px 0 0;
	color: #9ca3af;
}

.wcrp-photo-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.wcrp-photo-preview img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #e5e7eb;
}

/* --- Review Photos Display --- */
.wcrp-review-photos {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
}

.wcrp-photo-thumb {
	display: block;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border-radius: 6px;
	border: 2px solid transparent;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.wcrp-photo-thumb:hover {
	border-color: #7c3aed;
	transform: scale(1.05);
}

.wcrp-photo-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* --- Verified Badge --- */
.wcrp-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	background-color: #d1fae5;
	color: #065f46;
	font-size: 12px;
	font-weight: 600;
	border-radius: 12px;
	margin-left: 8px;
	white-space: nowrap;
}

.wcrp-verified-icon {
	color: #10b981;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

/* --- Multi-Criteria Ratings --- */
.wcrp-criteria-ratings {
	margin: 15px 0;
	padding: 12px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
}

.wcrp-criteria-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #f3f4f6;
}

.wcrp-criteria-row:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.wcrp-criteria-row label {
	flex: 0 0 100px;
	font-weight: 500;
	color: #374151;
	font-size: 14px;
}

.wcrp-criteria-row select {
	flex: 0 0 80px;
	padding: 4px 8px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	font-size: 14px;
}

.wcrp-criteria-row .wcrp-stars {
	display: inline-flex;
	gap: 2px;
}

.wcrp-star {
	color: #f59e0b;
	font-size: 18px;
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.wcrp-star.dashicons-star-empty {
	color: #d1d5db;
}

/* --- Ratings Breakdown --- */
.wcrp-ratings-breakdown {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e5e7eb;
}

.wcrp-rating-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	font-size: 13px;
}

.wcrp-rating-label {
	flex: 0 0 80px;
	color: #6b7280;
	font-weight: 500;
}

.wcrp-rating-item .wcrp-stars {
	display: inline-flex;
	gap: 1px;
}

.wcrp-rating-item .wcrp-star {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

/* --- Review Summary Widget --- */
.wcrp-review-summary {
	margin: 20px 0;
	padding: 20px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.wcrp-review-summary h3 {
	margin: 0 0 16px;
	font-size: 18px;
	color: #111827;
}

.wcrp-summary-average {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e5e7eb;
}

.wcrp-average-number {
	font-size: 36px;
	font-weight: 700;
	color: #111827;
	line-height: 1;
}

.wcrp-summary-average .wcrp-stars {
	display: inline-flex;
	gap: 2px;
}

.wcrp-summary-average .wcrp-star {
	font-size: 22px;
	width: 22px;
	height: 22px;
}

.wcrp-review-count {
	color: #6b7280;
	font-size: 14px;
}

/* --- Star Distribution --- */
.wcrp-star-distribution {
	margin-bottom: 16px;
}

.wcrp-distribution-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 13px;
}

.wcrp-distribution-label {
	flex: 0 0 50px;
	color: #6b7280;
	text-align: right;
}

.wcrp-distribution-label .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	color: #f59e0b;
}

.wcrp-distribution-bar {
	flex: 1;
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
}

.wcrp-distribution-fill {
	height: 100%;
	background: linear-gradient(90deg, #f59e0b, #f97316);
	border-radius: 4px;
	transition: width 0.3s ease;
}

.wcrp-distribution-count {
	flex: 0 0 30px;
	color: #6b7280;
	font-size: 13px;
}

/* --- Criteria Summary --- */
.wcrp-criteria-summary {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #e5e7eb;
}

.wcrp-criteria-summary h4 {
	margin: 0 0 10px;
	font-size: 14px;
	color: #374151;
}

.wcrp-criteria-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 13px;
}

.wcrp-criteria-label {
	flex: 0 0 80px;
	color: #6b7280;
	font-weight: 500;
}

.wcrp-criteria-item .wcrp-stars {
	display: inline-flex;
	gap: 1px;
}

.wcrp-criteria-item .wcrp-star {
	font-size: 14px;
	width: 14px;
	height: 14px;
}

.wcrp-criteria-value {
	color: #374151;
	font-weight: 600;
	margin-left: 4px;
}

/* --- Q&A Section --- */
.wcrp-qa-section {
	margin: 30px 0;
	padding: 20px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
}

.wcrp-qa-section h2 {
	margin: 0 0 20px;
	font-size: 22px;
	color: #111827;
}

.wcrp-qa-list {
	margin-bottom: 20px;
}

.wcrp-qa-item {
	padding: 12px;
	margin-bottom: 10px;
	background: #f9fafb;
	border-radius: 6px;
	border-left: 3px solid #7c3aed;
}

.wcrp-question {
	margin-bottom: 6px;
}

.wcrp-question-text {
	font-weight: 600;
	color: #111827;
}

.wcrp-question-author {
	font-size: 12px;
	color: #6b7280;
	margin-left: 6px;
}

.wcrp-answer {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
}

.wcrp-answer-label {
	font-weight: 600;
	color: #7c3aed;
	font-size: 13px;
}

.wcrp-answer-text {
	color: #374151;
	font-size: 14px;
}

.wcrp-no-questions {
	color: #9ca3af;
	font-style: italic;
}

.wcrp-qa-form {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e5e7eb;
}

.wcrp-qa-form h3 {
	margin: 0 0 12px;
	font-size: 16px;
	color: #111827;
}

.wcrp-qa-form label {
	display: block;
	font-weight: 500;
	color: #374151;
	margin-bottom: 4px;
	font-size: 14px;
}

.wcrp-qa-form input,
.wcrp-qa-form textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 14px;
	color: #374151;
	background: #fff;
	box-sizing: border-box;
}

.wcrp-qa-form textarea {
	resize: vertical;
	min-height: 80px;
}

.wcrp-qa-form .button {
	background: #7c3aed;
	color: #fff;
	border: none;
	padding: 10px 24px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.wcrp-qa-form .button:hover {
	background: #6d28d9;
}

/* --- Lightbox overlay --- */
.wcrp-lightbox-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.85);
	z-index: 99999;
	justify-content: center;
	align-items: center;
	cursor: pointer;
}

.wcrp-lightbox-overlay.active {
	display: flex;
}

.wcrp-lightbox-overlay img {
	max-width: 90%;
	max-height: 90%;
	border-radius: 4px;
	box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.wcrp-lightbox-close {
	position: absolute;
	top: 20px;
	right: 30px;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.wcrp-lightbox-close:hover {
	opacity: 1;
}

/* --- Dark theme support --- */
@media (prefers-color-scheme: dark) {
	.wcrp-photo-upload,
	.wcrp-criteria-ratings,
	.wcrp-review-summary {
		background: #1f2937;
		border-color: #374151;
	}

	.wcrp-photo-upload label,
	.wcrp-criteria-row label,
	.wcrp-review-summary h3,
	.wcrp-average-number {
		color: #f3f4f6;
	}

	.wcrp-photo-hint {
		color: #6b7280;
	}

	.wcrp-criteria-row select {
		background: #374151;
		color: #f3f4f6;
		border-color: #4b5563;
	}

	.wcrp-qa-section {
		background: #1f2937;
		border-color: #374151;
	}

	.wcrp-qa-section h2,
	.wcrp-qa-form h3 {
		color: #f3f4f6;
	}

	.wcrp-qa-item {
		background: #111827;
	}

	.wcrp-question-text,
	.wcrp-answer-text {
		color: #e5e7eb;
	}

	.wcrp-qa-form input,
	.wcrp-qa-form textarea {
		background: #374151;
		color: #f3f4f6;
		border-color: #4b5563;
	}

	.wcrp-review-photos {
		border-top-color: #374151;
	}

	.wcrp-ratings-breakdown {
		border-top-color: #374151;
	}

	.wcrp-rating-label {
		color: #9ca3af;
	}

	.wcrp-summary-average {
		border-bottom-color: #374151;
	}

	.wcrp-distribution-bar {
		background: #374151;
	}

	.wcrp-distribution-count,
	.wcrp-distribution-label {
		color: #9ca3af;
	}

	.wcrp-star.dashicons-star-empty {
		color: #4b5563;
	}
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
	.wcrp-criteria-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}

	.wcrp-criteria-row label {
		flex: none;
	}

	.wcrp-summary-average {
		flex-wrap: wrap;
	}

	.wcrp-average-number {
		font-size: 28px;
	}

	.wcrp-review-photos {
		gap: 6px;
	}

	.wcrp-photo-thumb {
		width: 60px;
		height: 60px;
	}
}

@media (max-width: 480px) {
	.wcrp-review-summary {
		padding: 12px;
	}

	.wcrp-distribution-row {
		font-size: 12px;
	}

	.wcrp-summary-average .wcrp-star {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}
}
