/* ==========================================================================
   ChopSkills Hall of Fame — Stylesheet
   ==========================================================================
   CSS Grid gallery layout designed to showcase historical tournament winners
   with a prominent double-sized Hero image for the #1 ranked entry.
   ========================================================================== */

:root {
	--cs-bg-primary: #0a0a0f;
	--cs-bg-card: #12121a;
	--cs-bg-card-hover: #1a1a26;
	--cs-border-subtle: rgba(255, 255, 255, 0.06);
	--cs-border-glow: rgba(99, 102, 241, 0.4);
	--cs-text-primary: #f0f0f5;
	--cs-text-muted: #8888a0;
	--cs-accent: #6366f1;
	--cs-accent-glow: rgba(99, 102, 241, 0.25);
	--cs-success: #22c55e;
	--cs-radius: 16px;
	--cs-radius-sm: 10px;
	--cs-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
	--cs-shadow-hover: 0 8px 40px rgba(99, 102, 241, 0.2);
	--cs-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--cs-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	/* Hall of Fame Specific Colors */
	--cs-hof-gold: #fbbf24;
	--cs-hof-purple: #fbbf24;
	--cs-hof-purple-glow: rgba(251, 191, 36, 0.15);
}

/* --------------------------------------------------------------------------
   Root Container & Loading States
   -------------------------------------------------------------------------- */
#chopskills-hall-of-fame-root {
	max-width: 1400px;
	width: 100vw;
	position: relative;
	left: 50%;
	transform: translateX(-50%);
	margin: 2.5rem 0;
	padding: 0 1.5rem;
	font-family: var(--cs-font);
	color: var(--cs-text-primary);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Loading Spinner */
.cs-hof-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
}

.cs-hof-spinner {
	width: 44px;
	height: 44px;
	border: 3px solid var(--cs-border-subtle);
	border-top-color: var(--cs-hof-purple);
	border-radius: 50%;
	animation: cs-hof-spin 0.8s linear infinite;
}

@keyframes cs-hof-spin {
	to { transform: rotate(360deg); }
}

/* Error Box */
.cs-hof-error {
	padding: 3rem 1.5rem;
	text-align: center;
}

.cs-hof-err-box {
	background: var(--cs-bg-card);
	border: 1px solid var(--cs-border-subtle);
	border-radius: var(--cs-radius);
	padding: 2.5rem 2rem;
	max-width: 480px;
	margin: 0 auto;
	box-shadow: var(--cs-shadow-card);
}

.cs-hof-err-icon {
	font-size: 2.5rem;
	display: block;
	margin-bottom: 1rem;
}

.cs-hof-err-box h4 {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--cs-text-primary);
}

.cs-hof-err-box p {
	color: var(--cs-text-muted);
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
	line-height: 1.5;
}

.cs-hof-retry-btn {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--cs-border-subtle);
	color: var(--cs-text-primary);
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 0.65rem 1.5rem;
	border-radius: 30px;
	cursor: pointer;
	transition: var(--cs-transition);
}

.cs-hof-retry-btn:hover {
	border-color: var(--cs-hof-purple);
	background: var(--cs-hof-purple-glow);
	color: #fff;
	transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Header Branding
   -------------------------------------------------------------------------- */
.cs-hof__header {
	text-align: center;
	margin-bottom: 2.5rem;
}

.cs-hof__title {
	font-size: 2rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0 0 0.5rem;
	background: linear-gradient(135deg, var(--cs-text-primary), var(--cs-hof-purple));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.cs-hof__subtitle {
	font-size: 1rem;
	color: var(--cs-text-muted);
	margin: 0;
	max-width: 600px;
	margin-left: auto;
	margin-right: auto;
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Gallery Grid System
   -------------------------------------------------------------------------- */
.cs-hof__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
	grid-auto-flow: dense;
}

/* --------------------------------------------------------------------------
   Card Layout and Details
   -------------------------------------------------------------------------- */
.cs-hof-card {
	position: relative;
	background: var(--cs-bg-card);
	border: 1px solid var(--cs-border-subtle);
	border-radius: var(--cs-radius);
	overflow: hidden;
	box-shadow: var(--cs-shadow-card);
	transition: var(--cs-transition);
	display: flex;
	flex-direction: column;
	min-height: 380px;
}

.cs-hof-card:hover {
	transform: translateY(-4px);
	border-color: rgba(168, 85, 247, 0.3);
	box-shadow: 0 12px 30px rgba(168, 85, 247, 0.15);
}

/* Image Wrapper */
.cs-hof-card__image-container {
	position: relative;
	width: 100%;
	height: 200px;
	background: rgba(255, 255, 255, 0.02);
	overflow: hidden;
	flex-shrink: 0;
}

.cs-hof-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cs-hof-card:hover .cs-hof-card__img {
	transform: scale(1.06);
}

/* Missing file state */
.cs-hof-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: var(--cs-text-muted);
	gap: 0.75rem;
	opacity: 0.45;
}

.cs-hof-card__placeholder span {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
}

/* Information Container */
.cs-hof-card__info {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	justify-content: space-between;
}

/* Meta Line */
.cs-hof-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.cs-hof-badge {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	padding: 0.25rem 0.6rem;
	border-radius: 4px;
	letter-spacing: 0.05em;
}

.cs-hof-badge--hero {
	background: var(--cs-hof-purple-glow);
	color: var(--cs-hof-purple);
	border: 1px solid rgba(168, 85, 247, 0.3);
}

.cs-hof-badge--rank {
	background: rgba(255, 255, 255, 0.05);
	color: var(--cs-text-muted);
	border: 1px solid var(--cs-border-subtle);
}

.cs-hof-rating {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--cs-hof-gold);
}

/* Title & Author */
.cs-hof-card__title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 0.35rem 0;
	color: var(--cs-text-primary);
	line-height: 1.3;
}

.cs-hof-card__author {
	font-size: 0.85rem;
	color: var(--cs-text-muted);
	margin: 0 0 1.25rem 0;
}

/* --------------------------------------------------------------------------
   Hero Card Modifier (Double Size on large displays)
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
	.cs-hof-card--hero {
		grid-column: span 2;
		grid-row: span 2;
		min-height: 520px;
	}

	.cs-hof-card--hero .cs-hof-card__image-container {
		height: 320px;
	}

	.cs-hof-card--hero .cs-hof-card__info {
		padding: 1.75rem;
	}

	.cs-hof-card--hero .cs-hof-card__title {
		font-size: 1.65rem;
		margin-bottom: 0.5rem;
	}

	.cs-hof-card--hero .cs-hof-card__author {
		font-size: 0.95rem;
		margin-bottom: 1.75rem;
	}
}

/* --------------------------------------------------------------------------
   Action Buttons (Pro-gates and Standard download styles)
   -------------------------------------------------------------------------- */
.cs-hof-card__actions {
	margin-top: auto;
}

.cs-hof-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	width: 100%;
}

.cs-hof-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	font-size: 0.85rem;
	font-weight: 700;
	padding: 0.65rem 1rem;
	border-radius: var(--cs-radius-sm);
	transition: var(--cs-transition);
	font-family: inherit;
	cursor: pointer;
	text-align: center;
	border: 1px solid transparent;
}

.cs-hof-btn__icon {
	margin-right: 0.4rem;
}

/* Primary Pro button */
.cs-hof-btn--pro {
	background: linear-gradient(135deg, var(--cs-hof-purple), var(--cs-accent));
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
	width: 100%;
}

.cs-hof-btn--pro:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(168, 85, 247, 0.45);
	filter: brightness(1.08);
}

/* Standard JPG link button */
.cs-hof-btn--standard {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--cs-border-subtle);
	color: var(--cs-text-primary) !important;
	flex-grow: 1;
}

.cs-hof-btn--standard:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.15);
	transform: translateY(-1px);
}

/* Locked PSD button for Free tier */
.cs-hof-btn--locked {
	background: rgba(168, 85, 247, 0.08);
	border: 1px solid rgba(168, 85, 247, 0.25);
	color: var(--cs-hof-purple) !important;
	font-size: 0.8rem;
	flex-grow: 2;
}

.cs-hof-btn--locked:hover {
	background: var(--cs-hof-purple);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
	border-color: transparent;
	transform: translateY(-1px);
}

/* View Entry Button */
.cs-hof-btn--entry {
	background: rgba(99, 102, 241, 0.1);
	border: 1px solid rgba(99, 102, 241, 0.3);
	color: var(--cs-accent) !important;
	flex-grow: 1;
}

.cs-hof-btn--entry:hover {
	background: var(--cs-accent);
	color: #fff !important;
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
	border-color: transparent;
	transform: translateY(-1px);
}

/* Links within cards */
.cs-hof-challenge-link,
.cs-hof-author-link {
	text-decoration: none;
	color: inherit;
	transition: var(--cs-transition);
}

.cs-hof-challenge-link:hover .cs-hof-card__title,
.cs-hof-author-link:hover {
	text-decoration: underline;
	opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.cs-hof-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
	.cs-hof-card--hero { grid-column: span 2; grid-row: span 1; min-height: auto; }
	.cs-hof-card--hero .cs-hof-card__image-container { height: 200px; }
}

@media (max-width: 560px) {
	#chopskills-hof-root { margin: 1.5rem auto; }
	.cs-hof-grid { grid-template-columns: 1fr; gap: 1rem; }
	.cs-hof-card--hero { grid-column: span 1; }
	.cs-hof__title { font-size: 1.3rem; }
	.cs-hof__subtitle { font-size: 0.85rem; }
	.cs-hof-card__info { padding: 1rem; }
	.cs-hof-card__title { font-size: 1rem; }
	.cs-hof-actions { flex-direction: column; }
	.cs-hof-btn { width: 100%; justify-content: center; }
}
