/**
 * Paidigi Smart Views - Frontend Styles
 * Compatible with PVC's CSS classes
 */

.post-views {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 8px 0;
	font-size: 0.9rem;
	color: #666;
	line-height: 1.5;
}

.post-views .post-views-icon {
	display: inline-flex;
	align-items: center;
}

.post-views .post-views-icon.dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
}

.post-views .post-views-label {
	margin-right: 4px;
}

.post-views .post-views-count {
	font-weight: 600;
}

.post-views.load-dynamic .post-views-count {
	min-width: 20px;
	display: inline-block;
}

/* Widget styles */
.widget .post-views {
	font-size: 0.85em;
}

/* Most viewed posts list */
.pvc-most-viewed-posts ul,
.pvc-most-viewed-posts ol {
	margin: 0;
	padding: 0 0 0 20px;
}

.pvc-most-viewed-posts li {
	margin-bottom: 8px;
	line-height: 1.6;
}

.pvc-most-viewed-posts .post-thumbnail {
	display: block;
	margin-bottom: 4px;
}

.pvc-most-viewed-posts .post-thumbnail img {
	max-width: 100%;
	height: auto;
}

.pvc-most-viewed-posts .count {
	color: #999;
	font-size: 0.9em;
}

.pvc-most-viewed-posts .author {
	color: #999;
	font-size: 0.9em;
}

.pvc-most-viewed-posts .post-excerpt {
	margin-top: 4px;
	font-size: 0.9em;
	color: #666;
}

/* ============================================
   Popular Posts Template Styles
   ============================================ */

/* --- Shared --- */
.sv-popular {
	line-height: 1.5;
}

.sv-popular a.post-title {
	text-decoration: none;
	color: inherit;
}

.sv-popular a.post-title:hover {
	text-decoration: underline;
}

/* --- Default: inherits .pvc-most-viewed-posts styles above --- */

/* --- Numbered --- */
.sv-popular--numbered .sv-numbered-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-popular--numbered .sv-numbered-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 10px;
	padding-bottom: 10px;
	border-bottom: 1px solid #f0f0f0;
}

.sv-popular--numbered .sv-numbered-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.sv-popular--numbered .sv-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	background: #f0f0f0;
	color: #333;
	border-radius: 50%;
	font-weight: 700;
	font-size: 0.85em;
	line-height: 1;
}

.sv-popular--numbered .sv-numbered-item:nth-child(1) .sv-rank {
	background: #ffd700;
	color: #333;
}

.sv-popular--numbered .sv-numbered-item:nth-child(2) .sv-rank {
	background: #c0c0c0;
	color: #333;
}

.sv-popular--numbered .sv-numbered-item:nth-child(3) .sv-rank {
	background: #cd7f32;
	color: #fff;
}

.sv-popular--numbered .sv-numbered-content {
	flex: 1;
	min-width: 0;
}

.sv-popular--numbered .count,
.sv-popular--numbered .author {
	color: #999;
	font-size: 0.9em;
}

.sv-popular--numbered .post-excerpt {
	margin-top: 4px;
	font-size: 0.85em;
	color: #666;
}

/* --- Thumbnail List --- */
.sv-popular--thumb-list .sv-thumb-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-popular--thumb-list .sv-thumb-item {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0f0f0;
}

.sv-popular--thumb-list .sv-thumb-item:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.sv-popular--thumb-list .sv-thumb-image {
	flex-shrink: 0;
	width: 80px;
	display: block;
}

.sv-popular--thumb-list .sv-thumb-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	display: block;
}

.sv-popular--thumb-list .sv-thumb-content {
	flex: 1;
	min-width: 0;
}

.sv-popular--thumb-list .post-title {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.sv-popular--thumb-list .sv-thumb-meta {
	display: flex;
	gap: 8px;
	font-size: 0.85em;
	color: #999;
}

.sv-popular--thumb-list .post-excerpt {
	margin-top: 4px;
	font-size: 0.85em;
	color: #666;
}

/* --- Grid --- */
.sv-popular--grid .sv-grid {
	display: grid;
	grid-template-columns: repeat(var(--sv-columns, 2), 1fr);
	gap: 16px;
}

.sv-popular--grid .sv-grid-item {
	min-width: 0;
}

.sv-popular--grid .sv-grid-image {
	display: block;
	margin-bottom: 8px;
}

.sv-popular--grid .sv-grid-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	display: block;
}

.sv-popular--grid .sv-grid-body {
	font-size: 0.9em;
}

.sv-popular--grid .post-title {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.sv-popular--grid .count,
.sv-popular--grid .author {
	display: block;
	color: #999;
	font-size: 0.85em;
}

.sv-popular--grid .post-excerpt {
	margin-top: 4px;
	font-size: 0.85em;
	color: #666;
}

/* --- Card --- */
.sv-popular--card .sv-card-grid {
	display: grid;
	grid-template-columns: repeat(var(--sv-columns, 2), 1fr);
	gap: 16px;
}

.sv-popular--card .sv-card {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.sv-popular--card .sv-card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sv-popular--card .sv-card-image {
	display: block;
}

.sv-popular--card .sv-card-image img {
	width: 100%;
	height: auto;
	display: block;
}

.sv-popular--card .sv-card-body {
	padding: 12px;
}

.sv-popular--card .post-title {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.sv-popular--card .post-excerpt {
	font-size: 0.85em;
	color: #666;
	margin-bottom: 8px;
}

.sv-popular--card .sv-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.8em;
	color: #999;
	padding-top: 8px;
	border-top: 1px solid #f0f0f0;
}

/* --- Minimal --- */
.sv-popular--minimal .sv-minimal-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-popular--minimal .sv-minimal-item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding: 6px 0;
	border-bottom: 1px solid #f5f5f5;
}

.sv-popular--minimal .sv-minimal-item:last-child {
	border-bottom: none;
}

.sv-popular--minimal .post-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sv-popular--minimal .count {
	flex-shrink: 0;
	color: #999;
	font-size: 0.85em;
	font-weight: 600;
}

/* ============================================
   Active Readers Badge
   ============================================ */

.sv-active-readers {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 12px;
	padding-left: 12px;
	border-left: 1px solid #ddd;
	color: #666;
}

.sv-active-readers .sv-active-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #999;
}

.sv-active-readers .sv-active-icon.dashicons {
	line-height: 1;
}

.sv-active-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #4caf50;
	border-radius: 50%;
	animation: sv-pulse 2s infinite;
}

@keyframes sv-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

.sv-active-readers .sv-active-count {
	font-weight: 600;
}

/* ============================================
   Site Stats Widget
   ============================================ */

.sv-site-stats {
	padding: 0;
}

.sv-stat-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.sv-stat-item:last-of-type {
	border-bottom: none;
}

.sv-stat-label {
	color: #666;
	font-size: 0.9em;
}

.sv-stat-value {
	font-weight: 600;
	font-size: 1.1em;
}

.sv-stat-active-posts {
	margin-top: 8px;
}

.sv-stat-active-posts h4 {
	margin: 0 0 6px;
	font-size: 0.9em;
	color: #666;
}

.sv-stat-active-posts ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sv-stat-active-posts li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 4px 0;
	font-size: 0.9em;
	border-bottom: 1px solid #f5f5f5;
}

.sv-stat-active-posts li:last-child {
	border-bottom: none;
}

.sv-stat-active-posts li a {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-decoration: none;
	color: inherit;
}

.sv-stat-active-posts li a:hover {
	text-decoration: underline;
}

.sv-stat-active-posts .sv-active-count {
	flex-shrink: 0;
	margin-left: 8px;
	font-weight: 600;
	color: #4caf50;
}

.sv-stat-active-posts .sv-no-active {
	color: #999;
	font-style: italic;
}
