/* ==========================================================================
   Enquete News – Public Stylesheet
   ========================================================================== */

/* ---- Reset / container -------------------------------------------------- */
.enquete-contest,
.enquete-results {
	font-family: inherit;
	max-width: 900px;
	margin: 2rem auto;
	color: #1e1e1e;
}

/* ---- Title --------------------------------------------------------------- */
.enquete-title {
	font-size: 1.75rem;
	font-weight: 700;
	margin-bottom: 0.5rem;
}

/* ---- Description --------------------------------------------------------- */
.enquete-description {
	margin-bottom: 1rem;
	color: #444;
}

/* ---- Deadline ------------------------------------------------------------ */
.enquete-deadline {
	font-size: 0.9rem;
	color: #555;
	margin-bottom: 0.75rem;
}

/* ---- Remaining votes info ------------------------------------------------ */
.enquete-votes-remaining {
	font-size: 0.9rem;
	background: #eaf4ff;
	border-left: 4px solid #2271b1;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	margin-bottom: 1rem;
}

/* ---- Notices ------------------------------------------------------------- */
.enquete-notice {
	padding: 0.75rem 1rem;
	border-radius: 4px;
	margin-bottom: 1rem;
	font-size: 0.95rem;
}

.enquete-notice--info {
	background: #fff8e1;
	border-left: 4px solid #f0ad00;
	color: #6b4c00;
}

.enquete-notice--closed {
	background: #f0f4ff;
	border-left: 4px solid #2271b1;
	color: #1a3a5c;
}

.enquete-notice--error {
	background: #fef2f2;
	border-left: 4px solid #dc2626;
	color: #7f1d1d;
}

/* ---- Candidates grid ----------------------------------------------------- */
.enquete-candidates {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
	margin-top: 1.25rem;
}

/* ---- Candidate card ------------------------------------------------------ */
.enquete-candidate {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.enquete-candidate:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* ---- Video / thumbnail --------------------------------------------------- */
.enquete-video,
.enquete-thumbnail {
	background: #000;
	line-height: 0;
}

.enquete-video iframe,
.enquete-video video,
.enquete-video__player {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	display: block;
	border: none;
}

.enquete-thumbnail img,
.enquete-video--small iframe,
.enquete-video--small video {
	width: 100%;
	height: auto;
	display: block;
}

/* ---- Candidate name ------------------------------------------------------ */
.enquete-candidate__name {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0.75rem 1rem 0.25rem;
}

/* ---- Candidate bio ------------------------------------------------------- */
.enquete-candidate__bio {
	font-size: 0.9rem;
	color: #555;
	margin: 0 1rem 0.5rem;
}

/* ---- Vote area ----------------------------------------------------------- */
.enquete-vote-area {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	margin-top: auto;
	border-top: 1px solid #eee;
}

/* ---- Vote count label ---------------------------------------------------- */
.enquete-vote-count {
	font-size: 0.9rem;
	color: #666;
	min-width: 60px;
}

/* ---- Vote button --------------------------------------------------------- */
.enquete-btn--vote {
	cursor: pointer;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 0.9rem 2.4rem;
	font-size: 1.15rem;
	font-weight: 700;
	transition: background 0.15s ease, opacity 0.15s ease;
	white-space: nowrap;
}

.enquete-btn--vote:hover:not(:disabled) {
	background: #135e96;
}

.enquete-btn--vote:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.enquete-btn--vote.enquete-btn--voted {
	background: #00a32a;
}

/* ---- Inline feedback message --------------------------------------------- */
.enquete-feedback {
	display: none;
	font-size: 0.85rem;
	padding: 0.35rem 1rem 0.5rem;
}

.enquete-feedback--success {
	color: #006600;
}

.enquete-feedback--error {
	color: #cc0000;
}

/* ==========================================================================
   Results view
   ========================================================================== */

.enquete-total-votes {
	font-size: 0.9rem;
	color: #555;
	margin-bottom: 1rem;
}

.enquete-results__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.enquete-results__item {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 0.75rem 1rem;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.enquete-results__item--winner {
	border-color: #f0ad00;
	background: #fffdf0;
}

.enquete-results__rank {
	font-size: 1.3rem;
	font-weight: 700;
	color: #888;
	min-width: 2rem;
	text-align: center;
}

.enquete-results__item--winner .enquete-results__rank {
	color: #f0ad00;
}

/* Small video/thumbnail in results */
.enquete-video--small,
.enquete-thumbnail--small {
	flex-shrink: 0;
	width: 100px;
	border-radius: 4px;
	overflow: hidden;
}

.enquete-video--small iframe,
.enquete-thumbnail--small img {
	width: 100%;
	height: 60px;
	object-fit: cover;
	display: block;
}

.enquete-results__info {
	flex: 1;
	min-width: 0;
}

.enquete-results__name {
	display: block;
	font-size: 1rem;
	margin-bottom: 0.3rem;
}

/* ---- Progress bar -------------------------------------------------------- */
.enquete-results__bar-wrap {
	background: #e8e8e8;
	border-radius: 20px;
	height: 8px;
	width: 100%;
	margin-bottom: 0.3rem;
	overflow: hidden;
}

.enquete-results__bar {
	height: 100%;
	background: #2271b1;
	border-radius: 20px;
	transition: width 0.6s ease;
	min-width: 2px;
}

.enquete-results__item--winner .enquete-results__bar {
	background: #f0ad00;
}

.enquete-results__votes {
	font-size: 0.82rem;
	color: #666;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
	.enquete-candidates {
		grid-template-columns: 1fr;
	}

	.enquete-results__item {
		flex-wrap: wrap;
	}

	.enquete-video--small,
	.enquete-thumbnail--small {
		width: 80px;
	}
}

/* ==========================================================================
   Voting Player Layout  (.enquete-player-layout)
   ========================================================================== */

/* Outer card — flex column: [meta?] → stage → footer */
.enquete-player-layout {
	max-width: 1050px;
	margin: 2rem auto;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #d9d9d9;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
	background: #fff;
}

/* Optional meta bar above the stage (description + deadline) */
.enquete-player-meta {
	padding: 0.75rem 1.25rem;
	background: #f7f7f7;
	border-bottom: 1px solid #e4e4e4;
	font-size: 0.88rem;
	color: #555;
}

.enquete-player-meta .enquete-description {
	margin: 0 0 0.35rem;
}

.enquete-player-meta .enquete-deadline {
	margin: 0;
	font-size: 0.82rem;
	color: #888;
}

/* ---- Stage: video (left) + candidate list (right) ----------------------- */

.enquete-stage {
	display: flex;
	flex-direction: row;
	align-items: stretch;
}

.enquete-stage__video {
	flex: 1 1 0;
	min-width: 0;
	background: #000;
}

/* 16:9 aspect-ratio wrapper */
.enquete-main-player__video-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	background: #111;
	overflow: hidden;
}

.enquete-main-player__video-wrap .enquete-video__iframe,
.enquete-main-player__video-wrap .enquete-video__player {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* No-video placeholder */
.enquete-video-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1a1a1a;
}

.enquete-video-placeholder__icon {
	font-size: 3.5rem;
	color: rgba(255, 255, 255, 0.3);
}

/* ---- Candidate list (right sidebar) ------------------------------------- */

.enquete-candidate-list {
	flex: 0 0 270px;
	overflow-y: auto;
	border-left: 1px solid #e0e0e0;
	background: #fafafa;
	/* Height matches the 16:9 video at default container width ~780px = 438px */
	max-height: 500px;
}

.enquete-candidate-list__header {
	padding: 0.65rem 1rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #999;
	border-bottom: 1px solid #e4e4e4;
	background: #f2f2f2;
	position: sticky;
	top: 0;
	z-index: 1;
}

.enquete-sidebar-item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.55rem 0.75rem;
	cursor: pointer;
	border-left: 3px solid transparent;
	border-bottom: 1px solid #eee;
	transition: background 0.12s, border-color 0.12s;
	outline: none;
	position: relative;
}

.enquete-sidebar-item:last-child {
	border-bottom: none;
}

.enquete-sidebar-item:hover {
	background: #f0f4fa;
}

.enquete-sidebar-item:focus-visible {
	box-shadow: inset 0 0 0 2px #2271b1;
}

.enquete-sidebar-item.is-active {
	background: #eef4ff;
	border-left-color: #2271b1;
}

.enquete-sidebar-item__thumb {
	width: 72px;
	height: 52px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	background: #ccc;
}

.enquete-sidebar-item__thumb--placeholder {
	width: 72px;
	height: 52px;
	flex-shrink: 0;
	background: #2a2a2a;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2rem;
	color: rgba(255, 255, 255, 0.5);
}

.enquete-sidebar-item__info {
	flex: 1;
	min-width: 0;
}

.enquete-sidebar-item__name {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.35;
	color: #1e1e1e;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.enquete-sidebar-item__votes {
	display: block;
	font-size: 0.73rem;
	color: #888;
	margin-top: 0.2rem;
}

/* Playing indicator badge */
.enquete-sidebar-item__badge {
	font-size: 0.7rem;
	color: #2271b1;
	flex-shrink: 0;
}

.enquete-sidebar-item:not(.is-active) .enquete-sidebar-item__badge {
	display: none;
}

/* ---- Footer bar: candidate name (left) + vote button (right) ------------ */

.enquete-player-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.9rem 1.25rem;
	background: #fff;
	border-top: 1px solid #e0e0e0;
	flex-wrap: wrap;
}

.enquete-player-footer__info {
	flex: 1;
	min-width: 0;
}

.enquete-main-player__name {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 0.15rem;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #111;
}

.enquete-main-player__votes {
	font-size: 0.82rem;
	color: #777;
}

.enquete-player-footer__actions {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.enquete-votes-remaining {
	font-size: 0.82rem;
	color: #555;
}

/* ---- Vote button -------------------------------------------------------- */

.enquete-btn--vote {
	background: #2271b1;
	color: #fff;
	border: none;
	padding: 0.9rem 2.4rem;
	font-size: 1.15rem;
	font-weight: 700;
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.18s, transform 0.1s;
	letter-spacing: 0.02em;
}

.enquete-btn--vote:hover:not(:disabled) {
	background: #135e96;
	transform: translateY(-1px);
}

.enquete-btn--vote:active:not(:disabled) {
	transform: translateY(0);
}

.enquete-btn--vote:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.enquete-btn--voted {
	background: #1a7a1a !important;
}

/* ---- Feedback message --------------------------------------------------- */

.enquete-feedback {
	font-size: 0.85rem;
	padding: 0.35rem 0.75rem;
	border-radius: 4px;
	flex-basis: 100%;
}

.enquete-feedback--success {
	background: #e6f4ea;
	color: #1a7a1a;
	border: 1px solid #a8d5b0;
}

.enquete-feedback--error {
	background: #fce8e8;
	color: #c0392b;
	border: 1px solid #f5b7b1;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 700px) {
	.enquete-stage {
		flex-direction: column;
	}

	.enquete-candidate-list {
		flex: 0 0 auto;
		width: 100%;
		max-height: 260px;
		border-left: none;
		border-top: 1px solid #e0e0e0;
	}

	.enquete-sidebar-item__thumb,
	.enquete-sidebar-item__thumb--placeholder {
		width: 60px;
		height: 44px;
	}

	.enquete-player-footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.enquete-player-footer__actions {
		width: 100%;
		justify-content: flex-end;
	}
}
