/* ==========================================================================
   WFM E2E PT • Global Stylesheet
   Default theme: LIGHT
   Dark theme: add body.l1 or body.theme-dark
   ========================================================================== */

/* ------------------------------ */
/* Theme tokens                   */
/* ------------------------------ */

/* LIGHT (default) */
:root{
  --bg:    #f8f8f8;
  --panel: #ffffff;
  --card:  #ffffff;
  --text:  #1f2937; /* slate-800 */
  --muted: #6b7280; /* slate-500 */

  --brand:   #7c3aed; /* violet-600 */
  --brand-2: #06b6d4; /* cyan-500 */

  --border: rgba(0,0,0,.12);
  --shadow: 0 10px 30px rgba(0,0,0,.06), inset 0 1px 0 rgba(255,255,255,.03);
  --radius: 18px;

  --focus: #0078d4;
  --ok:    #16a34a;
  --warn:  #f59e0b;
  --err:   #dc2626;
}

/* DARK (used by Home / Module pages) */
body.l1,
body.theme-dark{
  --bg:    #0b1020;
  --panel: #0f172a;
  --card:  #0b1225;
  --text:  #e5e7eb; /* slate-200 */
  --muted: #9ca3af; /* slate-400 */

  --border: rgba(255,255,255,.08);
  --shadow: 0 10px 30px rgba(2,8,23,.45), inset 0 1px 0 rgba(255,255,255,.03);
}

/* ------------------------------ */
/* Base                           */
/* ------------------------------ */

*,
*::before,
*::after{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin:0;
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(124,58,237,.20), transparent 55%),
    radial-gradient(900px 600px  at 90%  10%, rgba(6,182,212,.14), transparent 45%),
    var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial,Apple Color Emoji,Segoe UI Emoji;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
code,kbd,pre,samp{ font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }

/* Utilities */
.wrap{ max-width: 1280px; margin: 0 auto; padding: 10px 16px; }
.spacer{ flex: 1 1 auto; }
.hidden{ display:none!important; }
.nowrap{ white-space: nowrap; }

/* ------------------------------ */
/* Header / Frame                 */
/* ------------------------------ */

.frame{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.2) blur(10px);
}
.frame .logo img{ height: 36px; width: auto; }
.frame .title{ font-weight: 700; letter-spacing:.25px; }
.frame .subtitle{ font-size: 12px; color: var(--muted); margin-top: 2px; }
.frame .wrap{ display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.frame .title-group{ display: flex; flex-direction: column; }

.links{ display:flex; gap:10px; align-items:center; }
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  font-weight: 600; font-size: 12px;
  transition: transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0); }
.btn:focus-visible{ outline: 2px solid var(--focus); outline-offset: 2px; }

/* Optional branded header variant for training pages */
.frame.brand{
  background: #003B5C; /* teal bar */
  color: #fff;
  border-bottom-color: rgba(255,255,255,.12);
}
.frame.brand .subtitle{ color: #e5eff7; }

/* ------------------------------ */
/* Sections & Panels              */
/* ------------------------------ */

.section{ padding: 12px 16px; }
.panel{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head{
  padding: 14px 16px;
  display:flex; align-items:center; gap:10px;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.panel-head h2{ margin:0; font-size: 16px; }
.panel-head .subtitle{ color: var(--muted); font-size:12px; }
.panel-body{ padding: 12px 16px; }

/* ------------------------------ */
/* SVG host (Home / Module / Case)*/
/* ------------------------------ */

.svgBox{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.svgHost{ width: 100%; height: auto; margin: 0 auto; }
.svgHost svg{ width: 100% !important; height: 100% !important; display: block; }
.svgError{ color: #b00020; padding: .5rem; }

/* On very wide screens, cap width so diagrams don’t get too large */
@media (min-width: 1200px){
  #svgHost, .svgHost{ max-width: 1400px; }
}

/* ------------------------------ */
/* Two-column Training Layout     */
/* (used by case training pages)  */
/* ------------------------------ */

.grid{
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  margin: 1rem;
  align-items: start;
}

/* Sticky left viewer */
.viewer{
  position: sticky;
  top: 80px; /* header offset */
  align-self: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display:flex; flex-direction: column;
}
.viewer .screen{
  width: 100%;
  height: min(72vh, 800px);
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.viewer .screen img{
  width: 100%; height: 100%; object-fit: contain;
}
.caption, #shotCaption{
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* Thumbnails strip (ids used by template) */
#thumbs{
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px; background: var(--card);
}
#thumbs img{
  width: 90px; height: 60px; object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  opacity: .75;
  cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, transform .06s ease;
}
#thumbs img:hover{ opacity: .95; transform: translateY(-1px); }
#thumbs img.active{ opacity: 1; border-color: var(--focus); }

/* Steps list (generic card look) */
.step{
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 12px;
  margin-bottom: .6rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  transition: border-color .12s ease, background-color .12s ease, box-shadow .12s ease;
}
.step strong{ font-weight: 700; }
.step:focus{ outline: 2px solid var(--focus); outline-offset: 2px; }
.step:hover{ box-shadow: var(--shadow); }
.step.active{
  background: #eef6ff; /* light blue highlight (OK in dark too) */
  border-left: 4px solid var(--focus);
}

/* Optional “muted” state support if any page marks steps as disabled */
.step.is-muted{
  opacity: .65;
  filter: grayscale(.1);
  pointer-events: none;
}

/* ------------------------------ */
/* Notes Panel (toggleable)       */
/* ------------------------------ */

.notes-panel{
  position: fixed;
  right: -420px;
  top: 80px;
  width: 400px;
  height: calc(100vh - 100px);
  background: var(--card);
  border-left: 3px solid var(--focus);
  box-shadow: -4px 0 14px rgba(0,0,0,0.15);
  padding: 1rem;
  overflow-y: auto;
  transition: right .35s ease;
  z-index: 2000;
}
.notes-panel.open{ right: 0; }
.notes-toggle{
  position: fixed;
  right: 0;
  top: 80px;
  background: var(--focus);
  color: white;
  padding: .5rem .75rem;
  cursor: pointer;
  border-radius: 4px 0 0 4px;
  z-index: 2001;
}

/* ------------------------------ */
/* Footer                         */
/* ------------------------------ */

footer{
  padding: 16px;
  color: var(--muted);
  display:flex; justify-content: space-between;
}

/* ------------------------------ */
/* Responsive                     */
/* ------------------------------ */

@media (max-width: 1024px){
  .grid{ grid-template-columns: 1fr; }
  .viewer{ position: static; }
  .viewer .screen{ height: 55vh; }
}

/* ------------------------------ */
/* Helpers for status chips, etc. */
/* ------------------------------ */

.badge{
  display:inline-flex; align-items:center; gap:6px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}
.badge.ok{   border-color: rgba(22,163,74,.35);   color: #166534; background: rgba(22,163,74,.08); }
.badge.warn{ border-color: rgba(245,158,11,.35);  color: #7c2d12; background: rgba(245,158,11,.10); }
.badge.err{  border-color: rgba(220,38,38,.35);   color: #7f1d1d; background: rgba(220,38,38,.10); }

/* ------------------------------ */
/* Tables (if any future pages)   */
/* ------------------------------ */

.table{
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.table th,
.table td{ padding: 10px 12px; border-bottom: 1px solid var(--border); }
.table thead th{ background: rgba(0,0,0,.03); text-align: left; font-weight: 700; }

/* ------------------------------ */
/* Links inside SVGs              */
/* ------------------------------ */

svg a{ cursor: pointer; }
svg a:hover{ filter: brightness(1.05); }

