/**
 * Urgent Transit Review System - Frontend Stylesheet
 * Responsive, Lightweight, accessible, styled via CSS Variables.
 */

:root {
	--rs-primary: #0f172a;
	--rs-accent: #2563eb;
	--rs-star: #eab308;
	--rs-radius: 8px;
	--rs-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* ==========================================================================
   COMMON & UTILITIES
   ========================================================================== */
.rs-stars {
	display: inline-flex;
	gap: 2px;
	color: var(--rs-star);
}
.rs-star-svg {
	display: inline-block;
	vertical-align: middle;
}
.rs-spinner {
	animation: rs-rotate 2s linear infinite;
	width: 20px;
	height: 20px;
}
.rs-spinner .path {
	stroke: currentColor;
	stroke-linecap: round;
	animation: rs-dash 1.5s ease-in-out infinite;
}
@keyframes rs-rotate {
	100% { transform: rotate(360deg); }
}
@keyframes rs-dash {
	0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
	50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
	100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* ==========================================================================
   REVIEW SUBMISSION FORM
   ========================================================================== */
.rs-review-form-container {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--rs-radius);
	padding: 24px;
	box-shadow: var(--rs-shadow);
	font-family: inherit;
	color: var(--rs-primary);
}
.rs-review-form-container h3 {
	margin: 0 0 20px 0;
	font-size: 20px;
	font-weight: 600;
	color: var(--rs-primary);
}
.rs-form-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 15px;
}
@media (min-width: 640px) {
	.rs-form-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
.rs-form-row {
	margin-bottom: 18px;
	display: flex;
	flex-direction: column;
}
.rs-form-row label {
	font-size: 14px;
	font-weight: 550;
	margin-bottom: 6px;
	color: var(--rs-primary);
}
.rs-required-label::after {
	content: " *";
	color: #ef4444;
}
.rs-form-input,
.rs-form-textarea,
.rs-form-select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #cbd5e1;
	border-radius: var(--rs-radius);
	background: #f8fafc;
	color: var(--rs-primary);
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	transition: all 0.2s ease-in-out;
}
.rs-form-input:focus,
.rs-form-textarea:focus,
.rs-form-select:focus {
	outline: none;
	border-color: var(--rs-accent);
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.rs-form-textarea {
	resize: vertical;
}

/* Star Rating Selector */
.rs-form-star-rating {
	display: flex;
	gap: 6px;
}
.rs-form-star-rating .rs-star {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	color: #cbd5e1;
	cursor: pointer;
	transition: color 0.15s ease-in-out, transform 0.1s ease-in-out;
}
.rs-form-star-rating .rs-star:focus {
	outline: 2px solid var(--rs-accent);
	outline-offset: 4px;
	border-radius: 4px;
}
.rs-form-star-rating .rs-star.active {
	color: var(--rs-star);
}
.rs-form-star-rating:hover .rs-star {
	color: #cbd5e1;
}
.rs-form-star-rating:hover .rs-star.hover,
.rs-form-star-rating:hover .rs-star.active {
	color: var(--rs-star);
}

/* Character Counter & Warnings */
.rs-label-counter-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.rs-character-counter {
	font-size: 11px;
	color: #64748b;
}
.rs-inline-error {
	font-size: 12px;
	color: #dc2626;
	margin-top: 4px;
	display: none;
}
.rs-form-row.has-error .rs-inline-error {
	display: block;
}
.rs-form-row.has-error .rs-form-input,
.rs-form-row.has-error .rs-form-textarea {
	border-color: #ef4444;
}

/* Consent check */
.rs-consent-row .rs-checkbox-label {
	display: flex;
	align-items: flex-start;
	font-weight: 400;
	cursor: pointer;
}
.rs-consent-row input[type="checkbox"] {
	margin-top: 3px;
	margin-right: 8px;
	accent-color: var(--rs-accent);
}

/* Form Submit Button */
.rs-form-footer {
	margin-top: 24px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}
.rs-global-error {
	width: 100%;
	padding: 10px 14px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--rs-radius);
	color: #b91c1c;
	font-size: 13px;
}
.rs-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 140px;
	padding: 12px 24px;
	background: var(--rs-accent);
	color: #ffffff;
	border: none;
	border-radius: var(--rs-radius);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	position: relative;
}
.rs-submit-btn:hover {
	opacity: 0.95;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.rs-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Success Animation UI */
.rs-form-success-container {
	text-align: center;
	padding: 40px 20px;
}
.rs-success-icon-wrapper {
	width: 80px;
	height: 80px;
	margin: 0 auto 20px;
}
.rs-success-svg {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	stroke: #16a34a;
	stroke-width: 2;
	stroke-miterlimit: 10;
	box-shadow: inset 0 0 0 #16a34a;
	animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out 0s both;
}
.rs-success-circle {
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	stroke-width: 2;
	stroke-miterlimit: 10;
	stroke: #16a34a;
	fill: none;
	animation: stroke .6s cubic-bezier(.65, 0, .45, 1) forwards;
}
.rs-success-check {
	transform-origin: 50% 50%;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: stroke .3s cubic-bezier(.65, 0, .45, 1) .8s forwards;
}
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0 0 0 40px rgba(22, 163, 74, 0.1); } }

.rs-success-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 10px 0;
	color: #16a34a;
}
.rs-success-message {
	font-size: 15px;
	color: #475569;
	margin: 0;
}

/* ==========================================================================
   REVIEWS FILTERS TOOLBAR
   ========================================================================== */
.rs-filters-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 24px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: var(--rs-radius);
	padding: 12px;
}
.rs-toolbar-item {
	flex: 1 1 180px;
}
.rs-filter-search {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	box-sizing: border-box;
}
.rs-filter-rating,
.rs-filter-service,
.rs-filter-sort {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	background: #ffffff;
}

/* ==========================================================================
   REVIEWS CARD LAYOUT
   ========================================================================== */
.rs-reviews-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	align-items: start;
}
.rs-review-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--rs-radius);
	padding: 24px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.02);
	position: relative;
	display: flex;
	flex-direction: column;
	font-family: inherit;
	color: var(--rs-primary);
	box-sizing: border-box;
	transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.rs-review-card:hover {
	transform: translateY(-2px);
}
.rs-card-featured-item {
	border-color: var(--rs-accent);
}
.rs-card-featured-badge {
	position: absolute;
	top: -10px;
	right: 15px;
	background: var(--rs-accent);
	color: #ffffff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 20px;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	box-shadow: 0 2px 4px rgba(37,99,235,0.2);
}
.rs-badge-icon {
	color: #ffffff;
}

/* Card Header details */
.rs-card-header {
	margin-bottom: 12px;
}
.rs-card-author-name {
	margin: 0 0 4px 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--rs-primary);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.rs-card-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 10px;
	font-weight: 600;
	color: #16a34a;
	background: rgba(22, 163, 74, 0.08);
	padding: 2px 6px;
	border-radius: 4px;
	margin-left: 2px;
	vertical-align: middle;
}
.rs-verified-icon {
	stroke: currentColor;
}
.rs-card-stars {
	margin-top: 4px;
}

/* Card Body details */
.rs-card-body {
	flex-grow: 1;
	margin-bottom: 12px;
}
.rs-card-title {
	margin: 0 0 8px 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--rs-primary);
}
.rs-card-text {
	margin: 0;
	font-size: 14px;
	color: #475569;
	line-height: 1.5;
}
.rs-card-meta-details {
	margin-top: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	font-size: 11px;
	color: #64748b;
	border-top: 1px solid #f1f5f9;
	padding-top: 12px;
}
.rs-card-meta-item strong {
	color: #475569;
}

/* Admin Reply block inside card */
.rs-card-admin-reply {
	background: #f8fafc;
	border-left: 3px solid var(--rs-accent);
	border-radius: 0 6px 6px 0;
	padding: 14px;
	margin-top: 14px;
	font-size: 13px;
}
.rs-reply-header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 6px;
}
.rs-reply-badge {
	font-weight: 600;
	color: var(--rs-accent);
}
.rs-reply-time {
	font-size: 11px;
	color: #94a3b8;
}
.rs-reply-text {
	margin: 0;
	color: #334155;
	line-height: 1.5;
}

/* Card Footer */
.rs-card-footer {
	margin-top: auto;
	border-top: 1px solid #f1f5f9;
	padding-top: 10px;
	font-size: 11px;
	color: #94a3b8;
}

/* Lazy Load button block */
.rs-load-more-container {
	text-align: center;
	margin-top: 30px;
}
.rs-load-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 24px;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-radius: var(--rs-radius);
	color: #475569;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
}
.rs-load-more-btn:hover {
	border-color: var(--rs-accent);
	color: var(--rs-accent);
}

/* ==========================================================================
   CAROUSEL SWIPER STYLE ADJUSTMENTS
   ========================================================================== */
.rs-carousel-wrapper {
	position: relative;
	padding-bottom: 30px;
}
.rs-reviews-swiper {
	overflow: hidden;
	position: relative;
	padding: 15px 0 20px 0;
}
.rs-carousel-wrapper .swiper-button-prev,
.rs-carousel-wrapper .swiper-button-next {
	width: 38px;
	height: 38px;
	background: #ffffff;
	color: var(--rs-primary);
	border: 1px solid #e2e8f0;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	transition: all 0.2s ease-in-out;
}
.rs-carousel-wrapper .swiper-button-prev:after,
.rs-carousel-wrapper .swiper-button-next:after {
	font-size: 14px;
	font-weight: bold;
}
.rs-carousel-wrapper .swiper-button-prev:hover,
.rs-carousel-wrapper .swiper-button-next:hover {
	background: var(--rs-accent);
	color: #ffffff;
	border-color: var(--rs-accent);
}
.rs-carousel-wrapper .swiper-pagination-bullet-active {
	background: var(--rs-accent);
}

/* ==========================================================================
   RATING SUMMARY LAYOUT
   ========================================================================== */
.rs-summary-layout-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--rs-radius);
	padding: 24px;
	box-shadow: var(--rs-shadow);
	align-items: center;
}
@media (min-width: 768px) {
	.rs-summary-layout-grid {
		grid-template-columns: 1fr 2fr;
		gap: 40px;
		padding: 30px;
	}
}

/* Summary Left score */
.rs-summary-left-block {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}
@media (min-width: 768px) {
	.rs-summary-left-block {
		border-right: 1px solid #f1f5f9;
		padding-right: 30px;
	}
}
.rs-summary-avg-score {
	font-size: 54px;
	font-weight: 800;
	color: var(--rs-primary);
	line-height: 1;
	margin-bottom: 8px;
}
.rs-stars-large svg {
	width: 24px;
	height: 24px;
}
.rs-summary-avg-stars {
	margin-bottom: 8px;
}
.rs-summary-total-count {
	font-size: 13px;
	color: #64748b;
	font-weight: 500;
}

/* Summary Right distribution bars */
.rs-summary-right-block {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.rs-summary-dist-row {
	display: flex;
	align-items: center;
	font-size: 13px;
}
.rs-dist-label {
	width: 50px;
	color: #64748b;
	font-weight: 550;
	text-align: right;
	margin-right: 12px;
}
.rs-dist-bar-wrapper {
	flex-grow: 1;
	height: 8px;
	background: #f1f5f9;
	border-radius: 4px;
	overflow: hidden;
	margin-right: 12px;
}
.rs-dist-bar-fill {
	height: 100%;
	background: var(--rs-star);
	border-radius: 4px;
	transition: width 0.5s ease-out;
}
.rs-dist-count {
	width: 25px;
	color: #94a3b8;
	text-align: left;
}
.rs-no-reviews {
	text-align: center;
	padding: 40px;
	color: #94a3b8;
	font-size: 14px;
}

/* Swiper equal height slides setup */
.rs-reviews-swiper {
	padding-bottom: 40px; /* Space for pagination dots */
}
.rs-reviews-swiper .swiper-wrapper {
	display: flex;
	align-items: stretch; /* Stretch all slides to match the tallest one */
}
.rs-reviews-swiper .swiper-slide {
	height: auto; /* Required for stretching */
	display: flex;
	flex-direction: column;
}
.rs-reviews-swiper .swiper-slide .rs-review-card,
.rs-reviews-swiper .swiper-slide .rs-carousel-more-card {
	height: 100%;
	flex: 1 1 auto;
}

/* Carousel More Redirection Card */
.rs-carousel-more-card {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	height: 100%;
	min-height: 220px;
	background: linear-gradient(135deg, rgba(37, 99, 235, 0.03) 0%, rgba(37, 99, 235, 0.08) 100%);
	border: 2px dashed rgba(37, 99, 235, 0.2);
	border-radius: var(--rs-radius);
	padding: 24px;
	text-decoration: none !important;
	box-sizing: border-box;
	transition: all 0.25s ease-in-out;
}
.rs-carousel-more-card:hover {
	background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.12) 100%);
	border-color: var(--rs-accent);
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}
.rs-more-card-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 15px;
	text-align: center;
}
.rs-more-card-icon {
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: var(--rs-accent);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}
.rs-more-card-icon .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}
.rs-more-card-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--rs-accent);
}

/* Success Modal Popup Styles */
.rs-success-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(15, 23, 42, 0.6);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	animation: rsModalFadeIn 0.3s ease-out;
}
.rs-success-modal-content {
	background: #ffffff;
	padding: 40px 30px;
	border-radius: 12px;
	text-align: center;
	position: relative;
	width: 90%;
	max-width: 400px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	box-sizing: border-box;
	animation: rsModalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rs-success-modal-close {
	position: absolute;
	top: 15px;
	right: 20px;
	font-size: 24px;
	font-weight: bold;
	color: #94a3b8;
	cursor: pointer;
	line-height: 1;
	transition: color 0.15s ease;
}
.rs-success-modal-close:hover {
	color: #0f172a;
}
@keyframes rsModalFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes rsModalScaleIn {
	from { transform: scale(0.9); opacity: 0; }
	to { transform: scale(1); opacity: 1; }
}
