/**
 * Haripriya.AI Comments Guru
 * Front end styles. Scoped so themes are left alone.
 */

:root {
	--hcg-accent: #e0563f;
	--hcg-ink: #16181d;
	--hcg-muted: #6b7280;
	--hcg-surface: #ffffff;
	--hcg-soft: #f6f7f9;
	--hcg-hairline: rgba(16, 24, 40, 0.08);
	--hcg-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 12px 32px -12px rgba(16, 24, 40, 0.14);
	--hcg-radius: 18px;
	--hcg-ease: cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- Leaderboard ---------- */

.hcg-board {
	background: var(--hcg-soft);
	border-radius: var(--hcg-radius);
	padding: 6px;
	margin: 28px 0;
	box-shadow: var(--hcg-shadow);
}

.hcg-board-head {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px 10px;
}

.hcg-board-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--hcg-ink);
}

.hcg-tabs {
	display: inline-flex;
	background: rgba(16, 24, 40, 0.05);
	border-radius: 999px;
	padding: 3px;
}

.hcg-tab {
	border: 0;
	background: transparent;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	line-height: 1;
	padding: 7px 14px;
	border-radius: 999px;
	color: var(--hcg-muted);
	transition: background 0.4s var(--hcg-ease), color 0.4s var(--hcg-ease), transform 0.4s var(--hcg-ease);
}

.hcg-tab.is-active {
	background: var(--hcg-surface);
	color: var(--hcg-ink);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.hcg-tab:active {
	transform: scale(0.97);
}

.hcg-board-list {
	list-style: none;
	margin: 0;
	padding: 8px;
	background: var(--hcg-surface);
	border-radius: calc(var(--hcg-radius) - 6px);
}

.hcg-board-list.is-hidden {
	display: none;
}

.hcg-board-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 12px;
	transition: background 0.4s var(--hcg-ease);
}

.hcg-board-row + .hcg-board-row {
	box-shadow: inset 0 1px 0 var(--hcg-hairline);
}

.hcg-board-row:hover {
	background: var(--hcg-soft);
}

.hcg-rank {
	min-width: 22px;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--hcg-muted);
}

.hcg-board-name {
	flex: 1;
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--hcg-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hcg-board-ig {
	display: block;
	font-size: 11px;
	font-weight: 500;
	color: var(--hcg-muted);
	text-decoration: none;
}

.hcg-board-points {
	font-size: 13px;
	font-weight: 700;
	color: var(--hcg-accent);
	font-variant-numeric: tabular-nums;
}

.hcg-board-none,
.hcg-board-empty p {
	padding: 14px;
	margin: 0;
	font-size: 13px;
	color: var(--hcg-muted);
	text-align: center;
}

/* ---------- Avatars and badges ---------- */

.hcg-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 50%;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

.hcg-comment-avatar .hcg-avatar,
.hcg-comment-avatar img {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	font-size: 17px;
	border-radius: 50%;
}

.hcg-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
	padding: 5px 9px;
	border-radius: 999px;
	color: var(--hcg-badge, #6b7280);
	background: color-mix(in srgb, var(--hcg-badge, #6b7280) 12%, transparent);
	white-space: nowrap;
}

@supports not (background: color-mix(in srgb, red 10%, white)) {
	.hcg-badge {
		background: rgba(16, 24, 40, 0.06);
	}
}

.hcg-points {
	font-size: 11px;
	font-weight: 700;
	color: var(--hcg-accent);
	font-variant-numeric: tabular-nums;
}

.hcg-points span {
	font-weight: 500;
	opacity: 0.7;
}

/* ---------- Comment list ---------- */

.hcg-comment {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
}

.hcg-comment .children {
	list-style: none;
	margin: 12px 0 0;
	padding-left: 18px;
	border-left: 2px solid var(--hcg-hairline);
}

.hcg-comment-inner {
	display: flex;
	gap: 12px;
	background: var(--hcg-surface);
	border-radius: var(--hcg-radius);
	padding: 14px;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 24px -16px rgba(16, 24, 40, 0.25);
	transition: transform 0.5s var(--hcg-ease), box-shadow 0.5s var(--hcg-ease);
}

.hcg-comment-inner:hover {
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 16px 32px -16px rgba(16, 24, 40, 0.3);
}

.hcg-comment-body {
	flex: 1;
	min-width: 0;
}

.hcg-comment-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.hcg-author {
	font-size: 14px;
	font-weight: 700;
	color: var(--hcg-ink);
}

.hcg-date {
	font-size: 11px;
	color: var(--hcg-muted);
	margin-left: auto;
}

.hcg-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 8px;
}

.hcg-chip {
	display: inline-flex;
	align-items: center;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 999px;
	background: var(--hcg-soft);
	color: var(--hcg-muted);
	text-decoration: none;
	transition: transform 0.4s var(--hcg-ease), background 0.4s var(--hcg-ease);
}

.hcg-chip-ig {
	background: linear-gradient(120deg, rgba(240, 148, 51, 0.16), rgba(188, 24, 136, 0.16));
	color: #b31a7e;
}

.hcg-chip-ig:hover {
	transform: translateY(-1px);
}

.hcg-comment-text {
	font-size: 15px;
	line-height: 1.65;
	color: var(--hcg-ink);
	overflow-wrap: break-word;
}

.hcg-comment-text p:last-child {
	margin-bottom: 0;
}

.hcg-moderation {
	font-size: 12px;
	color: #92400e;
	background: rgba(245, 158, 11, 0.12);
	padding: 7px 10px;
	border-radius: 10px;
	margin: 8px 0 0;
}

.hcg-comment-actions {
	margin-top: 8px;
}

.hcg-comment-actions a {
	font-size: 12px;
	font-weight: 600;
	color: var(--hcg-accent);
	text-decoration: none;
	padding: 5px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--hcg-accent) 10%, transparent);
	display: inline-block;
	transition: transform 0.4s var(--hcg-ease);
}

.hcg-comment-actions a:hover {
	transform: translateY(-1px);
}

/* ---------- Form ---------- */

.hcg-form {
	background: var(--hcg-soft);
	border-radius: var(--hcg-radius);
	padding: 18px;
	margin-top: 22px;
}

.hcg-form .hcg-field {
	margin: 0 0 14px;
}

.hcg-form label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--hcg-ink);
	margin-bottom: 6px;
}

.hcg-form input[type="text"],
.hcg-form input[type="email"],
.hcg-form input[type="number"],
.hcg-form select,
.hcg-form textarea {
	width: 100%;
	box-sizing: border-box;
	font: inherit;
	font-size: 15px;
	padding: 12px 14px;
	border: 0;
	border-radius: 12px;
	background: var(--hcg-surface);
	color: var(--hcg-ink);
	box-shadow: inset 0 0 0 1px var(--hcg-hairline);
	transition: box-shadow 0.4s var(--hcg-ease);
}

.hcg-form textarea {
	min-height: 110px;
	resize: vertical;
}

.hcg-form input:focus,
.hcg-form select:focus,
.hcg-form textarea:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--hcg-accent);
}

.hcg-req {
	color: var(--hcg-accent);
}

.hcg-optional {
	color: var(--hcg-muted);
	font-weight: 400;
}

.hcg-check {
	display: flex !important;
	align-items: flex-start;
	gap: 8px;
	font-weight: 500 !important;
	font-size: 13px !important;
}

.hcg-check input {
	margin-top: 2px;
}

.hcg-counter {
	display: block;
	text-align: right;
	font-size: 11px;
	color: var(--hcg-muted);
	margin-top: 4px;
}

.hcg-points-hint {
	font-size: 12px;
	font-weight: 600;
	color: var(--hcg-accent);
	background: color-mix(in srgb, var(--hcg-accent) 10%, transparent);
	padding: 8px 12px;
	border-radius: 10px;
	margin: 0 0 12px;
}

.hcg-form .hcg-submit {
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: var(--hcg-accent);
	border: 0;
	border-radius: 999px;
	padding: 13px 26px;
	cursor: pointer;
	transition: transform 0.4s var(--hcg-ease), filter 0.4s var(--hcg-ease);
}

.hcg-form .hcg-submit:hover {
	filter: brightness(1.06);
}

.hcg-form .hcg-submit:active {
	transform: scale(0.98);
}

.hcg-form .hcg-submit[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.hcg-hp {
	position: absolute !important;
	left: -9999px !important;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
	.hcg-comment-inner {
		padding: 12px;
		gap: 10px;
	}

	.hcg-comment .children {
		padding-left: 10px;
	}

	.hcg-date {
		width: 100%;
		margin-left: 0;
	}

	.hcg-form {
		padding: 14px;
	}
}

/* ---------- Dark themes ---------- */

@media (prefers-color-scheme: dark) {
	:root {
		--hcg-ink: #eef0f4;
		--hcg-muted: #9aa2b1;
		--hcg-surface: #16181d;
		--hcg-soft: #1e2128;
		--hcg-hairline: rgba(255, 255, 255, 0.09);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hcg-board *,
	.hcg-comment-inner,
	.hcg-chip,
	.hcg-form .hcg-submit {
		transition: none !important;
	}
}
