/**
 * AI Leaderboard Section – React LeaderboardSection style
 * Two-column layout: content + Top Contributors card
 * Tailwind ref: slate, blue palette
 */

.ai-lbs-section,
.ai-lbs-section * {
	box-sizing: border-box;
}




.ai-lbs-section{
	max-width: 1400px;
	margin: 0 auto;
}




.ai-lbs-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4rem;
	align-items: center;
}

@media (min-width: 1024px) {
	.ai-lbs-grid { grid-template-columns: 1fr 1fr; }
}

/* Left: Content */

.ai-lbs-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	background: #dbeafe;
	color: #1d4ed8;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 1.5rem;
}

.ai-lbs-badge-icon {
	width: 0.875rem;
	height: 0.875rem;
	flex-shrink: 0;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-badge { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
}

html.theme-dark .ai-lbs-badge,
body.dark-mode .ai-lbs-badge {
	background: rgba(59, 130, 246, 0.2) !important;
	color: #93c5fd !important;
}

.ai-lbs-title {
	font-size: 2.25rem;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.2;
	margin: 0 0 1.5rem;
}

@media (min-width: 768px) {
	.ai-lbs-title { font-size: 3rem; }
}

.ai-lbs-highlight {
	color: #2563eb;
}

html.theme-dark .ai-lbs-title,
body.dark-mode .ai-lbs-title {
	color: #fff !important;
}

html.theme-dark .ai-lbs-highlight,
body.dark-mode .ai-lbs-highlight {
	color: #60a5fa !important;
}

.ai-lbs-description {
	font-size: 1.125rem;
	color: #475569;
	line-height: 1.6;
	margin: 0 0 2rem;
	padding-bottom: 0px!important;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-description { color: #94a3b8; }
}

html.theme-dark .ai-lbs-description,
body.dark-mode .ai-lbs-description {
	color: #94a3b8 !important;
}

.ai-lbs-buttons {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

@media (min-width: 640px) {
	.ai-lbs-buttons { flex-direction: row; }
}

.ai-lbs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s;
}

.ai-lbs-btn-primary {
	background: #2563eb;
	color: #fff;
	box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.2);
}

.ai-lbs-btn-primary:hover {
	background: #1d4ed8;
	color: #fff;
}

html.theme-dark .ai-lbs-btn-primary {
	background: #155dfc ;
}
html.theme-dark .ai-lbs-btn-primary:hover {
	background: #1447e6 ;
}
.ai-lbs-btn-icon {
	width: 1rem;
	height: 1rem;
	margin-left: 0.5rem;
}

.ai-lbs-trust {
	display: flex;
	align-items: center;
	gap: 2rem;
	margin-top: 2rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #64748b;
}

.ai-lbs-trust-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.ai-lbs-trust-icon {
	width: 1rem;
	height: 1rem;
	flex-shrink: 0;
}

.ai-lbs-trust-item:first-child .ai-lbs-trust-icon { color: #10b981; }
.ai-lbs-trust-item:last-child .ai-lbs-trust-icon { color: #3b82f6; }

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-trust { color: #94a3b8; }
}

html.theme-dark .ai-lbs-trust,
body.dark-mode .ai-lbs-trust {
	color: #94a3b8 !important;
}

/* Right: Card */
.ai-lbs-card {
	animation: ai-lbs-fade-in 0.7s ease-out;
}

@keyframes ai-lbs-fade-in {
	from { opacity: 0; transform: translateY(1rem); }
	to { opacity: 1; transform: translateY(0); }
}

.ai-lbs-card-inner {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 1rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-card-inner { background: #0f172a; border-color: #1e293b; }
}

.ai-lbs-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 1.5rem;
	border-bottom: 1px solid #e2e8f0;
	background: #fff;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-card-header { background: #0f172a; border-color: #1e293b; }
}
html.theme-dark .ai-lbs-card-header{
	background: #0f172a; border-color: #1e293b;
}
.ai-lbs-card-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0!important;
}

.ai-lbs-crown {
	width: 1.25rem;
	height: 1.25rem;
	color: #eab308;
	fill: #eab308;
}

html.theme-dark .ai-lbs-card-title,
body.dark-mode .ai-lbs-card-title {
	color: #fff !important;
}

.ai-lbs-period {
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
	background: #f1f5f9;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;

}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-period { background: #1e293b; color: #94a3b8; }
}

html.theme-dark .ai-lbs-period,
body.dark-mode .ai-lbs-period {
	background: #1e293b !important;
	color: #94a3b8 !important;
}

/* List */
.ai-lbs-list {
	background: #fff;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-list { background: #0f172a; }
}

.ai-lbs-list-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid #f1f5f9;
	transition: background-color 0.15s;
}

.ai-lbs-list-item:last-of-type {
	border-bottom: none;
}

.ai-lbs-list-item:hover {
	background: #f8fafc;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-list-item { border-color: #1e293b; }
	html:not(.theme-light) .ai-lbs-list-item:hover { background: rgba(30, 41, 59, 0.5); }
}

/* Rank badge */
.ai-lbs-rank {
	width: 2rem;
	height: 2rem;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.5rem;
	font-size: 0.875rem;
	font-weight: 700;
}

.ai-lbs-rank-1 {
	background: #fef3c7;
	color: #b45309;
}

.ai-lbs-rank-2 {
	background: #e2e8f0;
	color: #475569;
}

.ai-lbs-rank-3 {
	background: #ffedd5;
	color: #9a3412;
}

.ai-lbs-rank-other {
	background: #f8fafc;
	color: #64748b;
}

html.theme-dark .ai-lbs-rank-1,
body.dark-mode .ai-lbs-rank-1 {
	background: rgba(253, 224, 71, 0.2) !important;
	color: #fcd34d !important;
}

html.theme-dark .ai-lbs-rank-2,
body.dark-mode .ai-lbs-rank-2 {
	background: #334155 !important;
	color: #cbd5e1 !important;
}

html.theme-dark .ai-lbs-rank-3,
body.dark-mode .ai-lbs-rank-3 {
	background: rgba(251, 146, 60, 0.2) !important;
	color: #fdba74 !important;
}

html.theme-dark .ai-lbs-rank-other,
body.dark-mode .ai-lbs-rank-other {
	background: #1e293b !important;
	color: #94a3b8 !important;
}

/* Avatar */
.ai-lbs-avatar {
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid #f1f5f9;
}

.ai-lbs-avatar-initials {
	width: 2.5rem;
	height: 2.5rem;
	flex-shrink: 0;
	border-radius: 50%;
	background: #3b82f6;
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 600;
	border: 1px solid #f1f5f9;
}

html.theme-dark .ai-lbs-avatar,
html.theme-dark .ai-lbs-avatar-initials {
	border-color: #334155 !important;
}

.ai-lbs-item-info {
	flex: 1;
	min-width: 0;
	line-height: 1.5;
}

.ai-lbs-item-name {
	font-size: 0.875rem;
	font-weight: 700;
	color: #0f172a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 0.15s;
}

.ai-lbs-list-item:hover .ai-lbs-item-name {
	color: #2563eb;
}

.ai-lbs-item-role {
	font-size: 0.75rem;
	color: #64748b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

html.theme-dark .ai-lbs-item-name,
body.dark-mode .ai-lbs-item-name {
	color: #fff !important;
}

.ai-lbs-list-item:hover .ai-lbs-item-name {
	color: #60a5fa !important;
}

html.theme-dark .ai-lbs-item-role,
body.dark-mode .ai-lbs-item-role {
	color: #94a3b8 !important;
}

.ai-lbs-item-score {
	text-align: right;
	flex-shrink: 0;
}

.ai-lbs-score-value {
	font-size: 0.875rem;
	font-weight: 700;
	font-family: ui-monospace, monospace;
	color: #0f172a;
}

.ai-lbs-score-change {
	font-size: 0.625rem;
	font-weight: 700;
	color: #10b981;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.125rem;
}

.ai-lbs-score-change svg {
	width: 0.75rem;
	height: 0.75rem;
}

html.theme-dark .ai-lbs-score-value,
body.dark-mode .ai-lbs-score-value {
	color: #fff !important;
}

html.theme-dark .ai-lbs-score-change,
body.dark-mode .ai-lbs-score-change {
	color: #34d399 !important;
}

/* Footer */
.ai-lbs-card-footer {
	padding: 1rem 1.5rem;
	text-align: center;
	border-top: 1px solid #e2e8f0;
	background: #f8fafc;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-card-footer { border-color: #1e293b; background: #0f172a; }
}

.ai-lbs-view-all {
	font-size: 0.75rem;
	font-weight: 700;
	color: #64748b;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: color 0.15s;
}

.ai-lbs-view-all:hover {
	color: #2563eb;
}

html.theme-dark .ai-lbs-view-all,
body.dark-mode .ai-lbs-view-all {
	color: #94a3b8 !important;
}

.ai-lbs-view-all:hover {
	color: #60a5fa !important;
}

/* Loading */
.ai-lbs-loading {
	padding: 3rem 1.5rem;
	min-height: 180px;
	text-align: center;
	color: #64748b;
	font-size: 0.875rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.ai-lbs-spinner {
	width: 1.5rem;
	height: 1.5rem;
	border: 2px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: ai-lbs-spin 0.8s linear infinite;
}

@keyframes ai-lbs-spin {
	to { transform: rotate(360deg); }
}

html.theme-dark .ai-lbs-spinner,
body.dark-mode .ai-lbs-spinner {
	border-color: #334155;
	border-top-color: #60a5fa;
}

.ai-lbs-spinner-text {
	font-size: 0.875rem;
}

html.theme-dark .ai-lbs-loading,
body.dark-mode .ai-lbs-loading {
	color: #94a3b8 !important;
}

.ai-lbs-error {
	color: #dc2626;
}

html.theme-dark .ai-lbs-error,
body.dark-mode .ai-lbs-error {
	color: #f87171 !important;
}

/* API error — same pattern as AI Leaders leaderboard empty-state card */
.ai-lbs-api-error {
	display: none;
	padding: 2.5rem 1.5rem;
	text-align: center;
	background: #fff;
	border-top: 1px solid #f1f5f9;
}

.ai-lbs-api-error-icon {
	width: 4rem;
	height: 4rem;
	margin: 0 auto 1rem;
	background: #f1f5f9;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ai-lbs-api-error-icon svg {
	width: 2rem;
	height: 2rem;
	color: #94a3b8;
}

.ai-lbs-api-error-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 0.5rem;
	line-height: 1.3;
}

.ai-lbs-api-error-message {
	color: #64748b;
	max-width: 22rem;
	margin: 0 auto;
	font-size: 0.9375rem;
	line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
	html:not(.theme-light) .ai-lbs-api-error {
		background: #0f172a;
		border-top-color: #1e293b;
	}
	html:not(.theme-light) .ai-lbs-api-error-icon {
		background: #1e293b;
	}
	html:not(.theme-light) .ai-lbs-api-error-title {
		color: #fff;
	}
	html:not(.theme-light) .ai-lbs-api-error-message {
		color: #94a3b8;
	}
}

html.theme-dark .ai-lbs-api-error,
body.dark-mode .ai-lbs-api-error {
	background: #0f172a !important;
	border-top-color: #1e293b !important;
}

html.theme-dark .ai-lbs-api-error-icon,
body.dark-mode .ai-lbs-api-error-icon {
	background: #1e293b !important;
}

html.theme-dark .ai-lbs-api-error-title,
body.dark-mode .ai-lbs-api-error-title {
	color: #fff !important;
}

html.theme-dark .ai-lbs-api-error-message,
body.dark-mode .ai-lbs-api-error-message {
	color: #94a3b8 !important;
}
