/* =====================================================================
   Exam Bank — shared chrome (appbar, save-bar, guest notice, hub, my-results)
   Indigo theme, loaded on every /exam-bank/* page on top of each app's CSS.
   ===================================================================== */
:root {
	--eb-primary:      #4f46e5;
	--eb-primary-dim:  #4338ca;
	--eb-primary-soft: #e0e7ff;
	--eb-primary-wash: #eef2ff;
	--eb-sky-soft:     #e0f2fe;
	--eb-gold:         #fbbf24;
	--eb-gold-dim:     #b45309;
	--eb-emerald:      #059669;
	--eb-emerald-soft: #d1fae5;
	--eb-ink:          #1e293b;
	--eb-ink-soft:     #475569;
	--eb-line:         #e2e8f0;
	--eb-surface:      #f8fafc;
	--eb-surface-2:    #f1f5f9;
}

/* ── App bar ─────────────────────────────────────────── */
.eb-appbar {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.92);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid #dbeafe;
}
.eb-appbar-inner {
	max-width: 1040px; margin: 0 auto;
	display: flex; align-items: center; justify-content: space-between;
	gap: .75rem; padding: .7rem 1rem;
}
.eb-brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--eb-ink); }
.eb-brand-mark {
	width: 38px; height: 38px; border-radius: 11px;
	background: linear-gradient(135deg, var(--eb-primary), #6366f1);
	color: #fff; display: grid; place-items: center; font-size: 1.05rem;
}
.eb-brand-logo { width: 38px; height: 38px; object-fit: contain; }
.eb-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.eb-brand-text b { font-size: .98rem; font-weight: 800; }
.eb-brand-text small { font-size: .62rem; color: var(--eb-ink-soft); letter-spacing: .14em; }
.eb-appbar-actions { display: flex; align-items: center; gap: .4rem; }
.eb-appbar-link, .eb-user-chip, .eb-login-chip {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .42rem .7rem; border-radius: 999px;
	font-size: .82rem; font-weight: 600; text-decoration: none;
	border: 1px solid #cbd5e1; color: #334155;
	background: #fff; transition: all .15s;
}
.eb-appbar-link:hover { border-color: var(--eb-primary); color: var(--eb-primary); }
.eb-appbar-link span { display: none; }
@media (min-width: 560px){ .eb-appbar-link span { display: inline; } }
.eb-user-chip { background: var(--eb-primary-wash); border-color: #c7d2fe; color: var(--eb-primary-dim); }
.eb-login-chip { background: var(--eb-primary); border-color: transparent; color: #fff; }
.eb-login-chip:hover { background: var(--eb-primary-dim); }

/* ── Save bar (shown on result/summary stage) ────────── */
.eb-savebar {
	display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem;
	margin: 1rem 0; padding: .85rem 1.1rem; border-radius: 14px;
	font-size: .9rem; font-weight: 600;
	background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe;
}
.eb-savebar.eb-saved { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.eb-savebar.eb-guest { background: linear-gradient(135deg,#f8fbff,#eef2ff); color: var(--eb-ink); border-color: #c7d2fe; justify-content: space-between; }
.eb-savebar a { color: var(--eb-primary-dim); font-weight: 700; }
.eb-savebar-btn {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .5rem .9rem; border-radius: 999px; white-space: nowrap;
	background: var(--eb-primary); color: #fff !important; text-decoration: none;
}
.eb-savebar-btn:hover { background: var(--eb-primary-dim); }

/* ── Generic shell + hub + my-results ────────────────── */
.eb-body { margin: 0; background:
	radial-gradient(circle at 16% 0%, rgba(224,242,254,.8) 0, rgba(224,242,254,0) 360px),
	linear-gradient(180deg, #f8fbff 0%, var(--eb-surface) 340px);
		font-family: 'Sarabun','Public Sans',system-ui,sans-serif; color: var(--eb-ink); }
.eb-shell { max-width: 1040px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }

.eb-hub-hero {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-end;
	gap: 1rem;
	min-height: 340px;
	margin-bottom: 1.5rem;
	padding: 2rem;
	overflow: hidden;
	border-radius: 24px;
	color: #fff;
	background: #1e1b4b;
}
.eb-hub-hero-bg,
.eb-hub-hero-overlay {
	position: absolute;
	inset: 0;
}
.eb-hub-hero-bg {
	z-index: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center right;
}
.eb-hub-hero-overlay {
	z-index: 1;
	background:
		radial-gradient(circle at 76% 12%, rgba(251,191,36,.36) 0%, rgba(251,191,36,.12) 26%, rgba(251,191,36,0) 50%),
		linear-gradient(90deg, rgba(30,27,75,.92) 0%, rgba(49,46,129,.74) 42%, rgba(67,56,202,.28) 72%, rgba(14,165,233,.04) 100%),
		linear-gradient(0deg, rgba(15,23,42,.54) 0%, rgba(15,23,42,.02) 56%);
}
.eb-hub-hero-copy {
	position: relative;
	z-index: 2;
	max-width: 640px;
	width: 100%;
	text-align: left;
}
.eb-hub-hero .eb-eyebrow {
	display: inline-flex; align-items: center; gap: .45rem;
	font-size: .82rem; font-weight: 800; letter-spacing: 0;
	background: rgba(251,191,36,.95); border: 1px solid rgba(253,230,138,.92);
	color: #451a03;
	padding: .34rem .8rem; border-radius: 999px; margin-bottom: .85rem;
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 22px rgba(120,53,15,.18);
}
.eb-hub-hero h1 {
	font-size: 2.65rem;
	line-height: 1.1;
	font-weight: 900;
	margin: .2rem 0 .7rem;
	letter-spacing: 0;
	text-wrap: balance;
	text-shadow: 0 2px 18px rgba(15,23,42,.52);
}
.eb-hero-gold {
	background: linear-gradient(95deg, #fff3c4 0%, #fbbf24 45%, #f59e0b 70%, #ffe9a8 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.eb-hub-hero p {
	font-size: 1rem;
	line-height: 1.7;
	color: rgba(239,246,255,.92);
	max-width: 38rem;
	margin: 0;
	text-shadow: 0 1px 12px rgba(15,23,42,.46);
}
.eb-hub-stats {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	gap: .55rem;
	width: 100%;
}
.eb-hub-stats > div {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .46rem .78rem;
	border-radius: 999px;
	background: rgba(255,255,255,.16);
	border: 1px solid rgba(255,255,255,.26);
	backdrop-filter: blur(10px);
}
.eb-hub-stats .n { color: #fcd34d; font-size: .78rem; font-weight: 900; line-height: 1.1; text-shadow: 0 2px 12px rgba(15,23,42,.48); }
.eb-hub-stats .l { margin-top: 0; font-size: .74rem; font-weight: 800; color: rgba(239,246,255,.9); line-height: 1.35; text-shadow: 0 1px 10px rgba(15,23,42,.42); }
.eb-hub-stats i { color: #fcd34d; font-size: .78rem; text-shadow: 0 2px 12px rgba(15,23,42,.48); }

.eb-card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 2.35rem; }
@media (min-width: 700px){ .eb-card-grid { grid-template-columns: 1fr 1fr; } }
.eb-app-card {
	display: flex; flex-direction: column; gap: .55rem;
	min-height: 100%;
	padding: 1.15rem; border-radius: 16px; text-decoration: none;
	background: rgba(255,255,255,.94); border: 1px solid #dbeafe; color: var(--eb-ink);
	transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}
.eb-app-card:hover { border-color: #a5b4fc; background: #fff; transform: translateY(-2px); }
.eb-app-ic {
	width: 46px; height: 46px; border-radius: 13px;
	display: grid; place-items: center; color: #fff; font-size: 1.2rem;
}
.eb-app-ic-grammar { background: linear-gradient(135deg,#4338ca,#6366f1); }
.eb-app-ic-translation { background: linear-gradient(135deg,#2563eb,#0ea5e9); }
.eb-app-ic-quiz { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.eb-app-ic-dashboard { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.eb-app-ic-results { background: linear-gradient(135deg,#059669,#10b981); }
.eb-app-card h3 { font-size: 1.12rem; font-weight: 800; margin: .1rem 0 0; color: #0f172a; }
.eb-app-card p { font-size: .86rem; line-height: 1.65; color: #475569; margin: 0; flex: 1; }
.eb-app-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.eb-app-chip { font-size: .72rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: #f8fbff; color: #334155; border: 1px solid #dbeafe; }
.eb-app-go { margin-top: .2rem; font-size: .88rem; font-weight: 800; color: var(--eb-primary); display: inline-flex; align-items: center; gap: .4rem; }
.eb-app-card:hover .eb-app-go { color: var(--eb-primary-dim); }

.eb-section-title {
	display: flex;
	align-items: center;
	gap: .45rem;
	font-size: 1.1rem;
	font-weight: 800;
	line-height: 1.35;
	margin: 3.25rem 0 1rem;
	color: #0f172a;
	clear: both;
}
.eb-note + .eb-section-title { margin-top: 1.5rem; }
.eb-section-title i { color: var(--eb-primary); margin-right: 0; }

/* Guest/login notice for landing pages */
.eb-note {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
	padding: .95rem 1.1rem; border-radius: 16px; margin-bottom: 1.25rem;
	background: linear-gradient(135deg,#f8fbff,#eef2ff); border: 1px solid #c7d2fe;
}
.eb-note-txt { font-size: .9rem; color: var(--eb-ink); }
.eb-note-txt b { color: var(--eb-primary-dim); }

/* My results */
.eb-result-row {
	display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem;
	background: #fff; border: 1px solid var(--eb-line); border-radius: 14px; margin-bottom: .6rem;
}
.eb-result-pct { font-size: 1.25rem; font-weight: 800; min-width: 3.4rem; text-align: center; }
.eb-result-meta { flex: 1; min-width: 0; }
.eb-result-meta .t { font-weight: 700; font-size: .95rem; }
.eb-result-meta .s { font-size: .78rem; color: var(--eb-ink-soft); }
.eb-result-grade { font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; background: var(--eb-primary-soft); color: var(--eb-primary-dim); white-space: nowrap; }
.eb-empty { text-align: center; color: var(--eb-ink-soft); padding: 3rem 1rem; }
.eb-empty i { font-size: 2.2rem; color: #cbd5e1; }

.eb-appbar-link:focus-visible,
.eb-login-chip:focus-visible,
.eb-savebar-btn:focus-visible,
.eb-app-card:focus-visible {
	outline: 3px solid rgba(99,102,241,.28);
	outline-offset: 3px;
}

@media (max-width: 860px) {
	.eb-hub-hero {
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-end;
	}

	.eb-hub-stats {
		width: 100%;
	}
}

@media (max-width: 640px) {
	.eb-appbar-inner {
		padding: .62rem .85rem;
	}

	.eb-brand-mark {
		width: 34px;
		height: 34px;
		border-radius: 10px;
	}

	.eb-shell {
		padding: .9rem .8rem 3rem;
	}

	.eb-hub-hero {
		min-height: 430px;
		padding: 1.1rem;
		border-radius: 18px;
	}

	.eb-hub-hero-bg {
		object-position: center right;
	}

	.eb-hub-hero-overlay {
		background:
			radial-gradient(circle at 74% 8%, rgba(251,191,36,.34) 0%, rgba(251,191,36,.1) 30%, rgba(251,191,36,0) 54%),
			linear-gradient(90deg, rgba(30,27,75,.92) 0%, rgba(49,46,129,.7) 56%, rgba(67,56,202,.22) 100%),
			linear-gradient(0deg, rgba(15,23,42,.64) 0%, rgba(15,23,42,.08) 58%);
	}

	.eb-hub-hero h1 {
		font-size: 2rem;
	}

	.eb-hub-hero p {
		font-size: .92rem;
		line-height: 1.65;
	}

	.eb-hub-stats {
		display: flex;
		gap: .45rem;
	}

	.eb-hub-stats > div {
		padding: .44rem .65rem;
		border-radius: 999px;
	}

	.eb-hub-stats .n {
		font-size: .78rem;
	}

	.eb-hub-stats .l {
		font-size: .68rem;
	}

	.eb-note {
		align-items: flex-start;
	}

	.eb-savebar-btn {
		width: 100%;
		justify-content: center;
	}
}
