/*
 * Political Spectrum Quiz — quiz.css
 * Clean, self-contained styles. Inherits the theme's font-family.
 * Uses a .psq- prefix on all classes to avoid conflicts with theme CSS.
 */

/* ============================================================
   CONTAINER & PANELS
   ============================================================ */
.psq-container {
	max-width: 760px;
	margin: 0 auto;
	padding: 0 16px 48px;
	font-size: 1rem;
	line-height: 1.6;
	color: inherit; /* Inherits the theme's body color */
}

.psq-panel {
	animation: psqFadeIn 0.35s ease;
}

@keyframes psqFadeIn {
	from { opacity: 0; transform: translateY( 8px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

/* ============================================================
   INTRO PANEL
   ============================================================ */
.psq-headline {
	font-size: 1.75rem;
	font-weight: 700;
	margin: 0 0 20px;
	line-height: 1.25;
}

.psq-intro-body {
	font-size: 1.05rem;
	margin-bottom: 16px;
	color: inherit;
}

.psq-no-wrong {
	font-weight: 600;
	font-size: 1.05rem;
	margin-bottom: 28px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.psq-btn {
	display: inline-block;
	padding: 14px 32px;
	border: none;
	border-radius: 6px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	font-family: inherit;
}

.psq-btn:active {
	transform: scale( 0.98 );
}

.psq-btn-primary {
	background: #2563eb;
	color: #ffffff;
}

.psq-btn-primary:hover {
	background: #1d4ed8;
}

.psq-btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 2px solid #d1d5db;
	margin-top: 32px;
}

.psq-btn-secondary:hover {
	background: #e5e7eb;
}

/* ============================================================
   QUIZ PANEL — PROGRESS
   ============================================================ */
.psq-progress-bar-wrap {
	height: 6px;
	background: #e5e7eb;
	border-radius: 3px;
	margin-bottom: 12px;
	overflow: hidden;
}

.psq-progress-bar {
	height: 100%;
	background: #2563eb;
	border-radius: 3px;
	transition: width 0.4s ease;
}

.psq-progress-text {
	font-size: 0.85rem;
	color: #6b7280;
	margin: 0 0 24px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* ============================================================
   QUIZ PANEL — QUESTION & ANSWERS
   ============================================================ */
.psq-question-text {
	font-size: 1.2rem;
	font-weight: 600;
	margin: 0 0 24px;
	line-height: 1.4;
}

.psq-answers-wrap {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.psq-answer-btn {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	width: 100%;
	padding: 16px 18px;
	background: #ffffff;
	border: 2px solid #d1d5db;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	color: inherit;
	transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.psq-answer-btn:hover:not( :disabled ) {
	border-color: #2563eb;
	background: #eff6ff;
	color: #111827; /* Explicitly set — prevents themes from overriding with white */
}

.psq-answer-btn:active:not( :disabled ) {
	transform: scale( 0.99 );
}

.psq-answer-btn:disabled {
	cursor: default;
	opacity: 0.6;
}

.psq-answer-btn.psq-answer-selected {
	border-color: #2563eb;
	background: #dbeafe;
	color: #111827; /* Same fix — lock text color explicitly */
	opacity: 1; /* Override the disabled opacity for the selected button */
}

.psq-answer-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	background: #f3f4f6;
	border-radius: 50%;
	font-weight: 700;
	font-size: 0.85rem;
	color: #374151;
	transition: background 0.15s, color 0.15s;
}

.psq-answer-btn:hover:not( :disabled ) .psq-answer-label,
.psq-answer-btn.psq-answer-selected .psq-answer-label {
	background: #2563eb;
	color: #ffffff;
}

.psq-answer-text {
	flex: 1;
}

/* ============================================================
   RESULTS — SHARED
   ============================================================ */
.psq-result-block {
	padding: 32px 0;
	border-bottom: 1px solid #e5e7eb;
}

.psq-result-block:last-child {
	border-bottom: none;
}

.psq-result-heading {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 16px;
}

/* ============================================================
   PART 1 — SCORE DISPLAY
   ============================================================ */
.psq-score-display {
	text-align: center;
	margin-bottom: 28px;
}

.psq-score-number {
	font-size: 5rem;
	font-weight: 800;
	line-height: 1;
	color: #2563eb;
}

.psq-score-label {
	font-size: 1rem;
	color: #6b7280;
	margin-top: 4px;
}

/* ============================================================
   SPECTRUM BAR (large, on results)
   ============================================================ */
.psq-spectrum-bar-wrap {
	margin-bottom: 28px;
}

.psq-spectrum-bar {
	position: relative;
	height: 14px;
	background: linear-gradient( to right, #2563eb 0%, #9ca3af 50%, #dc2626 100% );
	border-radius: 7px;
	margin-bottom: 6px;
}

.psq-spectrum-needle {
	position: absolute;
	top: 50%;
	transform: translate( -50%, -50% );
	width: 20px;
	height: 20px;
	background: #111827;
	border: 3px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba( 0,0,0,0.35 );
}

.psq-spectrum-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.78rem;
	color: #6b7280;
}

/* ============================================================
   CATEGORY BADGE
   ============================================================ */
.psq-category-badge {
	display: inline-block;
	padding: 6px 18px;
	background: #111827;
	color: #ffffff;
	border-radius: 99px;
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 16px;
	letter-spacing: 0.02em;
}

.psq-category-desc {
	margin-bottom: 24px;
}

/* ============================================================
   LEAN SECTIONS (within Part 1)
   ============================================================ */
.psq-lean-section {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #f3f4f6;
}

.psq-lean-heading {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 8px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #374151;
}

.psq-big-picture {
	background: #f9fafb;
	padding: 20px;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	border-top: 1px solid #e5e7eb; /* override the .psq-lean-section border-top logic */
}

/* ============================================================
   PART 4 — CANDIDATE CARDS
   ============================================================ */
.psq-party-heading {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 24px 0 16px;
	padding-bottom: 8px;
	border-bottom: 3px solid;
}

.psq-party-heading.psq-dem {
	border-color: #2563eb;
	color: #1d4ed8;
}

.psq-party-heading.psq-rep {
	border-color: #dc2626;
	color: #b91c1c;
}

.psq-candidates-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 16px;
	margin-bottom: 8px;
}

.psq-candidate-card {
	border: 2px solid #e5e7eb;
	border-radius: 10px;
	padding: 20px;
	background: #ffffff;
	transition: box-shadow 0.15s;
}

.psq-candidate-card.psq-fit-good {
	border-color: #16a34a;
	background: #f0fdf4;
}

.psq-candidate-card.psq-fit-poor {
	border-color: #e5e7eb;
	opacity: 0.85;
}

.psq-candidate-header {
	margin-bottom: 14px;
}

.psq-candidate-name {
	font-weight: 700;
	font-size: 1.05rem;
	margin-bottom: 2px;
}

.psq-candidate-role {
	font-size: 0.85rem;
	color: #6b7280;
	margin-bottom: 8px;
}

.psq-fit-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 99px;
	font-size: 0.78rem;
	font-weight: 700;
	background: #f3f4f6;
	color: #374151;
}

.psq-fit-good .psq-fit-badge {
	background: #16a34a;
	color: #ffffff;
}

/* ============================================================
   MINI SPECTRUM BAR (on candidate cards)
   ============================================================ */
.psq-mini-bar-wrap {
	margin-bottom: 14px;
}

.psq-mini-bar {
	position: relative;
	height: 6px;
	background: linear-gradient( to right, #2563eb 0%, #9ca3af 50%, #dc2626 100% );
	border-radius: 3px;
	margin-bottom: 4px;
}

.psq-mini-needle {
	position: absolute;
	top: 50%;
	transform: translate( -50%, -50% );
	width: 12px;
	height: 12px;
	background: #111827;
	border: 2px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba( 0,0,0,0.3 );
}

.psq-mini-bar-labels {
	display: flex;
	justify-content: space-between;
	font-size: 0.72rem;
	color: #9ca3af;
}

.psq-candidate-text {
	font-size: 0.92rem;
	line-height: 1.55;
	margin: 0;
	color: inherit;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media ( max-width: 600px ) {
	.psq-headline {
		font-size: 1.4rem;
	}

	.psq-score-number {
		font-size: 4rem;
	}

	.psq-question-text {
		font-size: 1.1rem;
	}

	.psq-answer-btn {
		padding: 14px 14px;
	}

	.psq-candidates-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================================
   DARK MODE SUPPORT
   Respects the user's system preference. Override if your theme
   handles dark mode differently (e.g., via a body class).
   ============================================================ */
@media ( prefers-color-scheme: dark ) {
	.psq-answer-btn {
		background: #1f2937;
		border-color: #374151;
		color: #f9fafb;
	}

	.psq-answer-btn:hover:not( :disabled ) {
		background: #1e3a5f;
		border-color: #60a5fa;
	}

	.psq-answer-btn.psq-answer-selected {
		background: #1e3a5f;
		border-color: #60a5fa;
	}

	.psq-answer-label {
		background: #374151;
		color: #f9fafb;
	}

	.psq-candidate-card {
		background: #1f2937;
		border-color: #374151;
	}

	.psq-candidate-card.psq-fit-good {
		background: #052e16;
		border-color: #16a34a;
	}

	.psq-big-picture {
		background: #1f2937;
		border-color: #374151;
	}

	.psq-progress-bar-wrap {
		background: #374151;
	}

	.psq-btn-secondary {
		background: #374151;
		color: #f9fafb;
		border-color: #4b5563;
	}
}

/* ============================================================
   PART 5 — INFLUENCER CARDS
   ============================================================ */

/* Intro paragraph sits above the grid */
.psq-part5-intro {
	margin-bottom: 24px;
	font-style: italic;
	color: #6b7280;
	font-size: 0.95rem;
}

/* Disclaimer line at the bottom of the section */
.psq-part5-disclaimer {
	margin-top: 20px;
	font-size: 0.82rem;
	color: #9ca3af;
	font-style: italic;
	border-top: 1px solid #e5e7eb;
	padding-top: 16px;
}

/* Wrapper for score badge + closest badge sitting side by side */
.psq-influencer-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-top: 6px;
}

/* Score badge — neutral pill showing the numeric score */
.psq-influencer-score-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 99px;
	font-size: 0.78rem;
	font-weight: 700;
	background: #e5e7eb;
	color: #374151;
}

/* "Closest to You" badge — gold/teal, intentionally neutral so it
   doesn't imply left or right political endorsement */
.psq-closest-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 99px;
	font-size: 0.78rem;
	font-weight: 700;
	background: #0d9488;
	color: #ffffff;
}

/* Subtle ring on matched influencer cards */
.psq-influencer-card.psq-influencer-match {
	box-shadow: 0 0 0 2px #0d9488;
}

/*
 * Color-coded borders and backgrounds by political lean.
 * Derived from score: 0–45 blue family, 46–55 purple/neutral, 56–100 red family.
 */
.psq-influencer-card.psq-lean-far-left {
	border-color: #1d4ed8;
	background: #eff6ff;
}

.psq-influencer-card.psq-lean-left {
	border-color: #3b82f6;
	background: #f5f9ff;
}

.psq-influencer-card.psq-lean-center-left {
	border-color: #93c5fd;
	background: #f8fbff;
}

.psq-influencer-card.psq-lean-independent {
	border-color: #a78bfa;
	background: #faf8ff;
}

.psq-influencer-card.psq-lean-center-right {
	border-color: #fca5a5;
	background: #fff8f8;
}

.psq-influencer-card.psq-lean-conservative {
	border-color: #ef4444;
	background: #fff5f5;
}

.psq-influencer-card.psq-lean-far-right {
	border-color: #b91c1c;
	background: #fef2f2;
}

/* Dark mode overrides for influencer cards */
@media ( prefers-color-scheme: dark ) {
	.psq-part5-intro {
		color: #9ca3af;
	}

	.psq-part5-disclaimer {
		color: #6b7280;
		border-color: #374151;
	}

	.psq-influencer-score-badge {
		background: #374151;
		color: #f9fafb;
	}

	.psq-influencer-card.psq-lean-far-left    { background: #1e3a5f; border-color: #1d4ed8; }
	.psq-influencer-card.psq-lean-left         { background: #1e3050; border-color: #3b82f6; }
	.psq-influencer-card.psq-lean-center-left  { background: #1a2a40; border-color: #93c5fd; }
	.psq-influencer-card.psq-lean-independent  { background: #1e1a2e; border-color: #a78bfa; }
	.psq-influencer-card.psq-lean-center-right { background: #2a1a1a; border-color: #fca5a5; }
	.psq-influencer-card.psq-lean-conservative { background: #2d1515; border-color: #ef4444; }
	.psq-influencer-card.psq-lean-far-right    { background: #2a0f0f; border-color: #b91c1c; }
}
