/**
 * Frontend styles for This or That Polls
 *
 * Responsive design for poll display with Canva iframe and vote form.
 */

/* Main poll container */
.tot-poll-container {
	max-width: 100%;
	margin: 2rem auto;
	position: relative;
}

/* Canva iframe wrapper */
.tot-canva-wrapper {
	position: relative;
	width: 100%;
	min-height: 600px;
	background: #f5f5f5;
	border-radius: 8px;
}

/* Override Canva's inline styles that create white bar */
.tot-canva-wrapper > div {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.tot-canva-wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 8px;
}

/* Form overlay - positioned over iframe at bottom center */
.tot-form-overlay {
	position: absolute;
	bottom: 3rem;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	padding: 1.5rem;
	margin: 0;
	text-align: center;
	z-index: 100;
	width: 90%;
	max-width: 550px;
	pointer-events: auto;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Vote form */
.tot-vote-form {
	margin-bottom: 0;
}

.tot-choice-buttons {
	display: flex;
	flex-direction: column;
	gap: 0.875rem;
	width: 100%;
}

/* Choice buttons - off-white/gray background, stacked vertically */
.tot-choice-btn {
	width: 100%;
	padding: 1.25rem 1.75rem;
	font-size: 1.25rem;
	font-weight: 600;
	background: #e8e8e8;
	color: #fff;
	border: 3px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: none;
}

/* Hover state - only active before voting */
.tot-choice-btn:not(:disabled):hover {
	background: #5b9dd9;
	border-color: #5b9dd9;
}

/* Selected state (user's choice) - blue with white text */
.tot-choice-btn.selected {
	background: #5b9dd9;
	border-color: #5b9dd9;
	color: #fff;
}

/* Disabled state after voting */
.tot-choice-btn:disabled {
	cursor: default;
	opacity: 1;
}

/* Non-selected button after voting stays gray */
.tot-choice-btn:disabled:not(.selected) {
	background: #e8e8e8;
	color: #fff;
}

/* Selected button after voting stays blue */
.tot-choice-btn.selected:disabled {
	background: #5b9dd9;
	border-color: #5b9dd9;
	color: #fff;
}

/* Percentage display on buttons */
.tot-choice-percentage {
	font-weight: 700;
	font-size: 1.5rem;
	margin-left: auto;
	padding-left: 1rem;
	color: #fff;
}

/* Vote info - shown after voting */
.tot-vote-info {
	text-align: center;
	color: #666;
	font-size: 0.875rem;
	padding: 0;
	background: transparent;
}

.tot-total-votes {
	font-weight: 600;
	color: #333;
}

/* Results message (replaces already voted) */
.tot-results-message {
	text-align: center;
	color: #666;
	font-size: 0.875rem;
	padding: 1rem 0 0.5rem;
	background: transparent;
	margin-top: 0;
}

.tot-results-message p {
	margin: 0;
	font-weight: 500;
	color: #666;
}

.tot-results-message .tot-total-votes {
	font-weight: 600;
	color: #333;
}

/* Hide already voted (we show results on buttons instead) */
.tot-already-voted {
	display: none;
}

/* Loading indicator - positioned over iframe */
.tot-loading {
	position: absolute;
	bottom: 3rem;
	left: 50%;
	transform: translateX(-50%);
	background: #fff;
	color: #333;
	padding: 1.5rem 2rem;
	border-radius: 12px;
	text-align: center;
	z-index: 150;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	pointer-events: auto;
}

.tot-loading p {
	margin: 0;
	color: #333;
	font-size: 1rem;
	font-weight: 500;
}

/* Error message */
.tot-error {
	background: #f8d7da;
	color: #721c24;
	padding: 1rem;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	margin: 1rem 0;
}

/* Responsive design */
@media screen and (max-width: 1024px) {
	.tot-canva-wrapper {
		min-height: 550px;
	}

	.tot-form-overlay {
		max-width: 500px;
		padding: 1.25rem;
	}

	.tot-choice-btn {
		padding: 1.125rem 1.5rem;
		font-size: 1.125rem;
	}

	.tot-choice-percentage {
		font-size: 1.375rem;
	}
}

@media screen and (max-width: 768px) {
	.tot-canva-wrapper {
		min-height: 450px;
	}

	.tot-form-overlay {
		bottom: 2rem;
		width: 92%;
		max-width: 450px;
		padding: 1.25rem;
	}

	.tot-choice-btn {
		padding: 1rem 1.25rem;
		font-size: 1rem;
	}

	.tot-choice-percentage {
		font-size: 1.25rem;
	}

	.tot-results-message {
		font-size: 0.8rem;
		padding: 0.875rem 0 0.5rem;
	}
}

@media screen and (max-width: 480px) {
	.tot-canva-wrapper {
		min-height: 350px;
	}

	.tot-form-overlay {
		bottom: 1.5rem;
		width: 95%;
		max-width: 100%;
		padding: 1rem;
	}

	.tot-choice-btn {
		padding: 0.875rem 1.125rem;
		font-size: 0.95rem;
	}

	.tot-choice-percentage {
		font-size: 1.125rem;
	}

	.tot-results-message {
		font-size: 0.75rem;
	}
}
