/* ExamCore LMS — front-end (exam player + student dashboard) */

.ecx,
.ecx-panel {
	--ecx-header: #7b1e2b;
	--ecx-header-text: #ffffff;
	--ecx-accent: #1f8a70;
	--ecx-ink: #16202b;
	--ecx-muted: #7a8794;
	--ecx-line: #e3e8ed;
	--ecx-split: 52%;
	--ecx-font-scale: 1;
	color: var(--ecx-ink);
	font-size: 16px;
	line-height: 1.6;
	box-sizing: border-box;
}
.ecx *,
.ecx-panel * { box-sizing: border-box; }

.ecx-notice {
	border: 1px solid #e3e8ed;
	border-left: 4px solid #7b1e2b;
	background: #fff;
	border-radius: 10px;
	padding: 16px 18px;
	font-size: 15px;
}

/* ------------------------------------------------------------------ *
 * Intro / start screen
 * ------------------------------------------------------------------ */

.ecx-intro {
	background: #fff;
	border: 1px solid var(--ecx-line);
	border-radius: 16px;
	padding: 30px;
	max-width: 720px;
	margin: 0 auto;
}
.ecx-eyebrow {
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: 11px;
	color: var(--ecx-muted);
	margin: 0 0 6px;
}
.ecx-intro h2 { margin: 0 0 16px; font-size: 26px; line-height: 1.25; }
.ecx-facts { list-style: none; display: flex; gap: 22px; padding: 0; margin: 0 0 18px; flex-wrap: wrap; }
.ecx-facts li { font-size: 13px; color: var(--ecx-muted); }
.ecx-facts strong { display: block; font-size: 18px; color: var(--ecx-ink); }
.ecx-instructions { background: #f7f9fb; border-radius: 10px; padding: 14px 16px; font-size: 14px; margin-bottom: 16px; }
.ecx-instructions p { margin: 0 0 8px; }
.ecx-toolhints { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ecx-muted); margin-bottom: 22px; }
.ecx-done-note { background: #f0f7f4; border-radius: 12px; padding: 16px 18px; }
.ecx-done-note p { margin: 0 0 8px; }

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */

.ecx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--ecx-header);
	color: #fff;
	border: 1px solid transparent;
	border-radius: 10px;
	padding: 11px 20px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.35;
	font-family: inherit;
}
.ecx-btn:hover { opacity: .93; color: #fff; }
.ecx-btn:disabled { opacity: .45; cursor: not-allowed; }
.ecx-btn--big { width: 100%; padding: 15px 24px; font-size: 17px; }
.ecx-btn--small { padding: 9px 16px; font-size: 14px; }
.ecx-btn--ghost { background: #fff; color: var(--ecx-ink); border-color: var(--ecx-line); }
.ecx-btn--ghost:hover { background: #f3f6f8; color: var(--ecx-ink); }
.ecx-btn--submit { background: var(--ecx-accent); }

/* ------------------------------------------------------------------ *
 * Player shell
 * ------------------------------------------------------------------ */

.ecx-app {
	border: 1px solid var(--ecx-line);
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	min-height: 70vh;
}

.ecx-head {
	background: var(--ecx-header);
	color: var(--ecx-header-text);
	padding: 10px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	position: sticky;
	top: 0;
	z-index: 30;
}
.ecx-head__left { display: flex; flex-direction: column; min-width: 0; }
.ecx-head__title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.ecx-head__cat { font-size: 11px; opacity: .78; }

.ecx-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ecx-tool {
	background: rgba(255,255,255,.14);
	border: 1px solid rgba(255,255,255,.22);
	color: inherit;
	border-radius: 8px;
	min-width: 38px;
	height: 34px;
	padding: 0 9px;
	font-size: 15px;
	cursor: pointer;
	line-height: 1;
	font-family: inherit;
}
.ecx-tool:hover { background: rgba(255,255,255,.26); }
.ecx-tool.is-active { background: #fff; color: var(--ecx-header); border-color: #fff; }

.ecx-timer {
	background: rgba(0,0,0,.22);
	border-radius: 8px;
	padding: 4px 12px;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-variant-numeric: tabular-nums;
	line-height: 1.15;
}
.ecx-timer__label { font-size: 9px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.ecx-timer > span:last-child { font-size: 15px; font-weight: 700; }
.ecx-timer.is-urgent { background: #c92a2a; animation: ecx-pulse 1.4s infinite; }
@keyframes ecx-pulse { 50% { opacity: .65; } }

.ecx-savestate { font-size: 11px; opacity: .8; min-width: 76px; text-align: right; }
.ecx-savestate.is-error { color: #ffd8a8; opacity: 1; }

/* ------------------------------------------------------------------ *
 * Body / split screen
 * ------------------------------------------------------------------ */

.ecx-canvaswrap { position: relative; flex: 1; display: flex; }
.ecx-body { flex: 1; display: block; min-height: 60vh; }

.ecx-body--split {
	display: grid;
	grid-template-columns: var(--ecx-split) 8px 1fr;
}
.ecx-pane { padding: 22px 24px; overflow: auto; max-height: 72vh; }
.ecx-pane--full { max-height: none; }
.ecx-pane--passage {
	background: #fdfdfc;
	font-size: calc(15px * var(--ecx-font-scale));
	border-right: 1px solid var(--ecx-line);
}
.ecx-pane--passage h3 { margin-top: 0; text-align: center; }
.ecx-pane--passage p { margin: 0 0 16px; text-align: justify; }
.ecx-pane--questions { font-size: calc(15px * var(--ecx-font-scale)); }

.ecx-divider { background: var(--ecx-line); cursor: col-resize; position: relative; }
.ecx-divider::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 3px;
	height: 34px;
	margin: -17px 0 0 -1.5px;
	border-left: 2px dotted #9aa7b3;
}
body.ecx-dragging { user-select: none; }

.ecx-tabs { display: none; }

.ecx-pagetitle {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--ecx-muted);
	margin: 0 0 16px;
	font-weight: 700;
}

.ecx-q { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid #eef1f4; }
.ecx-q:last-child { border-bottom: none; }
.ecx-q.is-target { background: #fff9db; border-radius: 10px; padding: 12px; margin: -12px -12px 22px; }
.ecx-q__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ecx-q__no { font-weight: 700; font-size: 15px; }
.ecx-q__marks { font-size: 12px; color: var(--ecx-muted); }
.ecx-q__text { margin-bottom: 12px; }
.ecx-q__text p { margin: 0 0 8px; }

.ecx-flag {
	margin-left: auto;
	background: none;
	border: 1px solid var(--ecx-line);
	border-radius: 8px;
	width: 30px;
	height: 28px;
	cursor: pointer;
	color: var(--ecx-muted);
	font-size: 13px;
	line-height: 1;
	font-family: inherit;
}
.ecx-flag.is-on { background: #fff3bf; border-color: #ffd43b; color: #a67c00; }

.ecx-answer {
	width: 100%;
	min-height: 84px;
	border: 1px solid #b9c4ce;
	border-radius: 8px;
	padding: 11px 13px;
	font: inherit;
	font-size: calc(15px * var(--ecx-font-scale));
	resize: vertical;
	background: #fff;
}
.ecx-answer:focus { outline: 2px solid var(--ecx-accent); outline-offset: 1px; border-color: transparent; }

.ecx-options { display: grid; gap: 8px; }
.ecx-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	border: 1px solid var(--ecx-line);
	border-radius: 10px;
	padding: 11px 13px;
	cursor: pointer;
	background: #fff;
}
.ecx-option:hover { border-color: #b9c4ce; }
.ecx-option.is-picked { border-color: var(--ecx-accent); background: #f2fbf8; }
.ecx-option input { margin-top: 4px; }
.ecx-option__key {
	width: 24px;
	height: 24px;
	flex: 0 0 24px;
	border-radius: 50%;
	background: #eef1f4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
}
.ecx-option.is-picked .ecx-option__key { background: var(--ecx-accent); color: #fff; }

/* Canvas overlay */
.ecx-ink {
	position: absolute;
	inset: 0;
	pointer-events: none;
	touch-action: none;
	z-index: 5;
}
.ecx-ink.is-drawing { cursor: crosshair; }

/* ------------------------------------------------------------------ *
 * Footer navigation
 * ------------------------------------------------------------------ */

.ecx-foot {
	border-top: 1px solid var(--ecx-line);
	background: #fafbfc;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	position: sticky;
	bottom: 0;
	z-index: 20;
}
.ecx-pills { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ecx-pill {
	min-width: 46px;
	height: 32px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--ecx-line);
	background: #fff;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	position: relative;
	color: var(--ecx-ink);
	font-family: inherit;
}
.ecx-pill.is-full { border-color: var(--ecx-accent); background: #eaf7f3; color: #14705c; }
.ecx-pill.is-partial { border-color: #ffd43b; background: #fff9db; color: #8a6116; }
.ecx-pill.is-none { border-style: dashed; color: var(--ecx-muted); }
.ecx-pill.is-current { outline: 2px solid var(--ecx-header); outline-offset: 1px; }
.ecx-pill--summary { font-weight: 700; }
.ecx-pageinfo { font-size: 13px; color: var(--ecx-muted); }
.ecx-nav { display: flex; gap: 8px; margin-left: auto; }

/* ------------------------------------------------------------------ *
 * Pen bar & floating panels
 * ------------------------------------------------------------------ */

.ecx-penbar {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	padding: 10px 16px;
	background: #f2f5f7;
	border-top: 1px solid var(--ecx-line);
	font-size: 12px;
}
.ecx-penbar__group { display: flex; align-items: center; gap: 7px; }
.ecx-penbar__label { color: var(--ecx-muted); }
.ecx-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ecx-line); cursor: pointer; padding: 0; }
.ecx-swatch.is-active { box-shadow: 0 0 0 2px var(--ecx-ink); }
.ecx-pensize { display: inline-block; background: var(--ecx-ink); border-radius: 50%; }
.ecx-storagebadge { margin-left: auto; color: var(--ecx-muted); }

.ecx-panelbox {
	position: fixed;
	right: 24px;
	bottom: 96px;
	z-index: 9999;
	width: 268px;
	background: #fff;
	border: 1px solid var(--ecx-line);
	border-radius: 14px;
	box-shadow: 0 14px 40px rgba(16,32,43,.22);
	padding: 12px;
}
.ecx-panelbox__head { display: flex; align-items: center; justify-content: space-between; cursor: move; margin-bottom: 9px; font-size: 13px; }
.ecx-panelbox__close { background: none; border: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ecx-muted); }
.ecx-panelbox--notes { width: 300px; }
.ecx-panelbox--notes textarea { width: 100%; min-height: 150px; border: 1px solid var(--ecx-line); border-radius: 8px; padding: 9px; font: inherit; font-size: 13px; resize: vertical; }

.ecx-calc__display {
	width: 100%;
	text-align: right;
	font-size: 24px;
	font-weight: 700;
	border: 1px solid var(--ecx-line);
	border-radius: 8px;
	padding: 9px 12px;
	background: #f7f9fb;
	margin-bottom: 9px;
	font-variant-numeric: tabular-nums;
}
.ecx-calc__keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ecx-key {
	height: 42px;
	border: 1px solid var(--ecx-line);
	border-radius: 8px;
	background: #fff;
	font-size: 15px;
	cursor: pointer;
	font-family: inherit;
	color: var(--ecx-ink);
}
.ecx-key:hover { background: #f3f6f8; }
.ecx-key.is-primary { background: var(--ecx-accent); color: #fff; border-color: transparent; }

/* ------------------------------------------------------------------ *
 * Summary & done
 * ------------------------------------------------------------------ */

.ecx-summary { padding: 28px 24px; }
.ecx-summary h3 { margin: 0 0 4px; font-size: 20px; }
.ecx-muted { color: var(--ecx-muted); }
.ecx-small { font-size: 12px; }
.ecx-sumgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; margin: 18px 0; }
.ecx-sumcell {
	border: 1px solid var(--ecx-line);
	border-radius: 10px;
	padding: 11px 8px;
	background: #fff;
	cursor: pointer;
	text-align: center;
	font-family: inherit;
	color: var(--ecx-ink);
}
.ecx-sumcell strong { display: block; font-size: 17px; }
.ecx-sumcell span { font-size: 10px; color: var(--ecx-muted); }
.ecx-sumcell.is-done { border-color: var(--ecx-accent); background: #f2fbf8; }
.ecx-sumcell.is-empty { border-style: dashed; }
.ecx-sumcell.is-flagged { box-shadow: inset 0 3px 0 #ffd43b; }
.ecx-sumcount { font-weight: 600; margin-bottom: 16px; }

.ecx-done { padding: 60px 24px; text-align: center; }
.ecx-done__icon {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--ecx-accent);
	color: #fff;
	font-size: 30px;
	line-height: 62px;
	margin: 0 auto 18px;
}
.ecx-done h2 { margin: 0 0 8px; }
.ecx-done__score { font-size: 26px; font-weight: 700; margin: 14px 0; }

/* ------------------------------------------------------------------ *
 * Student dashboard
 * ------------------------------------------------------------------ */

.ecx-panel { max-width: 860px; margin: 0 auto; }
.ecx-panel__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ecx-panel__head h2 { margin: 0; font-size: 26px; }
.ecx-logout { font-size: 13px; color: var(--ecx-muted); text-decoration: none; }
.ecx-group { margin-bottom: 26px; }
.ecx-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ecx-muted); margin: 0 0 10px; }
.ecx-examlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ecx-examcard {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: #fff;
	border: 1px solid var(--ecx-line);
	border-radius: 12px;
	padding: 15px 18px;
	flex-wrap: wrap;
}
.ecx-examcard--done { opacity: .78; }
.ecx-examcard--progress { border-left: 4px solid #ffd43b; }
.ecx-examcard strong { display: block; font-size: 16px; }
.ecx-meta { font-size: 12px; color: var(--ecx-muted); }
.ecx-examcard__action { display: flex; align-items: center; gap: 10px; }
.ecx-tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: #eef1f4; color: #5c6b7a; }
.ecx-tag--ok { background: #e6f5f0; color: #14705c; }
.ecx-score { font-weight: 700; }
.ecx-empty { color: var(--ecx-muted); }

/* ------------------------------------------------------------------ *
 * Mobile
 * ------------------------------------------------------------------ */

@media (max-width: 860px) {
	.ecx-body--split { display: block; }
	.ecx-divider { display: none; }
	.ecx-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--ecx-line); background: #f7f9fb; }
	.ecx-tab {
		flex: 1;
		padding: 12px;
		background: none;
		border: none;
		border-bottom: 3px solid transparent;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
		color: var(--ecx-muted);
		font-family: inherit;
	}
	.ecx-tab.is-active { color: var(--ecx-header); border-bottom-color: var(--ecx-header); }
	.ecx-body--split .ecx-pane { display: none; max-height: none; border-right: none; }
	.ecx-body--split .ecx-pane.is-visible { display: block; }
	.ecx-pane { padding: 18px 16px; max-height: none; }

	.ecx-head { padding: 9px 12px; }
	.ecx-head__title { max-width: 100%; font-size: 14px; }
	.ecx-savestate { display: none; }
	.ecx-panelbox { right: 10px; left: 10px; width: auto; bottom: 120px; }
	.ecx-foot { padding: 9px 10px; }
	.ecx-pill { min-width: 40px; height: 30px; padding: 0 8px; }
	.ecx-nav { width: 100%; }
	.ecx-nav .ecx-btn { flex: 1; }
	.ecx-intro { padding: 22px 18px; }
}

@media print {
	.ecx-head, .ecx-foot, .ecx-penbar, .ecx-panelbox { display: none !important; }
}
