/* סימולטור אמירנט – front end */

.ybae-quiz {
	--ybae-accent: #6c63c7;
	--ybae-accent-soft: #eeedfa;
	--ybae-ink: #23213a;
	--ybae-muted: #6f6d85;
	--ybae-line: #e4e2f3;
	--ybae-warn: #d64545;
	--ybae-warn-soft: #fdeeee;
	--ybae-ok: #2f9e6e;
}

.ybae-hidden {
	display: none !important;
}

/* ---------- Timer bar ---------- */

.ybae-bar {
	position: relative;
	margin: 0 0 18px;
	padding: 14px 18px 12px;
	background: #fff;
	border: 1px solid var(--ybae-line);
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(35, 33, 58, 0.06);
	color: var(--ybae-ink);
	font-family: inherit;
	text-align: right;
}

.ybae-bar-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.ybae-part {
	font-weight: 700;
	font-size: 1.02em;
}

.ybae-clock-wrap {
	display: flex;
	align-items: baseline;
	gap: 8px;
	color: var(--ybae-muted);
	font-size: 0.9em;
}

.ybae-clock {
	direction: ltr;
	unicode-bidi: isolate;
	font-size: 1.6em;
	font-weight: 700;
	color: var(--ybae-ink);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.ybae-progress {
	height: 6px;
	margin: 10px 0 12px;
	background: var(--ybae-accent-soft);
	border-radius: 99px;
	overflow: hidden;
}

.ybae-progress i {
	display: block;
	height: 100%;
	width: 100%;
	margin-inline-start: auto;
	background: var(--ybae-accent);
	border-radius: inherit;
	transition: width 0.25s linear, background-color 0.3s;
}

.ybae-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ybae-step;
}

.ybae-steps li {
	counter-increment: ybae-step;
	margin: 0;
	padding: 4px 10px;
	border-radius: 99px;
	background: #f5f4fb;
	color: var(--ybae-muted);
	font-size: 0.82em;
	line-height: 1.4;
}

.ybae-steps li::before {
	content: counter(ybae-step) ". ";
}

.ybae-steps li.is-current {
	background: var(--ybae-accent);
	color: #fff;
	font-weight: 700;
}

.ybae-steps li.is-done {
	text-decoration: line-through;
	opacity: 0.7;
}

.ybae-end-part {
	appearance: none;
	border: 1px solid var(--ybae-accent);
	background: #fff;
	color: var(--ybae-accent);
	border-radius: 99px;
	padding: 6px 14px;
	font: inherit;
	font-size: 0.85em;
	font-weight: 700;
	cursor: pointer;
}

.ybae-end-part:hover,
.ybae-end-part:focus-visible {
	background: var(--ybae-accent);
	color: #fff;
}

.ybae-bar.is-untimed .ybae-progress {
	visibility: hidden;
}

.ybae-bar.is-warning {
	border-color: var(--ybae-warn);
	background: var(--ybae-warn-soft);
}

.ybae-bar.is-warning .ybae-clock {
	color: var(--ybae-warn);
	animation: ybae-pulse 1s ease-in-out infinite;
}

.ybae-bar.is-warning .ybae-progress i {
	background: var(--ybae-warn);
}

@keyframes ybae-pulse {
	50% {
		opacity: 0.45;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ybae-bar.is-warning .ybae-clock {
		animation: none;
	}
	.ybae-progress i {
		transition: none;
	}
}

.ybae-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Break screen between sections ("עמוד מנוחה") ---------- */

.ybae-quiz.ybae-resting .wpProQuiz_list,
.ybae-quiz.ybae-resting .wpProQuiz_reviewDiv,
.ybae-quiz.ybae-resting .wpProQuiz_reviewQuestion,
.ybae-quiz.ybae-resting .wpProQuiz_reviewLegend,
.ybae-quiz.ybae-resting .wpProQuiz_reviewButtons {
	display: none !important;
}

.ybae-bar.is-resting .ybae-clock-wrap,
.ybae-bar.is-resting .ybae-progress,
.ybae-bar.is-resting .ybae-end-part {
	display: none;
}

.ybae-bar.is-resting .ybae-bar-bottom {
	margin-top: 10px;
}

.ybae-rest {
	margin: 0 0 24px;
	padding: 32px 24px;
	border: 1px solid var(--ybae-line);
	border-radius: 16px;
	background: #fff;
	color: var(--ybae-ink);
	text-align: center;
	outline: none;
}

.ybae-rest-title {
	font-size: 1.45em;
	font-weight: 800;
	margin-bottom: 14px;
}

.ybae-rest-next {
	font-size: 1.1em;
}

.ybae-rest-label {
	color: var(--ybae-muted);
}

.ybae-rest-meta {
	margin-top: 4px;
	color: var(--ybae-muted);
}

.ybae-rest-hint {
	margin: 16px auto 20px;
	max-width: 420px;
	color: var(--ybae-muted);
	font-size: 0.92em;
}

.ybae-rest-go {
	min-width: 160px;
	padding: 12px 28px;
	font-size: 1.05em;
}

/* ---------- Toast ---------- */

.ybae-toast {
	position: absolute;
	top: -14px;
	inset-inline-start: 50%;
	transform: translateX(50%);
	padding: 6px 14px;
	border-radius: 99px;
	background: var(--ybae-ink);
	color: #fff;
	font-size: 0.85em;
	white-space: nowrap;
	z-index: 5;
	transition: opacity 0.4s;
}

.ybae-toast.is-out {
	opacity: 0;
}

/* ---------- Dialog ---------- */

.ybae-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(20, 19, 38, 0.55);
}

.ybae-dialog {
	width: 100%;
	max-width: 420px;
	padding: 24px 22px 20px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	color: #23213a;
	text-align: right;
}

.ybae-dialog-title {
	margin: 0 0 8px;
	font-size: 1.25em;
	line-height: 1.3;
}

.ybae-dialog-text {
	margin: 0 0 18px;
	color: #6f6d85;
}

.ybae-dialog-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-start;
}

.ybae-btn {
	appearance: none;
	border: 1px solid #d9d7ea;
	background: #fff;
	color: #23213a;
	border-radius: 10px;
	padding: 10px 16px;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.ybae-btn-primary {
	background: #6c63c7;
	border-color: #6c63c7;
	color: #fff;
}

/* ---------- Score ---------- */

.ybae-score {
	margin: 0 0 24px;
	padding: 20px;
	border: 1px solid var(--ybae-line);
	border-radius: 16px;
	background: linear-gradient(180deg, #f7f6fd 0%, #fff 70%);
	color: var(--ybae-ink);
	text-align: right;
}

.ybae-score-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--ybae-line);
}

.ybae-score-title {
	color: var(--ybae-muted);
	font-size: 0.95em;
}

.ybae-score-big {
	font-size: 3.2em;
	font-weight: 800;
	line-height: 1.05;
	color: var(--ybae-accent);
	font-variant-numeric: tabular-nums;
}

.ybae-score-big.is-empty {
	color: var(--ybae-muted);
}

.ybae-level {
	margin-top: 6px;
	font-size: 1.05em;
}

.ybae-level-label {
	color: var(--ybae-muted);
}

.ybae-level-details {
	margin-top: 2px;
	color: var(--ybae-muted);
	font-size: 0.85em;
}

.ybae-score-missing {
	margin: 4px 0 0;
	font-size: 0.85em;
	color: var(--ybae-muted);
}

.ybae-score-summary {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: var(--ybae-muted);
}

.ybae-score-summary strong {
	color: var(--ybae-ink);
	font-size: 1.15em;
}

.ybae-score-parts-title {
	margin: 14px 0 8px;
	font-weight: 700;
}

.ybae-score-parts {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ybae-score-parts li.ybae-score-row {
	margin: 0 0 14px;
	padding: 0;
}

.ybae-score-line {
	display: grid;
	grid-template-columns: minmax(150px, 1fr) 2fr auto;
	align-items: center;
	gap: 12px;
}

.ybae-qs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}

.ybae-q {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 9px;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1.5;
	cursor: pointer;
	font-variant-numeric: tabular-nums;
}

.ybae-q.is-right {
	background: #e7f6ee;
	border-color: #bfe6d1;
	color: #1d7a4f;
}

.ybae-q.is-wrong {
	background: var(--ybae-warn-soft);
	border-color: #f3c4c4;
	color: #b03030;
}

.ybae-q:hover,
.ybae-q:focus-visible {
	filter: brightness(0.95);
	outline: 2px solid var(--ybae-accent);
	outline-offset: 1px;
}

.ybae-legend {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 10px;
	color: var(--ybae-muted);
	font-size: 0.85em;
}

.ybae-legend .ybae-q {
	cursor: default;
	padding: 1px 6px;
}

/* Review list after the quiz: part headings and a clear right / wrong label on every question. */
.ybae-view-head {
	margin: 22px 0 8px;
	padding: 6px 12px;
	border-radius: 8px;
	background: var(--ybae-accent-soft);
	color: var(--ybae-accent);
	font-weight: 800;
	text-align: right;
}

.ybae-view-mark {
	display: inline-block;
	margin: 0 0 8px;
	padding: 2px 10px;
	border-radius: 99px;
	font-size: 0.85em;
	font-weight: 700;
}

.ybae-view-mark.is-right {
	background: #e7f6ee;
	color: #1d7a4f;
}

.ybae-view-mark.is-wrong {
	background: var(--ybae-warn-soft);
	color: #b03030;
}

.wpProQuiz_listItem.ybae-flash {
	box-shadow: 0 0 0 3px var(--ybae-accent);
	border-radius: 10px;
	transition: box-shadow 0.3s;
}

.ybae-score-bar {
	height: 8px;
	background: var(--ybae-accent-soft);
	border-radius: 99px;
	overflow: hidden;
}

.ybae-score-bar i {
	display: block;
	height: 100%;
	margin-inline-start: 0;
	background: var(--ybae-ok);
	border-radius: inherit;
}

.ybae-score-num {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.ybae-score-note {
	margin: 12px 0 0;
	font-size: 0.82em;
	color: var(--ybae-muted);
}

@media (max-width: 600px) {
	.ybae-bar {
		padding: 12px 14px 10px;
	}
	/* On phones the part list becomes small numbered circles (the part name is already in the title). */
	.ybae-quiz .ybae-steps li {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		padding: 0;
		line-height: 1;
	}
	.ybae-quiz .ybae-steps li::before {
		content: counter(ybae-step);
		font-size: 12px;
	}
	.ybae-quiz .ybae-steps .ybae-step-name {
		display: none;
	}
	.ybae-quiz .ybae-steps li.is-done {
		text-decoration: none;
	}
	.ybae-clock {
		font-size: 1.35em;
	}
	.ybae-score-line {
		grid-template-columns: 1fr auto;
	}
	.ybae-score-bar {
		grid-column: 1 / -1;
		order: 3;
	}
}
