/* TayyariPoint Reviews v1.4 — White cards, fixed summary, scrolling reviews
   Brand: Royal Blue #1D4ED8, Deep Blue #1B3FB0, Green #16A34A,
   Amber #F59E0B, Ink #0F172A, Slate #64748B */

/* ---------- Reset & variables ---------- */
.tp-reviews-wrap {
	--tp-blue: #1D4ED8;
	--tp-blue-deep: #1B3FB0;
	--tp-green: #16A34A;
	--tp-amber: #F59E0B;
	--tp-ink: #0F172A;
	--tp-slate: #64748B;
	font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
.tp-reviews-wrap *,
.tp-reviews-wrap *::before,
.tp-reviews-wrap *::after,
.tp-review-overlay *,
.tp-review-overlay *::before,
.tp-review-overlay *::after {
	box-sizing: border-box;
}

/* ---------- Outer wrap ---------- */
.tp-reviews-wrap {
	position: relative;
	background: linear-gradient(135deg, rgba(29,78,216,0.95) 0%, rgba(27,63,176,0.97) 50%, rgba(19,43,122,0.98) 100%);
	border: 1px solid rgba(255,255,255,0.12);
	border-radius: 20px;
	padding: 24px 16px 20px;
	overflow: hidden;
	box-shadow: 0 20px 50px rgba(15,23,42,0.22);
}
.tp-reviews-wrap::before {
	content: "";
	position: absolute;
	width: 260px; height: 260px;
	top: -120px; right: -60px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%);
	pointer-events: none;
}
.tp-reviews-wrap::after {
	content: "";
	position: absolute;
	width: 200px; height: 200px;
	bottom: -90px; left: -40px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 70%);
	pointer-events: none;
}

/* ---------- Header: heading + write button ---------- */
.tp-reviews-header {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0 4px 18px;
}
.tp-reviews-heading {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 22px;
	color: #fff;
	margin: 0;
	line-height: 1.25;
}
.tp-reviews-subheading {
	color: rgba(255,255,255,0.6);
	font-size: 13px;
	margin: 2px 0 0;
	line-height: 1.4;
}
.tp-btn-write-review {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 13px;
	color: var(--tp-blue-deep);
	background: #fff;
	border: none;
	border-radius: 999px;
	padding: 9px 20px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(15,23,42,0.18);
	transition: transform .15s ease, box-shadow .15s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	align-self: flex-start;
}
.tp-btn-write-review:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(15,23,42,0.24);
	color: var(--tp-blue-deep);
}
.tp-btn-write-review:active { transform: translateY(0); }

/* Desktop: header in one row */
@media (min-width: 640px) {
	.tp-reviews-wrap { padding: 28px 28px 24px; border-radius: 24px; }
	.tp-reviews-header {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
		padding: 0 0 20px;
	}
	.tp-reviews-heading { font-size: 26px; }
	.tp-btn-write-review { align-self: center; }
}

/* ---------- Star badge boxes (Trustpilot-style) ---------- */
.tp-star-badges {
	display: inline-flex;
	gap: 3px;
}
.tp-star-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px; height: 26px;
	border-radius: 5px;
	background: rgba(0,0,0,0.06);
	color: rgba(0,0,0,0.18);
	font-size: 14px;
	line-height: 1;
	transition: transform .15s ease;
}
.tp-star-badge.tp-badge-filled {
	background: var(--tp-amber);
	color: #fff;
}

/* Summary card keeps white empty badges */
.tp-summary-card .tp-star-badge:not(.tp-badge-filled) {
	background: rgba(255,255,255,0.12);
	color: rgba(255,255,255,0.25);
}

/* Smaller badges inside review cards */
.tp-review-card:not(.tp-summary-card) .tp-star-badge {
	width: 22px; height: 22px;
	border-radius: 4px;
	font-size: 12px;
}

/* ---------- Inline stars (popup form) ---------- */
.tp-stars { display: inline-flex; gap: 2px; }
.tp-star { color: rgba(15,23,42,0.18); font-size: 16px; line-height: 1; }
.tp-star-filled { color: var(--tp-amber); }

/* ---------- Body: summary fixed left + carousel right ---------- */
.tp-reviews-body {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: stretch;
	gap: 14px;
}

/* ---------- Carousel ---------- */
.tp-reviews-carousel {
	position: relative;
	z-index: 1;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent);
	mask-image: linear-gradient(90deg, transparent, black 3%, black 97%, transparent);
}
.tp-reviews-track {
	display: flex;
	align-items: stretch;
	gap: 14px;
	width: max-content;
	padding: 2px 8px 6px;
	animation-name: tp-reviews-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}
/* NEVER pause — no hover/click/focus pause */
@keyframes tp-reviews-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
	.tp-reviews-track {
		animation: none;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
	}
	.tp-review-card { scroll-snap-align: start; }
	.tp-review-card[aria-hidden="true"] { display: none; }
}

.tp-reviews-empty {
	position: relative; z-index: 1;
	text-align: center;
	color: rgba(255,255,255,0.8);
	padding: 16px;
	font-size: 14px;
}

/* ---------- Card base — WHITE background ---------- */
.tp-review-card {
	position: relative;
	flex: 0 0 auto;
	width: min(280px, 80vw);
	background: rgba(255,255,255,0.72);
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
	border: 1px solid rgba(255,255,255,0.4);
	border-radius: 14px;
	padding: 18px 16px;
	color: var(--tp-ink);
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
	box-shadow: 0 8px 24px rgba(15,23,42,0.14), inset 0 1px 0 rgba(255,255,255,0.35);
}
.tp-review-card:hover {
	transform: translateY(-2px);
	background: rgba(255,255,255,0.82);
	box-shadow: 0 12px 30px rgba(15,23,42,0.18), inset 0 1px 0 rgba(255,255,255,0.35);
}

@media (min-width: 640px) {
	.tp-review-card { width: 280px; padding: 20px 18px; }
}
@media (min-width: 980px) {
	.tp-review-card { width: 290px; }
	.tp-reviews-wrap[data-columns="2"] .tp-review-card { width: 380px; }
	.tp-reviews-wrap[data-columns="4"] .tp-review-card { width: 240px; }
}

/* ---------- Summary card — stays in blue gradient, fixed left ---------- */
.tp-summary-card {
	text-align: center;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	/* Override white — summary keeps the blue glass look */
	background: rgba(255,255,255,0.14);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	backdrop-filter: blur(12px) saturate(140%);
	border: 1px solid rgba(255,255,255,0.26);
	color: #fff;
	box-shadow: none;
}
.tp-summary-card:hover {
	transform: none;
	box-shadow: none;
}

/* Mobile: summary card stacks on top */
@media (max-width: 639px) {
	.tp-reviews-body {
		flex-direction: column;
	}
	.tp-summary-card {
		width: 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 6px 14px;
		padding: 14px 16px;
	}
	.tp-summary-label {
		font-size: 16px;
	}
	.tp-summary-brand {
		width: 100%;
		justify-content: center;
		margin-top: 0;
	}
}

.tp-summary-label {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.2;
}
.tp-summary-rating {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: rgba(255,255,255,0.85);
}
.tp-summary-count {
	font-size: 12.5px;
	color: rgba(255,255,255,0.6);
}
.tp-summary-brand {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 14px;
	color: #fff;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 5px;
}

/* ---------- Review card layout — dark text on white ---------- */
.tp-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}
.tp-review-date {
	font-size: 11.5px;
	color: var(--tp-slate);
	white-space: nowrap;
	flex-shrink: 0;
}
.tp-review-text {
	font-size: 13.5px;
	line-height: 1.55;
	color: #334155;
	margin: 0;
	word-wrap: break-word;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.tp-card-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
}
.tp-review-name {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 13px;
	color: var(--tp-ink);
}
.tp-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	background: var(--tp-green);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px 2px 4px;
	border-radius: 999px;
	letter-spacing: .2px;
	flex-shrink: 0;
}
.tp-review-course {
	font-size: 11px;
	color: var(--tp-slate);
}

/* ---------- Popup overlay ---------- */
.tp-review-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15,23,42,0.55);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	z-index: 100000;
	padding: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.tp-review-overlay.tp-open { opacity: 1; pointer-events: auto; }
@media (min-width: 640px) {
	.tp-review-overlay { align-items: center; padding: 20px; }
}

.tp-review-modal {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: 92vh;
	overflow-y: auto;
	background: linear-gradient(160deg, rgba(255,255,255,0.95), rgba(239,244,255,0.95));
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	backdrop-filter: blur(22px) saturate(160%);
	border: 1px solid rgba(255,255,255,0.5);
	border-radius: 18px 18px 0 0;
	padding: 24px 20px 20px;
	transform: translateY(24px);
	transition: transform .25s ease;
	font-family: 'Inter', sans-serif;
	color: var(--tp-ink);
}
.tp-review-overlay.tp-open .tp-review-modal { transform: translateY(0); }
@media (min-width: 640px) {
	.tp-review-modal { border-radius: 18px; padding: 28px 26px 24px; }
}

/* ---------- Close button — brand blue bg, white cross ---------- */
.tp-review-close {
	position: absolute;
	top: 12px; right: 12px;
	width: 30px; height: 30px;
	border-radius: 50%;
	border: none;
	background: var(--tp-blue);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, transform .15s ease;
	box-shadow: 0 2px 8px rgba(29,78,216,0.25);
}
.tp-review-close:hover {
	background: var(--tp-blue-deep);
	transform: scale(1.06);
}

.tp-review-modal-title {
	font-family: 'Poppins', sans-serif;
	font-weight: 700;
	font-size: 19px;
	margin: 0 0 3px;
	padding-right: 36px;
}
.tp-review-modal-sub {
	color: var(--tp-slate);
	font-size: 13px;
	margin: 0 0 16px;
	line-height: 1.4;
}

/* ---------- Form ---------- */
.tp-review-form { display: flex; flex-direction: column; gap: 14px; }
.tp-form-row { display: flex; flex-direction: column; gap: 5px; }
.tp-form-row label { font-size: 12px; font-weight: 600; color: var(--tp-ink); }
.tp-form-row-split { flex-direction: row; gap: 10px; }
.tp-form-row-split > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }

.tp-review-form input[type="text"],
.tp-review-form input[type="email"],
.tp-review-form select,
.tp-review-form textarea {
	font-family: inherit;
	font-size: 13.5px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid rgba(15,23,42,0.14);
	background: rgba(255,255,255,0.7);
	color: var(--tp-ink);
	width: 100%;
	resize: vertical;
}
.tp-review-form input:focus,
.tp-review-form select:focus,
.tp-review-form textarea:focus {
	outline: none;
	border-color: var(--tp-blue);
	box-shadow: 0 0 0 3px rgba(29,78,216,0.15);
}
.tp-review-form input[readonly] {
	background: rgba(15,23,42,0.05);
	color: var(--tp-slate);
}
.tp-course-display {
	font-size: 13.5px;
	font-weight: 600;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid rgba(15,23,42,0.14);
	background: rgba(15,23,42,0.05);
	color: var(--tp-ink);
}

.tp-star-input { display: flex; gap: 5px; font-size: 26px; }
.tp-star-choice {
	color: rgba(15,23,42,0.18);
	cursor: pointer;
	transition: color .12s ease, transform .12s ease;
	user-select: none;
}
.tp-star-choice:hover { transform: scale(1.1); }
.tp-star-choice.tp-active { color: var(--tp-amber); }

.tp-hp-field { position: absolute; left: -9999px; top: -9999px; }

.tp-form-message { font-size: 13px; padding: 0; min-height: 0; }
.tp-form-message.tp-success { color: var(--tp-green); font-weight: 600; }
.tp-form-message.tp-error { color: #DC2626; font-weight: 600; }

.tp-btn-submit-review {
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 14px;
	color: #fff;
	background: linear-gradient(135deg, var(--tp-blue), var(--tp-blue-deep));
	border: none;
	border-radius: 10px;
	padding: 11px 18px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(29,78,216,0.28);
}
.tp-btn-submit-review:hover { box-shadow: 0 8px 20px rgba(29,78,216,0.36); }
.tp-btn-submit-review:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Auth popup ---------- */
.tp-auth-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15,23,42,0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100001;
	padding: 20px;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.tp-auth-overlay.tp-open { opacity: 1; pointer-events: auto; }

.tp-auth-popup {
	position: relative;
	width: 100%;
	max-width: 320px;
	text-align: center;
	background: linear-gradient(160deg, rgba(29,78,216,0.96), rgba(27,63,176,0.97));
	-webkit-backdrop-filter: blur(22px) saturate(160%);
	backdrop-filter: blur(22px) saturate(160%);
	border: 1px solid rgba(255,255,255,0.25);
	border-radius: 18px;
	padding: 26px 22px 22px;
	color: #fff;
	transform: scale(.94);
	transition: transform .2s ease;
	font-family: 'Inter', sans-serif;
}
.tp-auth-overlay.tp-open .tp-auth-popup { transform: scale(1); }

.tp-auth-popup .tp-review-close {
	background: rgba(255,255,255,0.16);
	box-shadow: none;
}
.tp-auth-popup .tp-review-close:hover {
	background: rgba(255,255,255,0.26);
}

.tp-auth-icon {
	width: 46px; height: 46px;
	margin: 0 auto 12px;
	border-radius: 50%;
	background: rgba(255,255,255,0.14);
	border: 1px solid rgba(255,255,255,0.28);
	display: flex; align-items: center; justify-content: center;
}
.tp-auth-popup-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 16px; margin: 0 0 6px; }
.tp-auth-popup-sub { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.8); margin: 0 0 18px; }

.tp-auth-actions { display: flex; gap: 10px; }
.tp-btn-auth {
	flex: 1;
	font-family: 'Poppins', sans-serif;
	font-weight: 600;
	font-size: 13.5px;
	text-decoration: none;
	text-align: center;
	border-radius: 999px;
	padding: 10px 14px;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.tp-btn-auth:hover { transform: translateY(-1px); }
.tp-btn-auth-outline {
	color: #fff;
	background: transparent;
	border: 1px solid rgba(255,255,255,0.50);
}
.tp-btn-auth-outline:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tp-btn-auth-solid {
	color: var(--tp-blue-deep);
	background: #fff;
	box-shadow: 0 6px 16px rgba(15,23,42,0.22);
}
.tp-btn-auth-solid:hover { color: var(--tp-blue-deep); box-shadow: 0 8px 20px rgba(15,23,42,0.28); }

body.tp-review-modal-open { overflow: hidden; }
