/* ============================================================
   shared.css  —  Green ASC-VET Training Platform
   Used by: all index_*.html and demoing_*.html pages
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --brand: #2f7ae5;
  --brand-dark: #1f55a3;
  --bg: #fafafa;
  --fg: #222;
  --muted: #666;
  --card: #fff;
  --line: #e9eef7;
  --shell-w: 1320px;
  --content-w: 920px;
  --radius: 16px;
  --gap: 28px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

/* ── Base ──────────────────────────────────────────────────── */
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu,
    "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

p { line-height: 1.6; }
p.muted { color: var(--muted); margin: .3rem 0 1rem; }
ul { line-height: 1.6; }

h2 {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 2px 0 8px;
  font-size: 1.4rem;
}

/* ── Header / Hero ─────────────────────────────────────────── */
header {
  background: linear-gradient(120deg, #ffffff 0%, #f7f9ff 60%, #f2f6ff 100%);
  border-bottom: 1px solid var(--line);
}

.hero {
  max-width: var(--shell-w);
  margin: 0 auto;
  padding: 30px var(--gap) 36px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 32px;
  align-items: center;
}

.hero h1 {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 6px 0 8px;
  font-size: 2.1rem;
}

.subtitle { color: var(--muted); margin: 0 0 16px; }

/* ── Pill / Chips ──────────────────────────────────────────── */
.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .8rem;
  background: #f2f5ff;
  border: 1px solid #dfe7ff;
  color: var(--brand-dark);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid #dfe7ff;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: .85rem;
}

/* ── Buttons ───────────────────────────────────────────────── */
.cta-row { display: flex; gap: 12px; align-items: center; margin-top: 14px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  border: 1px solid #cfe0ff;
  background: linear-gradient(180deg, #2f7ae5, #2568c9);
  color: #fff;
  text-decoration: none;
}

.btn.secondary {
  background: #fff;
  color: var(--brand-dark);
  border: 1px solid #d9e4ff;
}

.btn:hover { text-decoration: none; filter: brightness(.98); }

/* ── Hero media (iframe / img) ─────────────────────────────── */
.hero-media {
  border-radius: 14px;
  background: #000;
  border: 1px solid #dfe7ff;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  position: relative;
}

.hero-media iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

.hero-media img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #f7f9ff;
  display: block;
}

/* ── Page layout ───────────────────────────────────────────── */
.shell {
  max-width: var(--shell-w);
  margin: 0 auto;
  padding: 24px var(--gap) 64px;
  display: grid;
  grid-template-columns: var(--content-w) 1fr;
  gap: 32px;
}

.content, .side { min-width: 0; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
}

/* ── Media frame ───────────────────────────────────────────── */
.media-frame {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Video iframe ──────────────────────────────────────────── */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ── Two-column layout ─────────────────────────────────────── */
.two-col {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

.two-col > .col { flex: 1; min-width: 0; }
.two-col .media-frame { margin: 0; }
.two-col .media-frame img { border-radius: 12px; }

/* ── Accordion ─────────────────────────────────────────────── */
.acc { display: grid; gap: 10px; }

.acc-item {
  border: 1px solid #e5ebff;
  border-radius: 12px;
  overflow: hidden;
  background: #f9fbff;
}

.acc-btn {
  width: 100%;
  text-align: left;
  background: #f2f6ff;
  border: 0;
  color: #1c2b4a;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.acc-btn .tag {
  margin-left: auto;
  font-size: .78rem;
  color: var(--brand-dark);
  background: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid #dfe7ff;
}

.acc-panel { height: 0; overflow: hidden; transition: height .3s ease; }
.acc-inner { padding: 14px 16px; }

.acc-item.open .acc-btn { background: #eaf1ff; }
.acc-item.open .acc-btn .chev { transform: rotate(90deg); }
.chev { transition: transform .25s ease; opacity: .85; }

/* ── Row / placeholder ─────────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  align-items: center;
}

.ph {
  border-radius: 10px;
  border: 1px dashed #cfe0ff;
  background: #fff;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: #6b7aa6;
  font-size: .9rem;
  overflow: hidden;
}

/* ── Tables ────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.table th,
.table td {
  border-bottom: 1px solid #e9efff;
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.table thead th { color: #1c2b4a; background: #eef4ff; }
.table tbody tr:nth-child(even) { background: #fbfdff; }
.dont { background: #fff2f2; }
.module-table { margin-top: 12px; }

/* ── Sidebar / TOC ─────────────────────────────────────────── */
.info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  position: sticky;
  top: 24px;
}

.info-title { font-weight: 700; font-size: 1rem; margin: 0 0 6px; }

.toc {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 8px;
}

.toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.toc a:hover { background: #f5f7ff; }
.toc a.active { background: #e8f0fe; color: var(--brand-dark); }

/* ── Brand logo ────────────────────────────────────────────── */
.brand-logo { height: 50px; margin-bottom: 10px; display: block; }

/* ── PPE checklist ─────────────────────────────────────────── */
.ppe-box {
  border: 1px solid var(--line);
  background: #f7fbff;
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0 18px;
}

.ppe-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ppe-title { font-weight: 600; color: var(--brand-dark); }

.ppe-print {
  margin-left: auto;
  background: #fff;
  border: 1px solid #cfd8ff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}

.ppe-print:hover { background: #eef4ff; }

.ppe-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ppe-item {
  display: grid;
  grid-template-columns: auto 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px dashed #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.ppe-item input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.ppe-text { font-size: 14px; }
.ppe-note { margin: 8px 2px 0; color: #335; font-size: .9rem; }

/* ── Work profile engine ───────────────────────────────────── */
.work-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  padding: 14px;
  margin-top: 10px;
}

.dim-row {
  display: grid;
  grid-template-columns: 260px 1fr 70px;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
}

.dim-row:hover { background: #f6f9ff; }
.label { font-weight: 600; font-size: 13px; }

.bar {
  height: 12px;
  border-radius: 8px;
  position: relative;
  background: #eee;
  overflow: hidden;
}

.bar::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 50%; height: 100%;
  background: var(--bad);
  z-index: 1;
}

.bar::after {
  content: "";
  position: absolute;
  right: 0; top: 0;
  width: 50%; height: 100%;
  background: var(--good);
  z-index: 1;
}

.marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #111;
  z-index: 2;
}

.badge { text-align: right; font-size: 12px; font-weight: 600; color: var(--brand); }

#tooltip {
  position: fixed;
  display: none;
  background: #fff;
  border: 1px solid #dfe7ff;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  z-index: 9999;
  pointer-events: none;
  max-width: 340px;
}

.section-title { font-weight: 700; margin-top: 8px; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: #f9f9f9;
  border-top: 1px solid #ddd;
  text-align: center;
  padding: 20px 10px;
  margin-top: 40px;
}

footer img { height: 40px; margin-bottom: 8px; }
footer p { margin: 0; font-size: 14px; color: #555; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 18px; padding: 24px var(--gap); }
  .two-col { flex-direction: column; }
  .row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .ppe-grid { grid-template-columns: 1fr; }
}

@media print {
  .ppe-box { break-inside: avoid; border-color: #000; background: #fff; }
  .ppe-print { display: none; }
}
