/**
 * VCC Reviews — frontend styles.
 * Uses CSS variables so it can inherit / be overridden by the theme.
 */

.vcc-reviews,
.vcc-review-form {
	--vcc-star: #f5a623;
	--vcc-star-empty: #56706c;
	--vcc-card-bg: #283937;
	--vcc-border: #435956;
	--vcc-text: #ffffff;
	--vcc-muted: #b8c6c3;
	--vcc-radius: 10px;
	--vcc-accent: #F29191;
	--vcc-accent-hover: #F07879;
	--vcc-skel-base: #31433f;
	--vcc-skel-shine: #3d534f;
}

/* ------------------------------------------------------------------ */
/* Grid + cards                                                        */
/* ------------------------------------------------------------------ */

.vcc-reviews__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin: 0 0 24px;
}

.vcc-review-card {
	border: 1px solid var(--vcc-border);
	border-radius: var(--vcc-radius);
	padding: 22px;
	background-color: var(--vcc-card-bg);
	color: var(--vcc-text);
	display: flex;
	flex-direction: column;
	gap: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.vcc-review-card__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.vcc-review-card__head-main {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.vcc-review-card__date {
	flex: 0 0 auto;
	color: var(--vcc-muted);
	font-size: 0.8rem;
	white-space: nowrap;
	padding-top: 2px;
	line-height: 1.2;
}

.vcc-review-card__title {
	margin: 10px 0 0;
	font-size: 1.35rem;
	line-height: 1.3;
	color: var(--vcc-text);
}

.vcc-review-card__body {
	color: var(--vcc-text);
	line-height: 1.6;
	flex: 1 1 auto;
}

.vcc-review-card__body p { margin: 0 0 0.75em; }

.vcc-review-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--vcc-border);
	font-size: 0.9rem;
}

.vcc-review-card__author { font-weight: 600; line-height: 1;}

.vcc-review-card__service {
	color: var(--vcc-muted);
	font-size: 0.85rem;
}

/* Verified badge */
.vcc-review-card__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	align-self: flex-start;
	padding: 3px 10px 3px 7px;
	border-radius: 999px;
	background: rgba(211, 152, 7, 0.10);
	color: #d39807;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}

.vcc-review-card__badge-icon {
	width: 16px;
	height: 16px;
	fill: var(--vcc-accent);
	stroke: none;
	flex: 0 0 auto;
}

/* ------------------------------------------------------------------ */
/* Stars (display)                                                     */
/* ------------------------------------------------------------------ */

.vcc-stars { display: inline-flex; }

.vcc-star {
	width: 20px;
	height: 20px;
	fill: var(--vcc-star-empty);
}

.vcc-star--filled { fill: var(--vcc-star); }

/* Fractional stars (average display) */
.vcc-stars-frac { position: relative; display: inline-block; line-height: 0; }
.vcc-stars-frac__empty,
.vcc-stars-frac__full { display: inline-flex; gap: 2px; }
/* Keep stars at full size so the overlay clips (not shrinks) to its width. */
.vcc-stars-frac .vcc-star { flex: 0 0 auto; }
.vcc-stars-frac__full {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Rating summary                                                      */
/* ------------------------------------------------------------------ */

.vcc-reviews__summary {
	max-width: 450px;
	margin: 0 auto 32px;
	display: flex;
	align-items: center;
	gap: 24px;
}

.vcc-summary-average {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
}

.vcc-summary-average__num {
	font-size: 2.6rem;
	font-weight: 700;
	line-height: 1;
	color: var(--vcc-text);
}

.vcc-summary-average .vcc-star { width: 28px; height: 28px; }

.vcc-summary-average__count {
	color: var(--vcc-muted);
	font-size: 0.85rem;
}

.vcc-summary-bars {
	flex: 1 1 auto;
	min-width: 0;
	/* Shared 3-column grid so the count column sizes to the widest count
	   across all rows and every bar ends at the same point. */
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 5px 8px;
}

/* Let each row's children flow into the shared grid above. */
.vcc-summary-bar { display: contents; }

.vcc-summary-bar__stars { display: inline-flex; gap: 1px; }
.vcc-summary-bar__stars .vcc-star { width: 14px; height: 14px; }

.vcc-summary-bar__track {
	position: relative;
	height: 8px;
	background: var(--vcc-border);
	border-radius: 999px;
	overflow: hidden;
}

.vcc-summary-bar__fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	background: var(--vcc-star);
	border-radius: 999px;
}

.vcc-summary-bar__count {
	text-align: right;
	white-space: nowrap;
	color: var(--vcc-muted);
	font-size: 0.8rem;
	line-height: 2;
}

@media (max-width: 480px) {
	.vcc-reviews__summary { gap: 10px; }
	.vcc-summary-bar__stars .vcc-star{width: 14px; height: 14px;}
	.vcc-summary-average__num { font-size: 2.1rem; }
	.vcc-summary-average .vcc-star{width: 22px; height: 22px;}
}

/* ------------------------------------------------------------------ */
/* Load more                                                           */
/* ------------------------------------------------------------------ */

.vcc-reviews__actions {
	display: flex;
	justify-content: center;
	margin: 40px 0 0;
}

.vcc-reviews__load-more,
.vcc-review-form__submit {
	appearance: none;
	border: 0;
	background: var(--vcc-accent);
	color: #fff;
	padding: 12px 28px;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.05s ease;
}

.vcc-reviews__load-more:hover { background: var(--vcc-accent-hover); }

/* Full width on mobile, roughly double width on tablet/desktop. */
.vcc-reviews__load-more { width: 100%; }

@media (min-width: 768px) {
	.vcc-reviews__load-more {
		width: auto;
		min-width: 340px;
	}
}

/* Theme's global secondary color, with the plugin accent as fallback. */
.vcc-review-form__submit {
	background: var(--e-global-color-secondary, var(--vcc-accent));
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.vcc-review-form__submit:hover {
	background: var(--vcc-accent-hover);
	opacity: 1;
}

.vcc-reviews__load-more:active,
.vcc-review-form__submit:active { transform: translateY(1px); }

.vcc-reviews__load-more[disabled],
.vcc-review-form__submit[disabled] { opacity: 0.6; cursor: default; }

.vcc-reviews__empty { color: var(--vcc-muted); }

.vcc-reviews__count {
	margin: 16px 0 0;
	text-align: center;
	color: var(--vcc-muted);
	font-size: 0.9rem;
}

.vcc-reviews__count strong {
	color: var(--vcc-text);
	font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Skeleton loader                                                     */
/* ------------------------------------------------------------------ */

.vcc-reviews__skeleton {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin: 0 0 24px;
}

/* Respect the `hidden` attribute — author `display` otherwise overrides it. */
.vcc-reviews__skeleton[hidden] {
	display: none;
}

.vcc-skel-card {
	border: 1px solid var(--vcc-border);
	border-radius: var(--vcc-radius);
	padding: 22px;
	background-color: var(--vcc-card-bg);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.vcc-skel {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	background: var(--vcc-skel-base);
	height: 14px;
}

.vcc-skel::after {
	content: "";
	position: absolute;
	inset: 0;
	transform: translateX(-100%);
	background: linear-gradient(90deg, transparent, var(--vcc-skel-shine), transparent);
	animation: vcc-shimmer 1.3s infinite;
}

@keyframes vcc-shimmer { 100% { transform: translateX(100%); } }

.vcc-skel--stars { width: 110px; height: 20px; }
.vcc-skel--title { width: 70%; height: 20px; }
.vcc-skel--line  { width: 100%; }
.vcc-skel--short { width: 55%; }
.vcc-skel--name  { width: 40%; height: 16px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
	.vcc-skel::after { animation: none; }
}

/* ------------------------------------------------------------------ */
/* Right-side drawer                                                   */
/* ------------------------------------------------------------------ */

.vcc-review-drawer-wrap {
	max-width: 700px;
	margin: 30px auto 40px;
	text-align: center;
}

.vcc-review-drawer-open {
	appearance: none;
	border: 0;
	background: #d89b00;
	color: #fff;
	padding: 14px 32px;
	border-radius: 999px;
	font-size: 1.05rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.vcc-review-drawer-open:hover { background: #d8b250; }
.vcc-review-drawer-open:active { transform: translateY(1px); }

/* Prevent background scroll while the drawer is open. */
body.vcc-drawer-lock { overflow: hidden; }

.vcc-review-drawer {
	position: fixed;
	inset: 0;
	z-index: 2147483000; /* above theme fixed header / #Footer */
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vcc-review-drawer.is-open {
	visibility: visible;
	opacity: 1;
}

.vcc-review-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.vcc-review-drawer__panel {
	box-sizing: border-box;
	position: absolute;
	top: 0;
	right: 0;
	height: 100%;
	width: min(480px, 100%);
	max-width: 100%;
	background-color: #243330;
	padding: 32px;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	box-shadow: -8px 0 24px rgba(0, 0, 0, 0.3);
	text-align: left;
}

/* Keep inner elements inside the panel on narrow screens. */
.vcc-review-drawer__panel * { box-sizing: border-box; }

.vcc-review-drawer.is-open .vcc-review-drawer__panel { transform: translateX(0); }

@media (max-width: 480px) {
	.vcc-review-drawer__panel {
		width: calc(100% - 36px); /* small gap on the far left */
		padding: 40px 18px 32px;
	}
}

.vcc-review-drawer__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #ffffff;
	cursor: pointer;
	padding: 0;
}

.vcc-review-drawer__close:hover { background: rgba(255, 255, 255, 0.08); }
.vcc-review-drawer__close svg {
	width: 30px;
	height: 30px;
	flex: 0 0 auto;
	stroke: #ffffff;
	fill: none;
}

@media (prefers-reduced-motion: reduce) {
	.vcc-review-drawer,
	.vcc-review-drawer__panel { transition: none; }
}

/* Inside the drawer the form fills the panel (panel provides bg/padding). */
.vcc-review-drawer__panel .vcc-review-form {
	max-width: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border-radius: 0;
}

/* ------------------------------------------------------------------ */
/* Submission form                                                     */
/* ------------------------------------------------------------------ */

.vcc-review-form {
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
	background-color: #243330;
	border-radius: 12px;
	padding: 30px 30px 40px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.vcc-review-form__title {
	margin: 0 0 6px;
	text-align: center;

}

.vcc-field { margin: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.vcc-field > label,
.vcc-field > legend { font-weight: 400; font-size: 14px; color: var(--vcc-text) !important; }

/* Title + Name row: stacked on mobile, 50/50 side-by-side on desktop. */
.vcc-field-row {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
}
.vcc-field-row .vcc-field--half { flex: 1 1 100%; }

@media (min-width: 768px) {
	.vcc-field-row .vcc-field--half { flex: 1 1 calc(50% - 9px); min-width: 0; }
}

.vcc-field input[type="text"],
.vcc-field input[type="email"],
.vcc-field textarea,
.vcc-field select {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid var(--vcc-border);
	border-radius: 8px 8px 8px 8px;
	font: inherit;
	background-color: var(--vcc-card-bg);
	color: var(--vcc-text);
	margin-bottom: 0;
}

.vcc-field input[type="text"]::placeholder,
.vcc-field textarea::placeholder {
	color: var(--vcc-muted);
}

.vcc-field input:focus,
.vcc-field textarea:focus,
.vcc-field select:focus {
	background-color: transparent !important;
}

.vcc-req { color: #c0392b; }

.vcc-field__counter {
	align-self: flex-end;
	color: var(--vcc-muted);
	font-size: 0.78rem;
	margin-top: 2px;
}

/* Error (left) + counter (right) on a single row below the textarea. */
.vcc-field__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 2px;
}
.vcc-field__meta .vcc-field__error { margin: 0; }
.vcc-field__meta .vcc-field__counter {
	align-self: center;
	margin: 0 0 0 auto; /* push to far right regardless of error visibility */
}

.vcc-field__counter.is-limit { color: var(--vcc-accent); font-weight: 600; }

.vcc-field__error {
	color: #c0392b;
	font-size: 0.85rem;
}

.vcc-field.has-error input,
.vcc-field.has-error textarea,
.vcc-field.has-error select {
	border-color: #c0392b;
}

/* Collapse when empty so it doesn't reserve flex-gap space. */
.vcc-field__error:empty {
	display: none;
}

.vcc-field--rating { border: 0; padding: 0; margin: 0; }
.vcc-field--rating legend { padding: 0; }

/* Interactive rating input */
.vcc-rating-input {
	display: inline-flex;
	gap: 4px;
}

.vcc-rating-input__star {
	cursor: pointer;
	line-height: 0;
}

.vcc-rating-input__star input {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.vcc-rating-input__star svg {
	width: 34px;
	height: 34px;
	fill: var(--vcc-star-empty);
	transition: fill 0.1s ease, transform 0.05s ease;
}

.vcc-rating-input__star.is-active svg { fill: var(--vcc-star); }

.vcc-rating-input__star input:focus-visible + svg {
	outline: 2px solid var(--vcc-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Honeypot */
.vcc-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Messages */
.vcc-review-form__message {
	padding: 12px 16px;
	border-radius: 8px;
	font-weight: 500;
}
.vcc-review-form__message.is-success { background: #e7f6ec; color: #1e7e45; }
.vcc-review-form__message.is-error   { background: #fdecec; color: #c0392b; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
