/* File: public/css/components/moniteur.css
 * The virtual patient monitor — landing, display screen, controller. The monitor
 * screen is intrinsically dark (like a real device) regardless of the site theme. */

.mon-landing { max-width: 900px; }
.mon-landing__intro { color: var(--text-muted, #667); margin: 0 0 1.2rem; }
.mon-landing__cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.mon-card {
  flex: 1 1 320px; background: var(--surface, #fff); border: 1px solid var(--border, #dbe2e8);
  border-radius: 12px; padding: 1.1rem 1.2rem;
}
.mon-card h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.mon-card p { color: var(--text-muted, #667); margin: 0 0 .9rem; font-size: .9rem; }
.mon-join { display: flex; flex-direction: column; gap: .7rem; }
.mon-join label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--text-muted, #667); }
.mon-join input {
  font: inherit; font-size: 1.4rem; letter-spacing: .18em; text-transform: uppercase; text-align: center;
  padding: .5rem; border: 1px solid var(--border, #cdd6de); border-radius: 8px; background: var(--surface, #fff); color: inherit;
}

.mon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; cursor: pointer; padding: .6rem 1rem;
  border-radius: 8px; border: 1px solid var(--border, #cdd6de); background: var(--surface, #fff); color: inherit;
  text-decoration: none;
}
.mon-btn:hover { border-color: var(--brand-accent, #2E7DA1); }
.mon-btn--primary { background: var(--brand-accent, #2E7DA1); border-color: var(--brand-accent, #2E7DA1); color: #fff; }
.mon-btn--primary:hover { filter: brightness(1.05); }
.mon-btn--ghost { background: transparent; }
.mon-btn:disabled { opacity: .55; cursor: default; }

.mon-hub {
  margin-top: 1.4rem; background: #14213a; color: #eaf0f7; border-radius: 14px;
  padding: 1.4rem; text-align: center;
}
.mon-hub__code { font-size: 2.8rem; font-weight: 800; letter-spacing: .3em; color: #7fd4ff; }
.mon-hub__hint { color: #9fb0c8; font-size: .88rem; margin: .5rem auto 1rem; max-width: 42ch; }
.mon-hub__links { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.mon-code-tag {
  display: inline-block; font-weight: 700; letter-spacing: .12em; background: rgba(127,212,255,.14);
  color: #7fd4ff; border-radius: 6px; padding: .1rem .5rem;
}

/* ─────────────── monitor display ─────────────── */
.mon {
  max-width: 1400px; margin: 0 auto; background: #000; border: 1px solid #2c3036;
  border-radius: 14px; padding: .6rem .8rem .8rem;
  color: #e8eaed; font: 15px/1.5 "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}
.mon-topbar { display: flex; align-items: center; gap: .7rem; color: #9aa0a8; font-size: .85rem; padding: .15rem .2rem .45rem; }
.mon-brand { color: #cfd3d8; font-weight: 600; }
.mon-brand__sub { color: #586069; }
.mon-albanner { flex: 1; text-align: center; font-weight: 700; letter-spacing: .06em; color: #ff3b30; min-height: 1.2em; }
.mon-albanner.on { animation: mon-blink 1s steps(2) infinite; }
@keyframes mon-blink { 50% { opacity: .25; } }
.mon-tbtn { background: #15181c; border: 1px solid #34383e; color: #e8eaed; border-radius: 6px; padding: .25rem .6rem; cursor: pointer; font: inherit; font-size: .85rem; }
.mon-tbtn.on { border-color: #4a6fa5; color: #9ec1ee; }
.mon-tbtn--icon { font-size: 1.05rem; line-height: 1; padding: .28rem .55rem; }

.mon-screen { display: flex; gap: .5rem; height: 452px; }
.mon-waves { flex: 1; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.mon-row { flex: 1; display: flex; gap: .5rem; min-height: 0; }
.mon-row.off { display: none; }
.mon-wave { flex: 1; min-width: 0; position: relative; background: #000; }
.mon-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mon-tile { width: 172px; flex: 0 0 172px; background: #0b0d10; border: 1px solid #1d2126; border-radius: 8px; padding: .35rem .55rem; display: flex; flex-direction: column; justify-content: center; }
.mon-lab { font-size: .78rem; color: #9aa0a8; display: flex; justify-content: space-between; align-items: baseline; }
.mon-lab b { color: inherit; font-weight: 600; }
.mon-val { font-size: 2.5rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.mon-val--sm { font-size: 2rem; }
.mon-val.masked { color: #4a4f56 !important; font-weight: 600; }
.mon-sub { font-size: .75rem; color: #9aa0a8; min-height: 1em; }
.mon-lim { font-size: .68rem; color: #6d747d; }
.c-ecg .mon-val, .c-ecg .mon-lab b { color: #2eff7b; }
.c-spo2 .mon-val, .c-spo2 .mon-lab b { color: #31d3e8; }
.c-art .mon-val, .c-art .mon-lab b { color: #ff5252; }
.c-co2 .mon-val, .c-co2 .mon-lab b { color: #ffe14d; }
.c-nibp .mon-val, .c-nibp .mon-lab b { color: #ffb85c; }
.c-temp .mon-val, .c-temp .mon-lab b { color: #e8e8e8; }
.mon-tile.alarm { animation: mon-tflash 1s steps(2) infinite; border-color: #ff3b30; }
@keyframes mon-tflash { 50% { background: #3d0e0c; } }
.mon-strip { display: flex; gap: .35rem; margin-top: .35rem; }
.mon-strip .mon-tile { flex: 1; width: auto; }
.mon-strip .mon-val { font-size: 2rem; }
.mon-hint { color: #ffcf6e; font-size: .82rem; margin: .5rem .2rem 0; text-align: center; }

/* Fullscreen: the monitor fills the whole screen; the wave area grows to fit. */
.mon:fullscreen { max-width: none; width: 100vw; height: 100vh; border: 0; border-radius: 0; padding: .5rem 1.1rem .8rem; display: flex; flex-direction: column; background: #000; }
.mon:fullscreen .mon-screen { flex: 1; height: auto; }
.mon:fullscreen .mon-hint { display: none; }
.mon:-webkit-full-screen { max-width: none; width: 100vw; height: 100vh; border: 0; border-radius: 0; display: flex; flex-direction: column; background: #000; }
.mon:-webkit-full-screen .mon-screen { flex: 1; height: auto; }

/* ─────────────── controller ─────────────── */
.mon-ctrl__status { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.mon-ctrl__conn { font-size: .85rem; color: var(--text-muted, #667); }
.mon-ctrl__conn--ok { color: #2e9e5b; }
.mon-ctrl__conn--err { color: #d64545; }
#mon-ctrl-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; align-items: start; }
.mon-cctrl { background: var(--surface, #fff); border: 1px solid var(--border, #dbe2e8); border-radius: 12px; padding: 1rem 1.1rem; }
.mon-cctrl h3 { margin: 0 0 .7rem; font-size: 1rem; }
.mon-sub-h { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted, #889); margin: .8rem 0 .3rem; }
.mon-fld { margin: .55rem 0; }
.mon-fld > label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-muted, #667); margin-bottom: .15rem; }
.mon-fld > label output { color: inherit; font-weight: 700; font-variant-numeric: tabular-nums; }
.mon-fld2 { display: flex; gap: .6rem; }
.mon-fld2 > .mon-fld { flex: 1; }
/* High-contrast sliders — explicit track + thumb (native accent-color rendered
 * too faint on the cards, esp. in dark mode). Track visible on light AND dark. */
.mon-range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: .1rem 0; }
.mon-range::-webkit-slider-runnable-track { height: 7px; border-radius: 4px; background: rgba(120,140,162,.55); border: 1px solid rgba(90,110,130,.35); }
.mon-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--brand-accent, #2E7DA1); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mon-range::-moz-range-track { height: 7px; border-radius: 4px; background: rgba(120,140,162,.55); border: 1px solid rgba(90,110,130,.35); }
.mon-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--brand-accent, #2E7DA1); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mon-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--brand-accent, #2E7DA1); outline-offset: 2px; }
.mon-range:disabled { opacity: .4; }

/* « En combien de temps ? » — the transition-duration block. */
.mon-applyblock { margin-top: 1rem; padding: .8rem; border: 1px solid var(--brand-accent, #2E7DA1); border-radius: 10px; background: color-mix(in srgb, var(--brand-accent, #2E7DA1) 7%, transparent); }
.mon-applyblock__q { font-weight: 700; font-size: 1rem; margin-bottom: .2rem; }
.mon-help { font-size: .82rem; color: var(--text-muted, #667); margin: 0 0 .6rem; }
.mon-dur { display: flex; flex-wrap: wrap; gap: .35rem; }
.mon-dur__b { font: inherit; font-size: .85rem; padding: .35rem .6rem; border-radius: 20px; border: 1px solid var(--border, #cdd6de); background: var(--surface, #fff); color: inherit; cursor: pointer; }
.mon-dur__b:hover { border-color: var(--brand-accent, #2E7DA1); }
.mon-dur__b.on { background: var(--brand-accent, #2E7DA1); border-color: var(--brand-accent, #2E7DA1); color: #fff; }
.mon-dur__row { display: flex; align-items: center; gap: .4rem; margin-top: .6rem; }
.mon-dur__or { font-size: .82rem; color: var(--text-muted, #667); }
.mon-dur__u { font-size: .82rem; color: var(--text-muted, #667); }
.mon-dur__custom { width: 5rem; font: inherit; padding: .35rem .5rem; border: 1px solid var(--border, #cdd6de); border-radius: 6px; background: var(--surface, #fff); color: inherit; }
.mon-apply { margin-left: auto; }
.mon-input { width: 100%; font: inherit; padding: .35rem .5rem; border: 1px solid var(--border, #cdd6de); border-radius: 6px; background: var(--surface, #fff); color: inherit; }
.mon-chk { display: flex; align-items: center; gap: .45rem; font-size: .9rem; margin: .35rem 0; cursor: pointer; }
.mon-apply-row { display: flex; align-items: center; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }
.mon-apply-row label { font-size: .85rem; color: var(--text-muted, #667); }
.mon-apply-row .mon-input { width: auto; }
.mon-apply { margin-left: auto; }
.mon-units { display: flex; gap: .4rem; }
.mon-unit { flex: 1; font: inherit; padding: .35rem; border: 1px solid var(--border, #cdd6de); border-radius: 6px; background: var(--surface, #fff); color: inherit; cursor: pointer; }
.mon-unit.on { background: var(--brand-accent, #2E7DA1); border-color: var(--brand-accent, #2E7DA1); color: #fff; }

@media (max-width: 820px) {
  .mon-screen { height: auto; }
  .mon-waves { gap: .5rem; }
  .mon-row { min-height: 96px; }
  .mon-tile { width: 120px; flex-basis: 120px; }
  .mon-val { font-size: 2rem; }
}
