/* ==========================================================================
   Community Vote system — premium dark theme
   Loaded only on the Community Vote and Vote History page templates.
   ========================================================================== */

.ktp-vote-page {
	background: #0a0e1f;
	padding: 24px 16px 48px;
}

.ktp-vote-app,
.ktp-history-app {
	max-width: 1180px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
	color: #e8eaf6;
	font-family: var(--ktp-font-body, inherit);
}

/* ---------- Hero header ---------- */
.ktp-vote-hero {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	background: #0d1226;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 14px;
	padding: 18px 24px;
}

.ktp-vote-hero__brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ktp-vote-hero__icon {
	font-size: 2.2rem;
	filter: drop-shadow(0 0 8px rgba(255, 64, 129, 0.5));
}

.ktp-vote-hero__title h1 {
	margin: 0;
	font-size: 1.4rem;
	font-weight: 800;
	color: #fff;
	letter-spacing: 0.5px;
}

.ktp-vote-hero__title h1 span {
	color: #ffb300;
}

.ktp-vote-hero__title p {
	margin: 2px 0 0;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 1px;
	color: #ffb300;
}

.ktp-vote-hero__stats {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	font-size: 0.85rem;
	color: #9aa0c3;
}

.ktp-vote-hero__stats-label {
	font-weight: 700;
	color: #cfd3ec;
}

.ktp-vote-hero__stats-value {
	font-size: 1.5rem;
	font-weight: 800;
	color: #4dd0e1;
}

.ktp-vote-hero__updated {
	color: #7c82a8;
}

/* ---------- Shared panel shell ---------- */
.ktp-panel {
	background: #0d1226;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 14px;
	padding: 22px 24px;
}

.ktp-panel__title {
	text-align: center;
	font-size: 1.05rem;
	font-weight: 800;
	letter-spacing: 0.5px;
	margin: 0 0 6px;
	color: #ffb300;
}

.ktp-panel__title--band {
	background: linear-gradient(90deg, #6a11cb, #d6247a);
	color: #fff;
	padding: 10px 20px;
	border-radius: 999px;
	display: block;
	width: fit-content;
	margin: 0 auto 20px;
}

.ktp-panel__subtitle {
	text-align: center;
	color: #9aa0c3;
	margin: 0 0 20px;
	font-size: 0.9rem;
}

/* ---------- Cast your vote ---------- */
.ktp-already-voted {
	text-align: center;
	background: rgba(255, 179, 0, 0.12);
	border: 1px solid rgba(255, 179, 0, 0.35);
	color: #ffd166;
	font-weight: 700;
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 20px;
}

.ktp-vote-grids {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.ktp-vote-col__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-weight: 800;
	font-size: 1rem;
	margin-bottom: 4px;
}

.ktp-vote-col__head--fr { color: #ff4d8d; }
.ktp-vote-col__head--sr { color: #4dd0ff; }

.ktp-vote-col__time {
	font-size: 0.8rem;
	font-weight: 600;
	color: #9aa0c3;
}

.ktp-vote-col__label {
	font-size: 0.8rem;
	color: #9aa0c3;
	margin: 0 0 10px;
}

.ktp-search {
	position: relative;
	margin-bottom: 12px;
}

.ktp-search input {
	width: 100%;
	background: #141a33;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	color: #e8eaf6;
	padding: 10px 36px 10px 12px;
	font-size: 0.9rem;
}

.ktp-search input:focus {
	outline: none;
	border-color: #6a11cb;
}

.ktp-search span {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.6;
}

.ktp-grid {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	gap: 6px;
	max-height: 320px;
	overflow-y: auto;
	padding-right: 2px;
}

.ktp-grid__btn {
	background: #141a33;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #cfd3ec;
	border-radius: 6px;
	padding: 8px 0;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.ktp-grid__btn:hover {
	background: #1d2444;
	transform: translateY(-1px);
}

.ktp-grid__btn.is-selected {
	background: linear-gradient(135deg, #ff4d8d, #6a11cb);
	color: #fff;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.ktp-grid[data-round="sr"] .ktp-grid__btn.is-selected {
	background: linear-gradient(135deg, #4dd0ff, #1565c0);
}

.ktp-grid__btn.is-hidden {
	display: none;
}

.ktp-vote-submit {
	text-align: center;
	margin-top: 22px;
}

.ktp-btn-submit {
	background: linear-gradient(135deg, #ff2d95, #7b2ff7);
	color: #fff;
	border: none;
	font-weight: 800;
	font-size: 0.95rem;
	letter-spacing: 0.5px;
	padding: 14px 40px;
	border-radius: 999px;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(123, 47, 247, 0.45);
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.ktp-btn-submit--small {
	padding: 10px 22px;
	font-size: 0.85rem;
}

.ktp-btn-submit:hover:not(:disabled) {
	transform: translateY(-2px);
}

.ktp-btn-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	box-shadow: none;
}

.ktp-vote-note {
	margin: 12px 0 0;
	font-size: 0.8rem;
	color: #7c82a8;
}

.ktp-vote-feedback {
	min-height: 1.2em;
	margin: 8px 0 0;
	font-weight: 700;
}

.ktp-vote-feedback.is-success { color: #4caf50; }
.ktp-vote-feedback.is-error { color: #ff5252; }

/* ---------- Live results ---------- */
.ktp-results-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.ktp-results-col h3 {
	font-size: 0.95rem;
	font-weight: 800;
	margin: 0 0 14px;
}

.ktp-results-col--fr h3 { color: #ff4d8d; }
.ktp-results-col--sr h3 { color: #4dd0ff; }

.ktp-bar-row {
	display: grid;
	grid-template-columns: 26px 34px 1fr 90px;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
	font-size: 0.85rem;
}

.ktp-bar-row__rank {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #ffb300;
	color: #1e1240;
	font-weight: 800;
	font-size: 0.72rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ktp-bar-row__number {
	font-weight: 800;
	color: #fff;
}

.ktp-bar-row__track {
	background: #141a33;
	border-radius: 999px;
	height: 10px;
	overflow: hidden;
}

.ktp-bar-row__fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, #ff2d95, #ff8a65);
	transition: width 0.4s ease;
}

.ktp-results-col--sr .ktp-bar-row__fill {
	background: linear-gradient(90deg, #29b6f6, #4dd0ff);
}

.ktp-bar-row__meta {
	text-align: right;
	color: #9aa0c3;
	white-space: nowrap;
}

.ktp-btn-outline {
	display: block;
	width: 100%;
	text-align: center;
	background: transparent;
	border: 1px solid #ff4d8d;
	color: #ff4d8d;
	font-weight: 700;
	font-size: 0.8rem;
	padding: 10px 14px;
	border-radius: 999px;
	cursor: pointer;
	margin-top: 12px;
	transition: background 0.15s ease, color 0.15s ease;
}

.ktp-btn-outline--sr {
	border-color: #4dd0ff;
	color: #4dd0ff;
}

.ktp-btn-outline:hover {
	background: #ff4d8d;
	color: #fff;
}

.ktp-btn-outline--sr:hover {
	background: #4dd0ff;
	color: #071019;
}

/* ---------- Two-column layout (top numbers / official, accuracy / history) ---------- */
.ktp-two-col {
	display: grid;
	grid-template-columns: 1fr 1.2fr;
	gap: 20px;
	align-items: start;
}

/* ---------- Top numbers medals ---------- */
.ktp-top-cols {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.ktp-top-cols__head {
	text-align: center;
	font-size: 0.85rem;
	font-weight: 800;
	margin: 0 0 12px;
}

.ktp-top-cols__head--fr { color: #ff4d8d; }
.ktp-top-cols__head--sr { color: #4dd0ff; }

.ktp-medals {
	display: flex;
	justify-content: center;
	gap: 10px;
}

.ktp-medal {
	text-align: center;
	font-size: 0.72rem;
	color: #9aa0c3;
}

.ktp-medal__badge {
	width: 54px;
	height: 54px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 1rem;
	color: #fff;
	margin: 0 auto 6px;
	border: 2px solid rgba(255, 255, 255, 0.25);
}

.ktp-medal:nth-child(1) .ktp-medal__badge { background: linear-gradient(135deg, #ffd54f, #ff9100); }
.ktp-medal:nth-child(2) .ktp-medal__badge { background: linear-gradient(135deg, #cfd8dc, #90a4ae); }
.ktp-medal:nth-child(3) .ktp-medal__badge { background: linear-gradient(135deg, #ff8a65, #d84315); }

.ktp-medal__votes { display: block; }

/* ---------- Official results ---------- */
.ktp-official-block { margin-bottom: 18px; }
.ktp-official-block:last-child { margin-bottom: 0; }

.ktp-official-block__head {
	font-size: 0.9rem;
	font-weight: 800;
	margin: 0 0 10px;
}

.ktp-official-block__head--pink { color: #ff4d8d; }
.ktp-official-block__head--blue { color: #4dd0ff; }

.ktp-official-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.ktp-official-card {
	background: #141a33;
	border-radius: 10px;
	padding: 14px;
	text-align: center;
}

.ktp-official-card__label {
	display: block;
	font-size: 0.75rem;
	color: #9aa0c3;
	margin-bottom: 6px;
}

.ktp-official-card__value {
	display: block;
	font-size: 1.8rem;
	font-weight: 800;
	color: #fff;
}

.ktp-official-card__status {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.7rem;
	font-weight: 700;
	color: #4caf50;
}

/* ---------- Accuracy ---------- */
.ktp-accuracy__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ktp-accuracy__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #141a33;
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 0.85rem;
}

.ktp-accuracy__row strong { color: #fff; }

.ktp-accuracy__badge {
	font-weight: 800;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
}

.ktp-accuracy__badge--correct { background: rgba(76, 175, 80, 0.18); color: #4caf50; }
.ktp-accuracy__badge--missed { background: rgba(255, 82, 82, 0.18); color: #ff5252; }

.ktp-accuracy__overall {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed rgba(255, 255, 255, 0.12);
	font-weight: 800;
}

.ktp-accuracy__overall strong { color: #ffb300; font-size: 1.2rem; }

/* ---------- History table (shared by vote page strip + history page) ---------- */
.ktp-table-responsive { overflow-x: auto; }

.ktp-history-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.82rem;
}

.ktp-history-table th,
.ktp-history-table td {
	padding: 9px 10px;
	text-align: center;
	white-space: nowrap;
}

.ktp-history-table thead th {
	background: #141a33;
	color: #ffb300;
	font-weight: 700;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ktp-history-table tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.ktp-history-table tbody td { color: #cfd3ec; }
.ktp-history-table tbody td:first-child { color: #fff; font-weight: 700; }

.ktp-history-empty { color: #7c82a8 !important; padding: 24px !important; }

.ktp-past-results__more {
	text-align: center;
	margin: 16px 0 0;
}

.ktp-past-results__more a {
	color: #4dd0ff;
	font-weight: 700;
	text-decoration: none;
}

.ktp-past-results__more a:hover { text-decoration: underline; }

.ktp-vote-disclaimer {
	text-align: center;
	color: #5b6089;
	font-size: 0.78rem;
	margin: 4px 0 0;
}

/* ---------- Vote History page specifics ---------- */
.ktp-history-filters__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	justify-content: center;
}

.ktp-history-filters__row label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.8rem;
	color: #9aa0c3;
}

.ktp-history-filters__row select {
	background: #141a33;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #e8eaf6;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 0.9rem;
}

.ktp-history-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.ktp-history-card {
	background: #0d1226;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	padding: 16px 18px;
	text-align: center;
}

.ktp-history-card__label {
	display: block;
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #9aa0c3;
	margin-bottom: 8px;
}

.ktp-history-card__value {
	display: block;
	font-size: 1.6rem;
	font-weight: 800;
	color: #ffb300;
}

.ktp-history-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.ktp-search--history { max-width: 320px; flex: 1 1 240px; margin-bottom: 0; }

.ktp-history-toolbar__actions {
	display: flex;
	gap: 10px;
}

.ktp-history-toolbar__actions .ktp-btn-outline {
	width: auto;
	margin-top: 0;
	padding: 8px 16px;
}

.ktp-history-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.ktp-history-pagination button {
	background: #141a33;
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #cfd3ec;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.82rem;
}

.ktp-history-pagination button.is-active {
	background: linear-gradient(135deg, #ff2d95, #7b2ff7);
	color: #fff;
	border-color: transparent;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
	.ktp-vote-grids,
	.ktp-results-grid,
	.ktp-two-col,
	.ktp-top-cols,
	.ktp-official-cards,
	.ktp-history-cards {
		grid-template-columns: 1fr;
	}

	.ktp-vote-hero {
		flex-direction: column;
		align-items: flex-start;
	}

	.ktp-vote-hero__stats {
		align-items: flex-start;
	}

	.ktp-grid {
		grid-template-columns: repeat(6, 1fr);
	}

	.ktp-bar-row {
		grid-template-columns: 22px 30px 1fr 70px;
		font-size: 0.78rem;
	}
}

@media print {
	.ktp-cast-vote,
	.ktp-history-filters,
	.ktp-history-toolbar,
	.ktp-history-pagination,
	.site-header,
	.site-footer {
		display: none !important;
	}

	.ktp-vote-page {
		background: #fff;
		color: #000;
	}

	.ktp-history-table th,
	.ktp-history-table td {
		color: #000 !important;
	}
}
