/**
 * Comparix Pro — Bangladesh Design System (Final UI/UX)
 * Single source of truth for spacing, typography, components.
 * Uses CSS custom properties — no duplicated token values elsewhere.
 */

:root {
	/* ── Bangladesh palette ── */
	--cx-bd-green: #006a4e;
	--cx-bd-red: #f42a41;
	--cx-bd-gold: #f59e0b;

	/* ── Spacing scale (4px base) ── */
	--cx-space-1: 4px;
	--cx-space-2: 8px;
	--cx-space-3: 12px;
	--cx-space-4: 16px;
	--cx-space-5: 20px;
	--cx-space-6: 24px;
	--cx-space-8: 32px;
	--cx-space-10: 40px;
	--cx-space-12: 48px;
	--cx-space-16: 64px;

	/* ── Typography ── */
	--cx-font-display: 'Plus Jakarta Sans', 'Noto Sans Bengali', system-ui, sans-serif;
	--cx-font-body: var(--cx-font-display);
	--cx-text-xs: 0.6875rem;
	--cx-text-sm: 0.8125rem;
	--cx-text-base: 0.875rem;
	--cx-text-lg: 1rem;
	--cx-text-xl: 1.125rem;
	--cx-text-2xl: 1.375rem;
	--cx-text-3xl: 1.75rem;
	--cx-text-4xl: 2.25rem;
	--cx-leading-tight: 1.2;
	--cx-leading-normal: 1.5;
	--cx-leading-relaxed: 1.65;

	/* ── Radius ── */
	--cx-radius-sm: 8px;
	--cx-radius-md: 12px;
	--cx-radius-lg: 16px;
	--cx-radius-xl: 20px;
	--cx-radius-full: 9999px;

	/* ── Shadows ── */
	--cx-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
	--cx-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
	--cx-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
	--cx-shadow-xl: 0 20px 48px rgba(15, 23, 42, 0.16);

	/* ── Motion ── */
	--cx-duration-fast: 150ms;
	--cx-duration-normal: 280ms;
	--cx-duration-slow: 400ms;
	--cx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--cx-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

	/* ── Status colors ── */
	--cx-status-official: #10b981;
	--cx-status-unofficial: #f59e0b;
	--cx-status-upcoming: #3b82f6;
	--cx-status-drop: #10b981;
	--cx-status-rise: #ef4444;

	/* ── Layout ── */
	--cx-container-sm: 640px;
	--cx-container-md: 768px;
	--cx-container-lg: 1024px;
	--cx-container-xl: 1280px;
	--cx-container-2xl: 1440px;

	/* Bridge legacy tokens */
	--cx-r: var(--cx-radius-lg);
	--cx-r-sm: var(--cx-radius-sm);
	--cx-r-lg: var(--cx-radius-xl);
	--cx-sh: var(--cx-shadow-sm);
	--cx-sh-md: var(--cx-shadow-md);
	--cx-ease: var(--cx-duration-normal) var(--cx-ease-in-out);
	--cx-font: var(--cx-font-body);
}

/* ── Buttons ── */
.cx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cx-space-2);
	padding: 10px 18px;
	border-radius: var(--cx-radius-full);
	font-family: var(--cx-font-body);
	font-size: var(--cx-text-sm);
	font-weight: 700;
	line-height: 1;
	border: 1px solid transparent;
	cursor: pointer;
	text-decoration: none;
	transition: transform var(--cx-duration-fast) var(--cx-ease-out),
		box-shadow var(--cx-duration-fast) var(--cx-ease-out),
		background var(--cx-duration-fast) var(--cx-ease-out);
}
.cx-btn:focus-visible {
	outline: 2px solid var(--cx-primary, #6366f1);
	outline-offset: 2px;
}
.cx-btn:active { transform: scale(0.98); }
.cx-btn-primary {
	background: var(--cx-primary, #6366f1);
	color: #fff;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}
.cx-btn-primary:hover {
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
	transform: translateY(-1px);
}
.cx-btn-secondary {
	background: var(--cx-card, #fff);
	color: var(--cx-text, #0f172a);
	border-color: var(--cx-border, #e2e8f0);
}
.cx-btn-secondary:hover { border-color: var(--cx-primary, #6366f1); color: var(--cx-primary, #6366f1); }
.cx-btn-ghost {
	background: transparent;
	color: var(--cx-g600, #475569);
}
.cx-btn-sm { padding: 6px 12px; font-size: var(--cx-text-xs); }

/* ── Cards (enhanced) ── */
.cx-card {
	border-radius: var(--cx-radius-lg);
	border: 1px solid var(--cx-border, #e2e8f0);
	background: var(--cx-card, #fff);
	transition: transform var(--cx-duration-normal) var(--cx-ease-out),
		box-shadow var(--cx-duration-normal) var(--cx-ease-out),
		border-color var(--cx-duration-fast) var(--cx-ease-out);
}
.cx-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--cx-shadow-md);
	border-color: rgba(99, 102, 241, 0.2);
}
.cx-card:focus-within {
	outline: 2px solid var(--cx-primary, #6366f1);
	outline-offset: 2px;
}

/* ── Badges ── */
.cx-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: var(--cx-radius-sm);
	font-size: var(--cx-text-xs);
	font-weight: 700;
	line-height: 1.2;
}
.cx-badge-official { background: #d1fae5; color: #065f46; }
.cx-badge-unofficial { background: #fef3c7; color: #92400e; }
.cx-badge-drop { background: #d1fae5; color: #047857; }
.cx-badge-upcoming { background: #dbeafe; color: #1d4ed8; }
.cx-badge-bd { background: linear-gradient(135deg, #006a4e, #00875a); color: #fff; }

/* ── Skeleton loading ── */
.cx-skel {
	background: linear-gradient(90deg, var(--cx-g100, #f1f5f9) 25%, var(--cx-g200, #e2e8f0) 50%, var(--cx-g100, #f1f5f9) 75%);
	background-size: 200% 100%;
	animation: cxShimmer 1.4s ease infinite;
	border-radius: var(--cx-radius-md);
	min-height: 120px;
}
@keyframes cxShimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
	.cx-skel { animation: none; background: var(--cx-g100, #f1f5f9); }
	.cx-card:hover { transform: none; }
}

/* ── Tables ── */
.cx-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--cx-text-sm);
}
.cx-table th,
.cx-table td {
	padding: var(--cx-space-3) var(--cx-space-4);
	border-bottom: 1px solid var(--cx-border, #e2e8f0);
	text-align: left;
}
.cx-table th {
	font-size: var(--cx-text-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cx-g500, #64748b);
	background: var(--cx-bg, #f8fafc);
}

/* ── Section headings ── */
.cx-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cx-space-4);
	margin-bottom: var(--cx-space-5);
}
.cx-section-head h2 {
	font-size: var(--cx-text-2xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0;
	color: var(--cx-text, #0f172a);
}
.cx-section-head a {
	font-size: var(--cx-text-sm);
	font-weight: 700;
	color: var(--cx-primary, #6366f1);
	text-decoration: none;
}
.cx-section-head a:hover { text-decoration: underline; }

/* ── Responsive containers ── */
.cx-container {
	width: 100%;
	max-width: var(--cx-container-xl);
	margin: 0 auto;
	padding-left: var(--cx-space-4);
	padding-right: var(--cx-space-4);
}
@media (min-width: 768px) {
	.cx-container { padding-left: var(--cx-space-6); padding-right: var(--cx-space-6); }
}
@media (min-width: 1280px) {
	.cx-container { max-width: var(--cx-container-2xl); }
}

/* ── Dark theme bridge ── */
[data-theme="dark"] {
	--cx-bg: #0f172a;
	--cx-card: #1e293b;
	--cx-text: #e2e8f0;
	--cx-border: #334155;
	--cx-g100: #1e293b;
	--cx-g200: #334155;
}

/* ── Bangla typography hint ── */
html[lang="bn"],
html[lang="bn-BD"] {
	font-family: var(--cx-font-display);
}

@media (max-width: 374px) {
	:root { --cx-text-3xl: 1.5rem; }
}

@media (min-width: 2560px) {
	:root {
		--cx-text-base: 0.9375rem;
		--cx-container-xl: 1600px;
	}
}
