/* Cricket Dashboard Pro — Frontend Styles */

.cdp-frontend {
	--cdp-accent: #0a7d33;
	--cdp-bg: #f7f9f7;
	--cdp-card-bg: #ffffff;
	--cdp-text: #1d2b22;
	--cdp-muted: #6b7a70;
	--cdp-border: #e3e7e4;
	--cdp-live: #e0303f;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--cdp-text);
	max-width: 1100px;
	margin: 0 auto;
}

.cdp-frontend[data-theme="dark"] {
	--cdp-bg: #111613;
	--cdp-card-bg: #1a211c;
	--cdp-text: #eef3ef;
	--cdp-muted: #9aa89e;
	--cdp-border: #2a322c;
}

@media (prefers-reduced-motion: reduce) {
	.cdp-frontend * {
		animation-duration: 0.001ms !important;
		transition-duration: 0.001ms !important;
	}
}

/* ---- Sticky Live Ticker ---- */
.cdp-ticker {
	position: sticky;
	top: 32px;
	z-index: 50;
	background: var(--cdp-text);
	color: #fff;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 18px;
	height: 38px;
	display: flex;
	align-items: center;
}

.cdp-ticker-track {
	display: flex;
	gap: 40px;
	white-space: nowrap;
	padding-left: 16px;
	animation: cdpTickerScroll 28s linear infinite;
}

.cdp-ticker:hover .cdp-ticker-track {
	animation-play-state: paused;
}

@keyframes cdpTickerScroll {
	0% { transform: translateX(0); }
	100% { transform: translateX(-50%); }
}

.cdp-ticker-item {
	font-size: 13px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.cdp-ticker-item .cdp-live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cdp-live);
	display: inline-block;
	animation: cdpPulse 1.4s ease-in-out infinite;
}

@keyframes cdpPulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.7); }
}

/* ---- Hero Match Card ---- */
.cdp-hero {
	background: linear-gradient(135deg, #0a3d24 0%, #0a7d33 60%, #11a347 100%);
	border-radius: 16px;
	padding: 28px;
	color: #fff;
	margin-bottom: 24px;
	min-height: 160px;
	position: relative;
	overflow: hidden;
}

.cdp-hero::after {
	content: "";
	position: absolute;
	top: -40%;
	right: -10%;
	width: 260px;
	height: 260px;
	background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
	border-radius: 50%;
}

.cdp-hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,0.18);
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 14px;
}

.cdp-hero-badge .cdp-live-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #fff;
	animation: cdpPulse 1.2s ease-in-out infinite;
}

.cdp-hero-teams {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.cdp-hero-team {
	font-size: 19px;
	font-weight: 700;
}

.cdp-hero-score {
	font-size: 26px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.cdp-hero-vs {
	font-size: 13px;
	opacity: 0.7;
	font-weight: 500;
}

.cdp-hero-meta {
	margin-top: 14px;
	font-size: 13px;
	opacity: 0.85;
}

.cdp-hero-progress {
	margin-top: 16px;
	height: 6px;
	border-radius: 4px;
	background: rgba(255,255,255,0.2);
	overflow: hidden;
}

.cdp-hero-progress-fill {
	height: 100%;
	background: #fff;
	border-radius: 4px;
	transition: width 0.6s ease;
}

/* ---- Section / Tabs ---- */
.cdp-section {
	margin-bottom: 28px;
}

.cdp-section-title {
	font-size: 17px;
	font-weight: 700;
	margin-bottom: 14px;
}

.cdp-public-tabs {
	display: flex;
	gap: 4px;
	background: var(--cdp-border);
	padding: 4px;
	border-radius: 10px;
	width: fit-content;
	margin-bottom: 18px;
}

.cdp-public-tab {
	border: none;
	background: transparent;
	padding: 8px 18px;
	border-radius: 7px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cdp-muted);
	cursor: pointer;
	transition: all 0.18s ease;
}

.cdp-public-tab.active {
	background: var(--cdp-card-bg);
	color: var(--cdp-accent);
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ---- Match Grid (4 columns desktop) ---- */
.cdp-match-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.cdp-match-card {
	background: var(--cdp-card-bg);
	border: 1px solid var(--cdp-border);
	border-radius: 12px;
	padding: 16px;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	animation: cdpCardIn 0.35s ease both;
}

.cdp-match-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0,0,0,0.09);
}

@keyframes cdpCardIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

.cdp-match-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 3px 9px;
	border-radius: 999px;
	margin-bottom: 10px;
}

.cdp-status-live {
	background: rgba(224, 48, 63, 0.12);
	color: var(--cdp-live);
}

.cdp-status-upcoming {
	background: rgba(46, 110, 222, 0.12);
	color: #2e6ede;
}

.cdp-status-completed {
	background: rgba(107, 122, 112, 0.12);
	color: var(--cdp-muted);
}

.cdp-match-teams {
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 4px;
}

.cdp-match-score {
	font-size: 13px;
	color: var(--cdp-muted);
	font-variant-numeric: tabular-nums;
}

.cdp-match-venue {
	font-size: 11px;
	color: var(--cdp-muted);
	margin-top: 8px;
}

/* ---- Points Table ---- */
.cdp-points-wrapper {
	overflow-x: auto;
	border: 1px solid var(--cdp-border);
	border-radius: 12px;
}

.cdp-points-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.cdp-points-table th {
	background: var(--cdp-bg);
	text-align: left;
	padding: 10px 14px;
	font-weight: 600;
	color: var(--cdp-muted);
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.04em;
}

.cdp-points-table td {
	padding: 10px 14px;
	border-top: 1px solid var(--cdp-border);
}

/* ---- Skeletons ---- */
.cdp-skeleton {
	background: linear-gradient(90deg, var(--cdp-border) 25%, #f0f2f0 37%, var(--cdp-border) 63%);
	background-size: 400% 100%;
	animation: cdpSkeleton 1.4s ease infinite;
	border-radius: 12px;
}

@keyframes cdpSkeleton {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

.cdp-skeleton-hero { height: 160px; }
.cdp-skeleton-card { height: 110px; }
.cdp-skeleton-table { height: 140px; }

.cdp-loading-text { color: rgba(255,255,255,0.7); font-size: 13px; }

/* ---- Modal (Scorecard) ---- */
.cdp-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	align-items: center;
	justify-content: center;
}

.cdp-modal.open {
	display: flex;
}

.cdp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.55);
	animation: cdpFadeIn2 0.2s ease;
}

@keyframes cdpFadeIn2 {
	from { opacity: 0; } to { opacity: 1; }
}

.cdp-modal-content {
	position: relative;
	background: var(--cdp-card-bg);
	color: var(--cdp-text);
	border-radius: 14px;
	max-width: 640px;
	width: 92%;
	max-height: 80vh;
	overflow-y: auto;
	padding: 24px;
	animation: cdpModalIn 0.25s ease;
}

@keyframes cdpModalIn {
	from { opacity: 0; transform: translateY(16px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.cdp-modal-close {
	position: absolute;
	top: 14px;
	right: 14px;
	background: var(--cdp-bg);
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 18px;
	cursor: pointer;
	color: var(--cdp-text);
}

.cdp-modal-close:focus-visible,
.cdp-public-tab:focus-visible,
.cdp-match-card:focus-visible {
	outline: 2px solid var(--cdp-accent);
	outline-offset: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
	.cdp-match-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.cdp-hero-score {
		font-size: 22px;
	}
}

@media (max-width: 600px) {
	.cdp-match-grid {
		grid-template-columns: 1fr;
	}
	.cdp-hero {
		padding: 20px;
	}
	.cdp-hero-teams {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.cdp-ticker {
		top: 0;
	}
	.cdp-public-tabs {
		width: 100%;
		justify-content: space-between;
	}
	.cdp-public-tab {
		flex: 1;
		text-align: center;
		padding: 8px 10px;
	}
}
