/**
 * Aktuális projekt — státuszkártya
 *
 * Prefix: .ap-card, .ap-badge, .ap-stat
 *
 * A színeket a PHP inline style-dal adja meg CSS-változókon a .ap-card-on:
 *   --ap-accent-1, --ap-accent-2  → gradiens (százalék, bar, glow)
 *   --ap-badge-color              → LIVE badge színe (állapottól függően)
 *
 * Az állapot (data-ap-state) alapján a .ap-badge__dot pulzál vagy sem.
 */

.ap-card {
	--ap-accent-1:    #f6b93b;
	--ap-accent-2:    #ff7a18;
	--ap-badge-color: #22c55e;

	--ap-text:        #ffffff;
	--ap-muted:       #a7b0c0;

	position: relative;
	border-radius: 22px;
	padding: 34px;
	background: linear-gradient(160deg, rgba(20, 29, 43, 0.9), rgba(16, 23, 34, 0.75));
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.09);
	overflow: hidden;
	box-sizing: border-box;
	font-family: "Poppins", sans-serif;
}

/* ---- Sarok glow --------------------------------------------------------- */

.ap-card__glow {
	position: absolute;
	top: -60px;
	right: -40px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--ap-accent-2) 22%, transparent), transparent 70%);
	-webkit-filter: blur(20px);
	filter: blur(20px);
	pointer-events: none;
	z-index: 0;
}

/* color-mix fallback: ha a böngésző nem támogatja, egy sima rgba. */
@supports not (background: color-mix(in srgb, red, blue)) {
	.ap-card__glow {
		background: radial-gradient(circle, rgba(255, 122, 24, 0.16), transparent 70%);
	}
}

/* ---- Fejléc (LIVE badge + állapot) -------------------------------------- */

.ap-card__head {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 26px;
}

.ap-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 13px;
	border-radius: 100px;
	background: color-mix(in srgb, var(--ap-badge-color) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--ap-badge-color) 40%, transparent);
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.ap-badge {
		background: rgba(34, 197, 94, 0.14);
		border: 1px solid rgba(34, 197, 94, 0.4);
	}
}

.ap-badge__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ap-badge-color);
	box-shadow: 0 0 8px var(--ap-badge-color);
	flex-shrink: 0;
}

.ap-badge__label {
	font-size: 12px;
	font-weight: 700;
	color: var(--ap-badge-color);
	letter-spacing: 1.5px;
}

/* Pulzáló animáció csak „készülésben" állapotban. */
.ap-card[data-ap-state="keszulesben"] .ap-badge__dot {
	animation: ap-pulse 1.8s ease-in-out infinite;
}

@keyframes ap-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: 0.45; transform: scale(0.8); }
}

.ap-card__status {
	font-size: 14px;
	color: var(--ap-muted);
	font-weight: 500;
}

/* ---- Főblokk (címek + százalék) ----------------------------------------- */

.ap-card__main {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}

.ap-card__subtitle {
	font-size: 13px;
	color: var(--ap-muted);
	font-weight: 500;
	margin-bottom: 2px;
}

.ap-card__title {
	font-size: 34px;
	font-weight: 800;
	letter-spacing: -0.5px;
	color: var(--ap-text);
	line-height: 1.1;
}

.ap-card__percent {
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	background: linear-gradient(135deg, var(--ap-accent-1), var(--ap-accent-2)) text;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	white-space: nowrap;
}

/* ---- Progress bar ------------------------------------------------------- */

.ap-card__bar {
	position: relative;
	z-index: 1;
	height: 14px;
	border-radius: 100px;
	background: rgba(255, 255, 255, 0.07);
	overflow: hidden;
	margin-bottom: 24px;
}

.ap-card__bar-fill {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	border-radius: 100px;
	background: linear-gradient(90deg, var(--ap-accent-1), var(--ap-accent-2));
	box-shadow: 0 0 20px color-mix(in srgb, var(--ap-accent-2) 60%, transparent);
	transition: width 0.4s ease;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.ap-card__bar-fill {
		box-shadow: 0 0 20px rgba(255, 122, 24, 0.6);
	}
}

/* ---- Statisztika kártyák ------------------------------------------------ */

.ap-card__stats {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
}

.ap-stat {
	padding: 16px;
	border-radius: 14px;
	background: rgba(8, 11, 18, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.ap-stat__label {
	font-size: 12px;
	color: var(--ap-muted);
	margin-bottom: 6px;
}

.ap-stat__value {
	font-size: 18px;
	font-weight: 700;
	color: var(--ap-text);
	line-height: 1.2;
}

.ap-stat__sub {
	font-size: 12px;
	color: var(--ap-muted);
	margin-top: 2px;
}

.ap-stat__sub.is-zold  { color: #22c55e; }
.ap-stat__sub.is-sarga { color: #f59e0b; }
.ap-stat__sub.is-piros { color: #ef4444; }
.ap-stat__sub.is-szurke { color: var(--ap-muted); }

/* ---- Üres állapot (admin) ----------------------------------------------- */

.ap-empty {
	max-width: 1280px;
	margin: 24px auto;
	padding: 24px 32px;
	background: #fff7e6;
	border: 1px solid #ffb84d;
	border-radius: 12px;
	color: #7a4b00;
	font-size: 14px;
}

/* ---- Reszponzivitás ----------------------------------------------------- */

@media (max-width: 768px) {
	.ap-card {
		padding: 24px;
	}
	.ap-card__title {
		font-size: 26px;
	}
	.ap-card__percent {
		font-size: 38px;
	}
	.ap-card__head {
		margin-bottom: 20px;
	}
}

@media (max-width: 560px) {
	.ap-card__main {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	.ap-card__percent {
		align-self: flex-end;
		font-size: 34px;
	}
	.ap-card__stats {
		grid-template-columns: 1fr;
		gap: 10px;
	}
	.ap-stat {
		padding: 14px;
	}
}

/* ---- Reduced motion ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.ap-card[data-ap-state="keszulesben"] .ap-badge__dot {
		animation: none;
	}
	.ap-card__bar-fill {
		transition: none;
	}
}
