/**
 * PollCraft — front-end styles.
 *
 * Colors come from inline CSS variables set per-poll by the renderer:
 *   --pc-bg, --pc-heading, --pc-text, --pc-accent
 * Layout/shape comes from the preset modifier class:
 *   .pollcraft--rounded  or  .pollcraft--flat
 *
 * SECTIONS
 *   1. Container
 *   2. Title
 *   3. Voting options (buttons)
 *   4. Results (progress bars)
 *   5. Notice (already-voted message)
 *   6. Confirmation screen (email-campaign flow)
 *   7. Presets (Rounded / Flat)
 */

/* ============================================
   1. CONTAINER
   ============================================ */
.pollcraft {
	background: var(--pc-bg, #ffffff);
	color: var(--pc-text, #333333);
	border: 1px solid rgba(0, 0, 0, 0.1);
	padding: 24px;
	max-width: 500px;
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1.5;
}

.pollcraft * {
	box-sizing: border-box;
}

/* ============================================
   2. TITLE
   ============================================ */
.pollcraft__title {
	margin: 0 0 18px;
	color: var(--pc-heading, #1a1a1a);
	font-size: 1.25em;
	line-height: 1.3;
}

/* ============================================
   3. VOTING OPTIONS (buttons)
   ============================================ */
.pollcraft__options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pollcraft__option {
	display: block;
	width: 100%;
	text-align: left;
	padding: 12px 16px;
	background: transparent;
	color: var(--pc-text, #333333);
	border: 2px solid var(--pc-accent, #888888);
	cursor: pointer;
	font-size: 1em;
	font-family: inherit;
	transition: background-color 0.15s ease, transform 0.05s ease;
}

.pollcraft__option:hover {
	background: var(--pc-accent, #888888);
	color: #fff;
}

.pollcraft__option:active {
	transform: scale(0.99);
}

.pollcraft__option:focus-visible {
	outline: 2px solid var(--pc-accent, #888888);
	outline-offset: 2px;
}

/* ============================================
   4. RESULTS (progress bars)
   ============================================ */
.pollcraft__results {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pollcraft__result {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--pc-accent, #888888);
	background: transparent;
	transition: opacity 0.3s ease;
	opacity: 0.5;
}

.pollcraft__result-bar {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	background: var(--pc-accent, #888888);
	opacity: 0.25;
	transition: width 0.5s ease;
}

.pollcraft__result-content {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	color: var(--pc-text, #333333);
}

.pollcraft__result-percent {
	font-variant-numeric: tabular-nums;
}

/* Chosen answer stands out; the others fade back */
.pollcraft__results .pollcraft__result.is-choice {
	opacity: 1;
	border-width: 2px;
	font-weight: 600;
}

.pollcraft__results .pollcraft__result:not(.is-choice) {
	opacity: 0.5;
}

.pollcraft__total {
	margin: 18px 0 0;
	font-size: 0.85em;
	opacity: 0.75;
	color: var(--pc-text, #333333);
}

/* ============================================
   5. NOTICE (already-voted message)
   ============================================ */
.pollcraft__notice {
	background: rgba(80, 70, 246, 0.08);
	border-left: 3px solid var(--pc-accent, #475569);
	padding: 10px 14px;
	border-radius: 6px;
	margin: 0 0 16px;
	font-size: 0.95em;
	color: var(--pc-text, #333);
}

/* ============================================
   6. CONFIRMATION SCREEN (email-campaign flow)
   ============================================ */
.pollcraft__confirm {
	text-align: center;
}

.pollcraft__confirm-text {
	margin: 0 0 16px;
	font-size: 1.1em;
	color: var(--pc-text, #333);
}

.pollcraft__confirm-btn {
	display: inline-block;
	width: auto;
	margin-top: 4px;
	padding: 12px 28px;
	background: var(--pc-accent, #475569);
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1em;
}

.pollcraft__change-wrap {
	margin: 14px 0 0;
}

.pollcraft__change-link {
	font-size: 0.9em;
	color: var(--pc-text-muted, #888);
	text-decoration: underline;
	cursor: pointer;
}

.pollcraft__change-link:hover {
	color: var(--pc-accent, #475569);
}

/* Confirm-mode layout: centered title, hide vote count */
.pollcraft--confirm {
	text-align: center;
}

.pollcraft--confirm .pollcraft__title {
	text-align: center;
}

.pollcraft--confirm .pollcraft__total {
	display: none;
}

/* ============================================
   7. PRESETS
   ============================================ */

/* Rounded / Soft */
.pollcraft--rounded {
	border-radius: 14px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.pollcraft--rounded .pollcraft__option {
	border-radius: 10px;
}

.pollcraft--rounded .pollcraft__result {
	border-radius: 10px;
}

/* Flat / Minimal */
.pollcraft--flat {
	border-radius: 0;
	box-shadow: none;
}

.pollcraft--flat .pollcraft__option {
	border-radius: 0;
	border-width: 1px;
}

.pollcraft--flat .pollcraft__result {
	border-radius: 0;
}