/* Shared look for the redesigned teacher pages (activity list, My classes, and later the create/modify pages).
   Everything is prefixed ec- so it can't collide with Bootstrap 4 or style.css. Button colors are darker shades of
   the site's green/blue so white text meets WCAG AA (4.5:1); hover shades are darker still. */
:root {
	--ec-ink: #22232d;
	--ec-ink-2: #545a6a;
	--ec-line: #dde3ec;
	--ec-surface: #ffffff;
	--ec-surface-2: #f5f8fc;
	--ec-blue: #2a6bbf;
	--ec-blue-hover: #1f5fae;
	--ec-blue-ink: #1f5fae;
	--ec-blue-soft: #e8f1fc;
	--ec-green: #1b7f20;
	--ec-green-hover: #14621a;
	--ec-green-ink: #17701c;
	--ec-green-soft: #e7f6e8;
	--ec-red: #c9302c;
	--ec-red-hover: #a52723;
	--ec-red-soft: #fbeaea;
	--ec-focus: #1f5fae;
	--ec-radius: 10px;
	--ec-shadow: 0 1px 2px rgba(34, 35, 45, .06), 0 2px 8px rgba(34, 35, 45, .05);
}

.ec { color: var(--ec-ink); font-family: "Lato", "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.5; padding-bottom: 32px; }
.ec h1, .ec h2 { font-family: "Rubik", "Lato", "Segoe UI", Arial, sans-serif; color: var(--ec-ink); margin: 0; }
.ec :focus-visible, .ec-modal :focus-visible { outline: 3px solid var(--ec-focus); outline-offset: 2px; }
.ec .fa { width: 1.1em; text-align: center; }

/* a color per activity type (icon tile + type label) and per class (its icon square on My classes); every ink passes AA on its
   tint, on white and on the "just created" green */
.ec-t-1  { --t-bg: #efe9fc; --t-ink: #6a3fc1; }
.ec-t-3  { --t-bg: #e6f0fb; --t-ink: #1f5fae; }
.ec-t-9  { --t-bg: #fff0e0; --t-ink: #a84f0a; }
.ec-t-2  { --t-bg: #e2f5f3; --t-ink: #0f766e; }
.ec-t-10 { --t-bg: #e7f6e8; --t-ink: #17701c; }
.ec-t-7  { --t-bg: #fde8f1; --t-ink: #ab2c64; }
.ec-t-5  { --t-bg: #fdf3d8; --t-ink: #7d5800; }
.ec-t-6  { --t-bg: #fde8e6; --t-ink: #b0362b; }
.ec-t-4, .ec-t-8 { --t-bg: #eef0f4; --t-ink: #545a6a; }
.ec-c-0 { --c: #2a6bbf; } .ec-c-1 { --c: #6a3fc1; } .ec-c-2 { --c: #0f766e; }
.ec-c-3 { --c: #a84f0a; } .ec-c-4 { --c: #ab2c64; } .ec-c-5 { --c: #1b7f20; }
.ec-c-6 { --c: #7d5800; } .ec-c-7 { --c: #b0362b; }

/* buttons */
.ec-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 8px;
	font: 700 15px/1 "Lato", "Segoe UI", Arial, sans-serif; border: 1px solid var(--ec-line); background: var(--ec-surface);
	color: var(--ec-ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ec-btn:hover, .ec-btn:focus { background: var(--ec-surface-2); color: var(--ec-ink); text-decoration: none; }
.ec-btn--primary { background: var(--ec-blue); border-color: var(--ec-blue); color: #fff; }
.ec-btn--primary:hover, .ec-btn--primary:focus { background: var(--ec-blue-hover); border-color: var(--ec-blue-hover); color: #fff; }
.ec-btn--play { background: var(--ec-green); border-color: var(--ec-green); color: #fff; }
.ec-btn--play:hover, .ec-btn--play:focus { background: var(--ec-green-hover); border-color: var(--ec-green-hover); color: #fff; }
.ec-btn--danger { background: var(--ec-red); border-color: var(--ec-red); color: #fff; }
.ec-btn--danger:hover, .ec-btn--danger:focus { background: var(--ec-red-hover); border-color: var(--ec-red-hover); color: #fff; }
.ec-btn--quiet { border-color: transparent; background: transparent; color: var(--ec-ink-2); }
.ec-btn--quiet:hover, .ec-btn--quiet:focus { background: var(--ec-surface-2); color: var(--ec-ink); }
.ec-btn--quiet-danger { border-color: transparent; background: transparent; color: var(--ec-red); }
.ec-btn--quiet-danger:hover, .ec-btn--quiet-danger:focus { background: var(--ec-red-soft); color: var(--ec-red-hover); }
.ec-push-end { margin-left: auto; }
.ec-btn--sm { min-height: 36px; padding: 6px 11px; font-size: 14px; }
.ec-btn.dropdown-toggle::after { display: none; }

/* page header */
.ec-crumbs { font-size: 14px; color: var(--ec-ink-2); margin: 8px 0 4px; }
.ec-crumbs a { color: var(--ec-blue-ink); }
.ec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin: 8px 0 20px;
	padding: 18px 22px; border-radius: 14px; background: linear-gradient(120deg, #eaf2fc 0%, #eef8ef 100%); border: 1px solid #dbe7f5; }
.ec-head .ec-crumbs { margin-top: 0; }
.ec-head h1 { font-size: 30px; font-weight: 500; line-height: 1.15; overflow-wrap: anywhere; }
.ec-head-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 8px; color: var(--ec-ink-2); font-size: 15px; }
.ec-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ec-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--ec-surface);
	border: 1px solid var(--ec-line); font-size: 14px; color: var(--ec-ink); }
.ec-chip code { font: 700 14px/1.2 Consolas, "SFMono-Regular", monospace; color: var(--ec-ink); }

/* search / filter / sort */
.ec-toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 12px; }
.ec-search { position: relative; flex: 1 1 220px; max-width: 340px; }
.ec-search .fa { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ec-ink-2); }
.ec-search input { width: 100%; min-height: 40px; padding: 8px 12px 8px 36px; border-radius: 8px; border: 1px solid var(--ec-line); font-size: 15px; color: var(--ec-ink); }
.ec-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ec-filter { min-height: 34px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--ec-line); background: var(--ec-surface);
	color: var(--ec-ink-2); font: 700 14px "Lato", sans-serif; cursor: pointer; }
.ec-filter[aria-pressed="true"] { background: var(--ec-blue-soft); border-color: var(--ec-blue); color: var(--ec-blue-ink); }
.ec-sort { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ec-ink-2); }
.ec-sort label { margin: 0; }
.ec-sort select { min-height: 36px; border-radius: 8px; border: 1px solid var(--ec-line); background: var(--ec-surface); color: var(--ec-ink); font-size: 14px; padding: 4px 8px; }
.ec-count { font-size: 14px; color: var(--ec-ink-2); margin: 0 0 10px; }

/* cards: one per activity / class */
.ec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; container-type: inline-size; }
.ec-card { background: var(--ec-surface); border: 1px solid var(--ec-line); border-radius: var(--ec-radius); box-shadow: var(--ec-shadow);
	padding: 14px 16px; display: grid; grid-template-columns: 44px minmax(12rem, 1fr) auto; gap: 4px 14px; align-items: center; }
.ec-card { transition: box-shadow .15s, transform .15s, border-color .15s; }
.ec-card:hover { transform: translateY(-1px); border-color: #cfd8e6; box-shadow: 0 2px 4px rgba(34, 35, 45, .06), 0 8px 20px rgba(34, 35, 45, .08); }
.ec-card.is-new { border-color: var(--ec-green); background: var(--ec-green-soft); box-shadow: 0 0 0 2px rgba(27, 127, 32, .3); }
.ec-type-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
	grid-row: span 2; font-size: 20px; background: var(--t-bg, var(--ec-blue-soft)); color: var(--t-ink, var(--ec-blue-ink)); }
.ec-card h2 { font-size: 18px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.ec-card h2 a { color: inherit; }
.ec-card h2 a:hover { color: var(--ec-blue-ink); }
.ec-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; color: var(--ec-ink-2); }
.ec-badge { font-weight: 700; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--t-ink, var(--ec-ink-2)); }
.ec-new-tag { font-weight: 700; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--ec-green-ink); }
.ec-actions { grid-column: 3; grid-row: 1 / span 2; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ec-card--class { grid-template-columns: 48px minmax(0, 1fr); padding: 16px 18px; gap: 6px 16px; align-items: start; }
.ec-card--class > :not(.ec-avatar) { grid-column: 2; }
.ec-avatar { grid-row: 1 / span 4; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
	background: var(--c, var(--ec-blue)); color: #fff; font-size: 22px; }
.ec-card--class h2 { font-size: 20px; font-weight: 500; }
.ec-card--class .ec-preview { margin: 0; font-size: 14px; color: var(--ec-ink-2); max-width: 70ch; }
.ec-card--class .ec-actions { grid-row: auto; justify-content: flex-start; margin-top: 6px; }
@container (max-width: 700px) {
	.ec-card { grid-template-columns: 44px minmax(0, 1fr); }
	.ec-actions, .ec-card--class .ec-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; margin-top: 8px; }
	.ec-avatar { grid-row: 1 / span 3; }
}
@media (max-width: 575px) { .ec-sort { margin-left: 0; } }

/* More menu (Bootstrap dropdown) */
.ec .dropdown-menu { min-width: 230px; padding: 6px; border-color: var(--ec-line); border-radius: var(--ec-radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.ec .dropdown-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 10px; border-radius: 6px; font-size: 15px; color: var(--ec-ink); }
.ec .dropdown-item:hover, .ec .dropdown-item:focus { background: var(--ec-surface-2); color: var(--ec-ink); }
.ec .dropdown-item.ec-danger { color: var(--ec-red); }
.ec .dropdown-divider { margin: 6px 4px; border-color: var(--ec-line); }

/* empty state + activity-type tiles (also in the New activity dialog) */
.ec-empty { border: 1px dashed var(--ec-line); border-radius: var(--ec-radius); padding: 28px 20px; }
.ec-empty h2 { font-size: 22px; font-weight: 500; margin-bottom: 6px; }
.ec-empty p { color: var(--ec-ink-2); margin: 0 0 18px; max-width: 60ch; }
.ec-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ec-tile { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 12px; align-content: start; padding: 12px;
	border: 1px solid var(--ec-line); border-radius: var(--ec-radius); background: var(--ec-surface-2); }
.ec-tile .ec-type-icon { width: 40px; height: 40px; font-size: 18px; }
.ec-tile { transition: border-color .15s, background-color .15s; }
.ec-tile:hover { border-color: var(--t-ink, var(--ec-line)); background: var(--ec-surface); }
.ec-tile b { font-size: 15px; }
.ec-tile span { font-size: 13px; color: var(--ec-ink-2); }
.ec-tile-links { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 6px; font-size: 14px; }
.ec-tile-links a:not(.ec-btn) { color: var(--ec-blue-ink); }
.ec-tile-links .ec-btn { min-height: 32px; padding: 5px 10px; font-size: 14px; }

/* dialogs (Bootstrap modal) */
.ec-modal { color: var(--ec-ink); font-family: "Lato", "Segoe UI", Arial, sans-serif; }
.ec-modal .modal-content { border-radius: 12px; border-color: var(--ec-line); }
.ec-modal .modal-title { font-family: "Rubik", "Lato", sans-serif; font-weight: 500; }
.ec-modal .modal-body p { color: var(--ec-ink-2); margin: 0; }
.ec-modal .modal-footer { border-top: 0; gap: 8px; }
.ec-modal .modal-footer > * { margin: 0; }

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

/* the ad column html_header()/html_footer() add to teacher pages (showsAdColumn()): beside the content on wide
   screens, below it on narrower ones; the reserved height keeps the page from jumping when the ad loads */
.page-ad { padding-top: 20px; border-top: 1px solid var(--ec-line); margin-top: 20px; text-align: center; }
.page-ad-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ec-ink-2); margin-bottom: 6px; }
.page-ad-note { font-size: 13px; color: var(--ec-ink-2); margin: 8px 0 0; }
@media (min-width: 1200px) {
	.page-main { flex: 1 1 0; max-width: none; min-width: 0; }
	.page-ad { flex: 0 0 330px; max-width: 330px; position: sticky; top: 90px; align-self: flex-start; border-top: 0; margin-top: 0; padding-top: 8px; text-align: left; }
	.page-ad .adsbygoogle { min-height: 600px; }
}
@media (prefers-reduced-motion: reduce) { .ec * { transition: none !important; } }
.ec-tile .ec-btn--primary { background: var(--t-ink, var(--ec-blue)); border-color: var(--t-ink, var(--ec-blue)); }
.ec-tile .ec-btn--primary:hover, .ec-tile .ec-btn--primary:focus { filter: brightness(.85); }

/* class color picker (classColorPicker() on the create/edit class forms) */
.ec-swatches { border: 0; padding: 0; margin: 0 0 20px; }
.ec-swatches legend { font-size: inherit; font-weight: 700; margin-bottom: 8px; width: auto; }
.ec-swatches small { display: block; color: var(--ec-ink-2); margin-top: 6px; }
.ec-swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ec-swatch { position: relative; margin: 0; cursor: pointer; }
.ec-swatch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ec-swatch-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--c); color: #fff;
	font-size: 16px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; transition: box-shadow .15s; }
.ec-swatch-dot .fa { visibility: hidden; }
.ec-swatch input:checked + .ec-swatch-dot { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.ec-swatch input:checked + .ec-swatch-dot .fa { visibility: visible; }
.ec-swatch input:focus-visible + .ec-swatch-dot { outline: 3px solid var(--ec-focus); outline-offset: 5px; }
