/**
 * Frontend Styles
 *
 * @package Google_Reviews_By_Location
 */

/* Widget Container - Using CSS Variables */
.grbl-widget,
.grbl-shortcode {
	margin: 20px 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	
	/* CSS Variables for dynamic styling */
	--grbl-bg-color: #ffffff;
	--grbl-text-color: #333333;
	--grbl-star-color: #ffa500;
	--grbl-border-color: #e0e0e0;
	--grbl-border-radius: 0px;
	--grbl-padding: 15px;
	--grbl-align: left;
	
	/* Apply variables */
	color: var(--grbl-text-color);
	background-color: var(--grbl-bg-color);
	text-align: var(--grbl-align);
}

/* Summary Section */
.grbl-summary {
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 1px solid #e0e0e0;
}

.grbl-rating {
	display: flex;
	align-items: center;
	gap: 10px;
}

.grbl-rating-value {
	font-size: 32px;
	font-weight: 700;
	color: #1a73e8;
	line-height: 1;
}

.grbl-stars {
	display: flex;
	gap: 2px;
	color: var(--grbl-star-color);
}

.grbl-review-count {
	color: #5f6368;
	font-size: 14px;
}

/* Reviews List */
.grbl-reviews {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.grbl-review-item {
	padding: var(--grbl-padding);
	background: #f8f9fa;
	border-radius: var(--grbl-border-radius);
	border: 1px solid var(--grbl-border-color);
	transition: box-shadow 0.2s ease;
}

.grbl-review-item:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grbl-review-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 10px;
	flex-wrap: wrap;
	gap: 10px;
}

.grbl-review-author {
	font-size: 16px;
	font-weight: 600;
	color: #202124;
}

.grbl-review-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 5px;
}

.grbl-review-rating {
	display: flex;
	gap: 2px;
	color: var(--grbl-star-color);
}

.grbl-review-date {
	font-size: 12px;
	color: #5f6368;
}

.grbl-review-text {
	font-size: 14px;
	line-height: 1.6;
	color: #3c4043;
	margin-top: 10px;
}

/* Stars */
.grbl-star {
	font-size: 18px;
	color: #dadce0;
	line-height: 1;
}

.grbl-star-full {
	color: var(--grbl-star-color, #fbbc04);
}

.grbl-star-half {
	color: #fbbc04;
	position: relative;
	overflow: hidden;
}

.grbl-star-half::after {
	content: '★';
	position: absolute;
	left: 0;
	width: 50%;
	overflow: hidden;
	color: #dadce0;
}

/* Grid Layout */
.grbl-layout-grid .grbl-reviews {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
}

/* Error Messages */
.grbl-error {
	padding: 10px;
	background: #fee;
	border-left: 4px solid #dc3232;
	color: #dc3232;
}

.grbl-no-reviews {
	text-align: center;
	padding: 20px;
	color: #5f6368;
	font-style: italic;
}

/* Animation */
.grbl-animated .grbl-review-item {
	animation: fadeInUp 0.6s ease-out;
	animation-fill-mode: both;
}

.grbl-animated .grbl-review-item:nth-child(1) { animation-delay: 0.1s; }
.grbl-animated .grbl-review-item:nth-child(2) { animation-delay: 0.2s; }
.grbl-animated .grbl-review-item:nth-child(3) { animation-delay: 0.3s; }
.grbl-animated .grbl-review-item:nth-child(4) { animation-delay: 0.4s; }
.grbl-animated .grbl-review-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Text Modes */
.grbl-text-mode-scroll .grbl-scrollable-text {
	max-height: 150px;
	overflow-y: auto;
	padding-right: 10px;
}

.grbl-text-mode-scroll .grbl-scrollable-text::-webkit-scrollbar {
	width: 6px;
}

.grbl-text-mode-scroll .grbl-scrollable-text::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.grbl-text-mode-scroll .grbl-scrollable-text::-webkit-scrollbar-thumb {
	background: #888;
	border-radius: 3px;
}

.grbl-text-mode-scroll .grbl-scrollable-text::-webkit-scrollbar-thumb:hover {
	background: #555;
}

/* Alignment */
.grbl-widget[style*="text-align: center"] .grbl-review-item {
	text-align: center;
}

.grbl-widget[style*="text-align: right"] .grbl-review-item {
	text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
	.grbl-summary {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.grbl-review-header {
		flex-direction: column;
	}
	
	.grbl-review-meta {
		align-items: flex-start;
	}
	
	.grbl-layout-grid .grbl-reviews {
		grid-template-columns: 1fr;
	}
}

