/* Sandbox Tutor shared styles for the public pages: tokens, nav, page header, footer and the components every page reuses.
   One accent (teal) on brand navy; Poppins throughout; Material Icons Round for glyphs.
   The sandboxes and manager pages still use sandbox.css. */
:root {
  --navy: #0f1b35;
  --navy-2: #1a3a6e;
  --sky: #64b5f6;
  --teal: #0891b2;
  --teal-ink: #0e7490;
  --teal-tint: #e6f5f9;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #1b2333;
  --muted: #5b6678;
  --line: #e2e7ee;
  --on-dark: #ffffff;
  --on-dark-muted: #b9c6dc;
  color-scheme: light;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --fs-title: clamp(1.625rem, 2.8vw, 2.375rem);
  --fs-h2: 1.1875rem;
  --fs-h3: 1.0625rem;
  --fs-body: 0.9375rem;
  --fs-small: 0.84375rem;
  --fs-label: 0.6875rem;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1280px;
  --nav-h: 64px;
  --shadow: 0 1px 2px rgba(15, 27, 53, .05), 0 8px 24px rgba(15, 27, 53, .06);
}

/* Base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: var(--fs-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
.mi { font-family: "Material Icons Round"; font-weight: normal; font-style: normal; line-height: 1; display: inline-block; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; user-select: none; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.wrap-narrow { max-width: 880px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Nav: identical on every page */
.top { background: linear-gradient(135deg, var(--navy) 0%, #162950 60%, var(--navy-2) 100%); color: var(--on-dark); position: relative; z-index: 20; }
.nav { display: flex; align-items: center; gap: 28px; min-height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.125rem; text-decoration: none; }
.brand .mi { font-size: 24px; }
.brand span:last-child { color: var(--sky); }
.nav-links { display: flex; align-items: center; gap: 24px; margin-left: auto; font-size: var(--fs-small); font-weight: 500; }
.nav-links a { position: relative; display: flex; align-items: center; white-space: nowrap; min-height: var(--nav-h); text-decoration: none; color: var(--on-dark-muted); }
.nav-links a:hover { color: #fff; }
/* Current page: white text with a teal bar on the bottom edge of the nav */
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); }
/* Manager Login: filled teal so it stands out against the navy */
.nav-links a.nav-btn { min-height: 38px; padding: 0 18px; margin-left: 4px; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 600; transition: background .15s; }
.nav-links a.nav-btn:hover { background: var(--teal-ink); }
.nav-links a.nav-btn[aria-current="page"] { background: var(--teal-ink); }
.nav-links a.nav-btn[aria-current="page"]::after { display: none; }
.menu-btn { display: none; flex: none; width: 44px; height: 44px; margin-left: auto; border: 0; border-radius: 10px; background: transparent; color: var(--on-dark); cursor: pointer; place-items: center; }
.menu-btn .mi { font-size: 26px; }
.menu-btn:hover { background: rgba(255,255,255,.08); }
@media (max-width: 960px) {
  .nav { position: relative; }
  .menu-btn { display: grid; }
  .nav-links { display: none; position: absolute; top: 100%; left: -16px; right: -16px; flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px 16px 16px; background: var(--navy); box-shadow: 0 16px 32px rgba(0,0,0,.3); font-size: 1rem; }
  .nav.open .nav-links { display: flex; }
  .nav-links a { min-height: 48px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-links a[aria-current="page"]::after { top: 12px; bottom: 12px; left: -16px; right: auto; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
  .nav-links a.nav-btn { justify-content: center; min-height: 44px; margin: 12px 0 0; border-bottom: 0; }
}

/* Page header: white band with the icon and title centred; no subheading */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head .wrap { display: flex; align-items: center; justify-content: center; gap: 16px; padding-block: 36px; }
.head-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; }
.head-icon .mi { font-size: 28px; }
.page-head h1 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.015em; }
.page-head p { color: var(--muted); margin-top: 2px; max-width: 70ch; }
.page-body { padding-block: 40px 72px; }
@media (max-width: 600px) { .page-head .wrap { padding-block: 24px; } .head-icon { width: 44px; height: 44px; } .head-icon .mi { font-size: 24px; } .page-body { padding-block: 28px 48px; } }

/* Section labels and numbered steps */
.group-label { font-size: 0.875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #fff; font-weight: 700; font-size: var(--fs-small); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font: 600 var(--fs-small)/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn .mi { font-size: 18px; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-ink); }
.btn-outline { border-color: var(--teal); color: var(--teal-ink); background: var(--surface); }
.btn-outline:hover { background: var(--teal-tint); }
.icon-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-tint); color: var(--teal-ink); border: 1px solid rgba(8, 145, 178, .25); cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.icon-btn .mi { font-size: 18px; }
.icon-btn:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (max-width: 600px) { .btn { min-height: 44px; } .icon-btn { width: 44px; height: 44px; } }

/* Course / lesson link row: name, description, round arrow button */
.course-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.course-link:last-child { border-bottom: 1px solid var(--line); }
.course-link strong { display: block; font-weight: 600; }
.course-link small { display: block; color: var(--muted); font-size: var(--fs-small); line-height: 1.45; margin-top: 1px; }
.course-link .go { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--teal-tint); color: var(--teal-ink); border: 1px solid rgba(8, 145, 178, .25); transition: background .15s, color .15s, border-color .15s; }
.course-link:hover strong { color: var(--teal-ink); }
.course-link:hover .go { background: var(--teal); border-color: var(--teal); color: #fff; }
@media (max-width: 600px) { .course-link { min-height: 56px; } }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c, var(--teal)); }
.card-icon .mi { font-size: 21px; }
.card h3 { font-size: var(--fs-h3); font-weight: 600; }
.card > p { color: var(--muted); font-size: var(--fs-small); line-height: 1.5; }

/* Tabs: underline style, shared by FAQ and Data Sources */
.tab-list { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 0; background: none; color: var(--muted); font: 600 var(--fs-small)/1 var(--font); cursor: pointer; white-space: nowrap; }
.tab .mi { font-size: 19px; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--teal-ink); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--teal); }

/* Accordion (details/summary) */
.accordion { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--line); }
.accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 14px 20px; font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "expand_more"; font-family: "Material Icons Round"; font-feature-settings: "liga"; font-size: 24px; font-weight: normal; color: var(--teal-ink); transition: transform .2s; flex: none; }
.accordion details[open] summary::after { transform: rotate(180deg); }
.accordion summary:hover { color: var(--teal-ink); }
.answer { padding: 0 20px 20px; color: #374151; display: flex; flex-direction: column; gap: 12px; max-width: 76ch; }
.answer h4 { font-size: var(--fs-body); font-weight: 600; color: var(--ink); margin-top: 4px; }
.answer ul { list-style: disc; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.answer a { color: var(--teal-ink); font-weight: 500; }

/* Toast: confirmation bar at the bottom of the screen */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--navy); color: #fff;
  font-size: var(--fs-small); font-weight: 500; box-shadow: 0 12px 32px rgba(15, 27, 53, .3);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast .mi { font-size: 20px; color: #5fd0e6; }
.toast-error { border-radius: var(--radius-sm); }
.toast-error .mi { color: #ffb4a8; }
.toast code { flex-basis: 100%; color: #fff; background: rgba(255,255,255,.12); border: 0; user-select: all; }

/* Login card: the email + code forms from includes/userlogin.php */
.verify-card { max-width: 440px; margin: 8px auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.verify-card > p { color: var(--muted); }
.verify-form { width: 100%; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-small); font-weight: 600; }
.field input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-weight: 400; font-size: var(--fs-body); color: var(--ink); background: var(--surface); }
.field input:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.field .code-input { font-size: 2rem; letter-spacing: .5rem; text-align: center; }
.verify-form .btn { min-height: 44px; font-size: var(--fs-body); }
.form-error { font-size: var(--fs-small); color: #b42318; background: #fef3f2; border-radius: var(--radius-sm); padding: 10px 14px; }
@media (max-width: 600px) { .verify-card { padding: 24px 20px; } }

/* Item lists (datasources.php, myshares.php): icon, title line, details underneath, actions on the right */
.count { font-size: 0.6875rem; font-weight: 700; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; }
.tab[aria-selected="true"] .count { color: var(--teal-ink); background: var(--teal-tint); border-color: transparent; }
.pub-empty { color: var(--muted); text-align: center; padding: 32px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pub-list { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
/* Icon, name + size on one line, description underneath, Preview and Copy link on the right */
.pub-file { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 20px; }
.pub-file + .pub-file { border-top: 1px solid var(--line); }
.pub-icon { font-size: 22px; color: var(--teal); align-self: start; padding-top: 2px; }
.pub-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pub-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; }
.pub-title strong { font-weight: 600; overflow-wrap: anywhere; }
.size { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
/* The file's full public URL, shown so it can be read or selected as well as copied */
.pub-url { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); text-decoration: none; overflow-wrap: anywhere; }
.pub-url:hover { color: var(--teal-ink); text-decoration: underline; }
.pub-desc { font-size: var(--fs-small); color: #374151; }
.pub-desc p { margin: 0; }
.pub-desc a { color: var(--teal-ink); }
.pub-actions { display: flex; gap: 8px; }
.pub-actions .icon-btn { width: 32px; height: 32px; }
@media (max-width: 760px) {
  .pub-file { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .pub-icon { display: none; }
  .pub-actions .icon-btn { width: 44px; height: 44px; }
}

/* Footer */
footer { padding-block: 24px 32px; color: var(--muted); font-size: 0.75rem; border-top: 1px solid var(--line); }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
