/**
 * PokePolis Vote — pp-vote.css
 * Style dla widgetu "Trzymać czy Otwierać?" i rankingu setów
 *
 * Paleta PokePolis:
 *   --pp-red:    #E3350D  (główny akcent)
 *   --pp-gold:   #FFD700  (żółty/gold)
 *   --pp-dark:   #1A1A2E  (tło ciemne)
 *   --pp-card:   #16213E  (tło kart)
 *   --pp-border: #0F3460  (obramowania)
 *   --pp-text:   #E0E0E0
 *   --pp-muted:  #8892A4
 *
 * @package PokePolis_Engine
 */

/* ==========================================================================
   WIDGET GŁOSOWANIA
   ========================================================================== */

.pp-vote {
	background: #16213E;
	border: 1px solid #0F3460;
	border-radius: 12px;
	padding: 24px;
	max-width: 480px;
	margin: 24px 0;
	font-family: inherit;
	position: relative;
	transition: opacity 0.2s;
}

.pp-vote.is-loading {
	opacity: 0.7;
	pointer-events: none;
}

/* --- Nagłówek --- */

.pp-vote__header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.pp-vote__icon {
	font-size: 22px;
	line-height: 1;
}

.pp-vote__title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #E0E0E0;
	letter-spacing: 0.01em;
}

/* --- Werdykt --- */

.pp-vote__verdict {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: 14px;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.05);
}

.pp-vote__verdict-emoji {
	font-size: 18px;
	line-height: 1;
}

.pp-vote__verdict-label {
	color: #E0E0E0;
}

.pp-vote__verdict.verdict--hold {
	background: rgba(34, 197, 94, 0.12);
	border-left: 3px solid #22c55e;
}

.pp-vote__verdict.verdict--hold .pp-vote__verdict-label {
	color: #4ade80;
}

.pp-vote__verdict.verdict--open {
	background: rgba(239, 68, 68, 0.12);
	border-left: 3px solid #ef4444;
}

.pp-vote__verdict.verdict--open .pp-vote__verdict-label {
	color: #f87171;
}

.pp-vote__verdict.verdict--neutral {
	background: rgba(148, 163, 184, 0.1);
	border-left: 3px solid #94a3b8;
}

.pp-vote__verdict.verdict--neutral .pp-vote__verdict-label {
	color: #cbd5e1;
}

.pp-vote__verdict.verdict--pending {
	background: rgba(251, 191, 36, 0.08);
	border-left: 3px solid #fbbf24;
}

.pp-vote__verdict.verdict--pending .pp-vote__verdict-label {
	color: #fcd34d;
}

/* --- Przyciski głosowania --- */

.pp-vote__buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 16px;
}

.pp-vote__btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 14px 10px;
	border: 2px solid #0F3460;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.03);
	color: #8892A4;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.18s ease;
	line-height: 1.2;
}

.pp-vote__btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.07);
	color: #E0E0E0;
	transform: translateY(-1px);
}

.pp-vote__btn:active:not(:disabled) {
	transform: translateY(0);
}

.pp-vote__btn:disabled {
	cursor: not-allowed;
}

.pp-vote__btn-icon {
	font-size: 22px;
	line-height: 1;
}

.pp-vote__btn-label {
	font-size: 13px;
}

.pp-vote__btn-pct {
	font-size: 18px;
	font-weight: 800;
	color: #E0E0E0;
	letter-spacing: -0.02em;
}

/* Aktywny stan — Trzymać */
.pp-vote__btn--hold.is-active {
	border-color: #22c55e;
	background: rgba(34, 197, 94, 0.1);
	color: #4ade80;
}

.pp-vote__btn--hold.is-active .pp-vote__btn-pct {
	color: #4ade80;
}

/* Aktywny stan — Otwierać */
.pp-vote__btn--open.is-active {
	border-color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
	color: #f87171;
}

.pp-vote__btn--open.is-active .pp-vote__btn-pct {
	color: #f87171;
}

/* Hover kolorowy gdy nie jest aktywny */
.pp-vote__btn--hold:not(.is-active):hover:not(:disabled) {
	border-color: rgba(34, 197, 94, 0.4);
}

.pp-vote__btn--open:not(.is-active):hover:not(:disabled) {
	border-color: rgba(239, 68, 68, 0.4);
}

/* --- Pasek podziału --- */

.pp-vote__bar {
	display: flex;
	height: 8px;
	border-radius: 4px;
	overflow: hidden;
	background: #0F3460;
	margin-bottom: 12px;
	gap: 1px;
}

.pp-vote__bar-fill {
	height: 100%;
	transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 0;
}

.pp-vote__bar-fill--hold {
	background: #22c55e;
	border-radius: 4px 0 0 4px;
}

.pp-vote__bar-fill--open {
	background: #ef4444;
	border-radius: 0 4px 4px 0;
}

/* --- Meta / liczba głosów --- */

.pp-vote__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 20px;
}

.pp-vote__count {
	font-size: 13px;
	color: #8892A4;
}

.pp-vote__change-hint {
	font-size: 11px;
	color: #4a5568;
	font-style: italic;
}

/* --- Feedback --- */

.pp-vote__feedback {
	min-height: 20px;
	margin-top: 10px;
	font-size: 13px;
	text-align: center;
	border-radius: 6px;
	transition: all 0.2s;
}

.pp-vote__feedback:not(:empty) {
	padding: 6px 12px;
}

.pp-vote__feedback--success {
	color: #4ade80;
	background: rgba(34, 197, 94, 0.08);
}

.pp-vote__feedback--error {
	color: #f87171;
	background: rgba(239, 68, 68, 0.08);
}

/* --- Responsive --- */

@media ( max-width: 480px ) {
	.pp-vote {
		padding: 16px;
	}

	.pp-vote__btn-icon {
		font-size: 18px;
	}

	.pp-vote__btn-pct {
		font-size: 15px;
	}
}


/* ==========================================================================
   RANKING SETÓW
   ========================================================================== */

.pp-ranking {
	margin: 32px 0;
}

.pp-ranking__header {
	margin-bottom: 20px;
}

.pp-ranking__title {
	font-size: 22px;
	font-weight: 800;
	color: #E0E0E0;
	margin: 0 0 6px;
}

.pp-ranking__desc {
	font-size: 14px;
	color: #8892A4;
	margin: 0;
}

/* --- Tabela --- */

.pp-ranking__table-wrap {
	overflow-x: auto;
	border-radius: 10px;
	border: 1px solid #0F3460;
}

.pp-ranking__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #16213E;
}

.pp-ranking__table thead th {
	padding: 12px 16px;
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	color: #8892A4;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-bottom: 1px solid #0F3460;
	background: #1A1A2E;
	white-space: nowrap;
}

.pp-ranking__row {
	border-bottom: 1px solid rgba(15, 52, 96, 0.5);
	transition: background 0.15s;
}

.pp-ranking__row:last-child {
	border-bottom: none;
}

.pp-ranking__row:hover {
	background: rgba(255, 255, 255, 0.03);
}

.pp-ranking__col {
	padding: 12px 16px;
	vertical-align: middle;
	color: #E0E0E0;
}

.pp-ranking__col--pos {
	width: 48px;
	text-align: center;
}

.pp-ranking__pos {
	font-weight: 700;
	font-size: 16px;
}

.pp-ranking__col--name {
	min-width: 180px;
}

.pp-ranking__set-link {
	color: #E0E0E0;
	text-decoration: none;
	font-weight: 600;
	display: block;
	margin-bottom: 6px;
}

.pp-ranking__set-link:hover {
	color: #FFD700;
}

/* Mini pasek w kolumnie nazwy */
.pp-ranking__mini-bar {
	display: flex;
	height: 4px;
	border-radius: 2px;
	overflow: hidden;
	background: #0F3460;
	gap: 1px;
	max-width: 160px;
}

.pp-ranking__mini-fill {
	height: 100%;
}

.pp-ranking__mini-fill--hold {
	background: #22c55e;
}

.pp-ranking__mini-fill--open {
	background: #ef4444;
}

.pp-ranking__col--hold strong {
	color: #4ade80;
}

.pp-ranking__col--open strong {
	color: #f87171;
}

.pp-ranking__col--votes {
	color: #8892A4;
	white-space: nowrap;
}

/* Werdykt w tabeli */
.pp-ranking__verdict {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 13px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 20px;
	white-space: nowrap;
}

.pp-ranking__verdict.verdict--hold {
	background: rgba(34, 197, 94, 0.12);
	color: #4ade80;
}

.pp-ranking__verdict.verdict--open {
	background: rgba(239, 68, 68, 0.12);
	color: #f87171;
}

.pp-ranking__verdict.verdict--neutral {
	background: rgba(148, 163, 184, 0.1);
	color: #94a3b8;
}

.pp-ranking__verdict.verdict--pending {
	background: rgba(251, 191, 36, 0.08);
	color: #fcd34d;
}

/* Kolorowanie wierszy wg werdyktu */
.pp-ranking__row.verdict--hold {
	border-left: 3px solid rgba(34, 197, 94, 0.3);
}

.pp-ranking__row.verdict--open {
	border-left: 3px solid rgba(239, 68, 68, 0.3);
}

/* Przypis */
.pp-ranking__footnote {
	margin-top: 14px;
	font-size: 12px;
	color: #4a5568;
	text-align: right;
}

.pp-ranking__empty {
	color: #8892A4;
	font-style: italic;
	text-align: center;
	padding: 32px;
}

/* --- Responsive tabela --- */

@media ( max-width: 640px ) {
	.pp-ranking__col--hold,
	.pp-ranking__col--open {
		display: none;
	}
}
