/* General Styles */
:root {
	--primary-color: #2c3e50;
	--secondary-color: #3498db;
	--background-color: #ecf0f1;
	--text-color: #34495e;
	--card-background: #ffffff;
	--border-color: #dce4e8;
	--shadow-color: rgba(0, 0, 0, 0.1);
	--font-size: 16px; /* Base font size */
}

body.dark-mode {
	--primary-color: #3498db;
	--secondary-color: #2c3e50;
	--background-color: #2c3e50;
	--text-color: #ecf0f1;
	--card-background: #34495e;
	--border-color: #4a6278;
}

html {
	font-size: var(--font-size);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
		Arial, sans-serif;
	background-color: var(--background-color);
	color: var(--text-color);
	margin: 0;
	line-height: 1.6;
	transition: background-color 0.3s, color 0.3s;
}

.container {
	max-width: 900px;
	margin: 0 auto;
	padding: 20px;
}

/* Header */
.app-header {
	background-color: var(--card-background);
	box-shadow: 0 2px 4px var(--shadow-color);
	padding: 10px 0;
	border-bottom: 1px solid var(--border-color);
}

.app-header .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.logo {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--primary-color);
}

.controls {
	display: flex;
	gap: 15px;
	justify-content: flex-end;
	.control-button#home-button {
		font-size: 1.5rem; /* Adjust size as needed */
		padding: 5px 10px;
	}
	.control-button#accessibility-button {
		font-size: 1.5rem; /* Adjust size as needed */
		padding: 5px 10px;
	}
}

/* Main Content */
.screen {
	background-color: var(--card-background);
	/* background: darkslategrey; */
	padding: 40px;
	border-radius: 8px;
	box-shadow: 0 4px 8px var(--shadow-color);
	text-align: center;
}

.welcome-screen {
	margin-top: 40px;
	.btn {
		margin: 6px;
	}
}

/* Buttons */
.btn {
	display: inline-block;
	padding: 12px 25px;
	border-radius: 5px;
	border: none;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.2s, transform 0.2s;
}

.btn-primary {
	background-color: var(--primary-color);
	color: #ffffff;
}

.btn-primary:hover {
	background-color: var(--secondary-color);
	transform: translateY(-2px);
}

.choice-btn.selected {
	background-color: var(--secondary-color);
	color: #ffffff;
	transform: translateY(-2px);
	position: relative; /* Needed for pseudo-element positioning */
	border: 2px dashed #00bee9;
}

.choice-btn.selected::after {
	content: "✅"; /* Checkmark emoji */
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	font-size: 1.2em;
	line-height: 1;
	pointer-events: none; /* Ensure clicks pass through */
}

/* Progress Bar */
.progress-bar-container {
	position: fixed;
	background-color: var(--card-background);
	box-shadow: 0 -2px 5px var(--shadow-color);
	z-index: 1000;
	display: flex;
	align-items: center;
	transition: all 0.3s ease-in-out;
}

/* Default: Horizontal bar at the bottom for narrow screens */
.progress-bar-container {
	bottom: 0;
	left: 0;
	width: 100%;
	height: 22px;
	border-top: 1px solid var(--border-color);
}

.progress-bar {
	height: 10px;
	background-color: #e0e0e0;
	overflow: hidden;
	position: absolute;
}

.progress-bar-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	transition: width 0.4s ease-in-out;
}

#page-progress-bar {
	background-color: #76c7c0;
	z-index: 1;
}

#question-progress-bar {
	background-color: #4bd187;
	z-index: 2;
}

.progress-text {
	font-size: 0.9em;
	color: var(--text-color);
	line-height: initial;
	white-space: nowrap;
	position: absolute;
	z-index: 999999999999;
	left: 0;
	top: 0;
	margin: 0;
	background: var(--background-color);
	place-self: anchor-center;
	position: absolute;
}

/* Vertical bar on the left for wide screens */
@media (min-width: 768px) {
	.progress-bar-container {
		top: 0;
		left: 0;
		width: 24px;
		height: 100%;
		flex-direction: column;
		padding: 0;
		border-right: 1px solid var(--border-color);
		border-top: none;
	}

	.progress-bar {
		width: 10px;
		height: 100%;
		flex-grow: 1;
	}

	.progress-bar-fill {
		width: 100%;
		height: 0; /* Height is set by JS */
		bottom: 0;
		transition: height 0.4s ease-in-out;
	}

	.progress-text {
		writing-mode: vertical-rl;
		text-orientation: mixed;
	}

	.container {
		padding-left: 70px; /* Add padding to avoid overlap */
	}
}

/* Question Container */
.question-count-selector {
	margin: 16px 8px;
}

.question-container {
	margin-bottom: 40px;
	text-align: left;
}

.question-screen {
	margin-top: 40px;
}

.choices {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 30px;
	border-block-end: 1px dashed yellow;
	padding-bottom: 24px;
}

.choice-btn {
	padding: 8px 16px;
	font-size: 1.1rem;
	min-width: 20%;
	text-align: center;
}

.navigation-buttons {
	display: flex;
	justify-content: space-between;
	margin-top: 20px;
}

/* New Situation Card Styles */
.situation-card {
	padding: 2rem;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background: var(--card-background);
}
.unanswered-question {
	border: 2px solid #e74c3c; /* A prominent red color */
	transition: border-color 0.5s ease-out;
}

.scenario-text {
	font-size: 1.4rem;
	font-weight: 600;
	margin-bottom: 1.5rem;
}

.options-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

.options-list .choice-btn {
	width: 100%;
	text-align: left;
	padding: 1rem;
	font-size: 1.1rem;
	justify-content: flex-start;
}

/* Neutral Button and Tooltip Styles */
.neutral-option-container {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 1rem;
}

.neutral-btn {
	background-color: #7f8c8d;
	color: white;
}

.neutral-btn:hover {
	background-color: #95a5a6;
}

.tooltip {
	position: relative;
	display: inline-block;
	cursor: pointer;
}

.tooltip .tooltip-icon {
	font-size: 1.2rem;
}

.tooltip .tooltip-text {
	visibility: hidden;
	width: 220px;
	background-color: #555;
	color: #fff;
	text-align: center;
	border-radius: 6px;
	padding: 5px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	margin-left: -110px;
	opacity: 0;
	transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
	visibility: visible;
	opacity: 1;
}

.result-avatar {
	border: 4px solid var(--primary-color);
	margin-bottom: 1rem;
}

.result-title {
	margin-bottom: 1rem;
}

.result-type-main {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0;
	color: var(--primary-color);
}

.result-type-subtype {
	font-size: 1.2rem;
	font-weight: 400;
	margin: 0;
	color: var(--text-color);
	opacity: 0.8;
}

.strengths-container {
	margin-top: 2rem;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.strength-item {
	width: 100%;
}

.strength-labels,
.strength-values {
	display: flex;
	justify-content: space-between;
	font-size: 0.9rem;
	color: var(--text-color);
	margin-bottom: 0.5rem;
}

.strength-bar-container {
	display: flex;
	height: 12px;
	border-radius: 6px;
	overflow: hidden;
	background-color: var(--border-color);
}

.strength-bar {
	height: 100%;
	transition: width 0.5s ease-in-out;
}
/* Low-confidence warning */
.low-confidence-warning {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px;
	background-color: #f39c1220;
	color: #d35400;
	border-radius: 4px;
	font-size: 0.9rem;
	margin-top: 0.5rem;
}

.warning-icon {
	font-size: 1.1rem;
}

.result-header img {
	width: 100%;
	border-radius: 12px;
	margin-bottom: 10px;
}

.result-summary {
	font-size: 1.1rem;
	margin-bottom: 20px;
}

.result-actions {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 15px;
	justify-content: center;
	margin-top: 20px;
}

.detailed-report-screen .report-header {
	margin-bottom: 20px;
}

/* Detailed Report Dichotomy Percentages */
.dichotomy-row {
	display: flex;
	align-items: center;
	margin-bottom: 10px;
	flex-wrap: wrap; /* Allow wrapping on small screens */
}

.dichotomy-label {
	flex: 0 0 auto; /* Don't grow or shrink */
	width: 120px; /* Fixed width for labels */
	text-align: right;
	margin-right: 10px;
	font-weight: bold;
}

.dichotomy-bar-container {
	flex-grow: 1; /* Take up remaining space */
	height: 10px;
	background-color: var(--border-color);
	border-radius: 5px;
	overflow: hidden;
	margin: 0 10px;
}

.dichotomy-bar {
	height: 100%;
	background-color: var(--primary-color);
	border-radius: 5px;
	transition: width 0.5s ease-out;
}

.dichotomy-percent {
	flex: 0 0 auto;
	width: 40px; /* Fixed width for percentage text */
	text-align: left;
	font-weight: bold;
	color: var(--primary-color);
}

/* Responsive adjustments for dichotomy rows */
@media (max-width: 600px) {
	.dichotomy-row {
		flex-direction: column;
		align-items: flex-start;
	}

	.dichotomy-label {
		width: auto;
		text-align: left;
		margin-right: 0;
		margin-bottom: 5px;
	}

	.dichotomy-bar-container {
		width: 100%;
		margin: 0;
		margin-bottom: 5px;
	}

	.dichotomy-percent {
		width: 100%;
		text-align: right;
		margin-top: 5px;
	}
}

.detailed-report-screen .report-content {
	text-align: left;
}

.detailed-report-screen .report-section {
	margin-bottom: 30px;
	padding: 20px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	background-color: var(--card-background);
	box-shadow: 0 2px 5px var(--shadow-color);
	text-align: left;
}

.detailed-report-screen .report-section h3 {
	color: var(--primary-color);
	margin-top: 0;
	margin-bottom: 15px;
	border-bottom: 2px solid var(--secondary-color);
	padding-bottom: 5px;
}

.detailed-report-screen .report-section ul {
	list-style: none;
	padding: 0;
}

.detailed-report-screen .report-section li {
	margin-bottom: 8px;
	padding-left: 15px;
	position: relative;
}

.detailed-report-screen .report-section li::before {
	content: "•"; /* Bullet point */
	color: var(--secondary-color);
	position: absolute;
	left: 0;
}

.detailed-report-screen .report-actions {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 20px;
}

.detailed-report-screen {
	width: auto;
	margin-top: 40px;
}

/* Footer */
.history-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.history-list li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px;
	border-bottom: 1px solid var(--border-color);
}

.history-list li:last-child {
	border-bottom: none;
}

.history-list .btn-sm {
	padding: 5px 10px;
	font-size: 0.9rem;
}

.app-footer {
	text-align: center;
	padding: 20px;
	margin-top: 40px;
	font-size: 0.9rem;
	color: var(--text-color);
}

/* NoScript Warning */
.noscript-warning {
	background-color: #e74c3c;
	color: white;
	text-align: center;
	padding: 10px;
}

/* Error Boundary */
.error-boundary {
	background-color: #e74c3c;
	color: white;
	padding: 20px;
	border-radius: 8px;
	text-align: center;
}

/* Responsive Design */
@media (max-width: 600px) {
	.container {
		padding: 15px;
	}

	.screen {
		padding: 20px;
	}

	.controls {
		gap: 10px;
		max-width: 65%;
		flex-wrap: wrap;
	}
}

/* PDF Specific Styles (for improved print/PDF output) */
@media print {
	body {
		background-color: #ffffff; /* White background for print */
		color: #000000; /* Black text for print */
	}

	.app-header,
	.app-footer,
	.navigation-buttons,
	.result-actions,
	.controls {
		display: none !important; /* Hide non-essential elements for print */
	}

	.container,
	.screen {
		box-shadow: none !important; /* Remove shadows */
		padding: 0 !important; /* Remove padding */
		margin: 0 !important; /* Remove margins */
		max-width: 100% !important; /* Use full width */
	}

	.detailed-report-screen .report-section {
		border: none !important; /* Remove borders */
		box-shadow: none !important; /* Remove shadows */
		padding: 10px 0 !important; /* Adjust padding */
		margin-bottom: 15px !important; /* Adjust margin */
	}

	.detailed-report-screen .report-section h3 {
		color: #000000 !important; /* Black headings */
		border-bottom: 1px solid #ccc !important; /* Lighter border */
		padding-bottom: 5px !important;
		margin-bottom: 10px !important;
	}

	.detailed-report-screen .report-section ul,
	.detailed-report-screen .report-section p {
		font-size: 11pt; /* Smaller font size for print */
		line-height: 1.5;
	}

	.detailed-report-screen .report-section li {
		margin-bottom: 5px !important;
	}
}

/* Back to Top Button */
.back-to-top-btn {
	display: block; /* Hidden by default */
	position: fixed; /* Fixed position */
	bottom: 20px; /* 20px from bottom */
	right: 20px; /* 20px from right */
	z-index: 99; /* High z-index to be on top */
	border: none; /* Remove borders */
	outline: none; /* Remove outline */
	background-color: var(--primary-color); /* Button background */
	color: white; /* Text color */
	cursor: pointer; /* Pointer cursor on hover */
	padding: 15px; /* Some padding */
	border-radius: 50%; /* Rounded shape */
	font-size: 24px; /* Icon size */
	box-shadow: 0 4px 8px var(--shadow-color); /* Subtle shadow */
	transition: background-color 0.3s, opacity 0.3s, transform 0.3s; /* Smooth transitions */
	opacity: 0; /* Start hidden */
	transform: translateY(100px); /* Start off-screen */
}

.back-to-top-btn.show {
	opacity: 1; /* Show when 'show' class is added */
	transform: translateY(0); /* Slide into view */
}

.back-to-top-btn:hover {
	background-color: var(--secondary-color); /* Darker background on hover */
}

.noto-sans-sc-class {
	font-family: "Noto Sans SC", sans-serif;
	font-optical-sizing: auto;
	font-weight: 500;
	font-style: normal;
}

.update-content {
	text-align: center;
	padding: 8px;
}

/* Assertion Section Styles */
.assertion-container {
	margin-top: 2rem;
	width: 100%;
	position: relative;
	z-index: 0;
}

.assertion-bar-container {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 24px;
	background-color: var(--border-color);
	border-radius: 12px;
	overflow: hidden;
	padding: 4px;
}

.assertion-bar {
	height: 100%;
	background-color: var(--primary-color);
	border-radius: 8px;
	transition: width 0.5s ease-in-out;
}

.assertion-value {
	font-weight: bold;
	color: var(--text-color);
	margin-left: auto;
	padding-right: 10px;
	white-space: nowrap;
	flex-shrink: 0;
}
