/* ── Creality printer sidecard styles ────────────────────────────────────
   Loaded after 50-snapmaker.css so Creality-specific rules can safely
   reference the shared .pp-cam-full container defined there.
   Nothing in this file is used outside the Creality brand context.
   ──────────────────────────────────────────────────────────────────────── */

/* Camera — <video> element fed by RTCPeerConnection directly in the
   renderer. The Creality WebRTC page (port 8000) has no responsive CSS —
   its <video> takes the stream's intrinsic dimensions — so we bypass the
   iframe approach and control the video element ourselves.

   object-fit:contain keeps the full camera frame visible with letterbox
   bars rather than cropping. Use "cover" if you prefer edge-to-edge fill
   at the cost of slight cropping on non-16:9 streams. */
.cre-cam-video,
.cre-cam-mjpeg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #000;
  border-radius: 0;
  object-fit: contain;
}

/* Hidden camera container — applied when the printer is offline.
   The <video> element stays in the DOM so the WebRTC session is never
   torn down by a panel rebuild; only the visibility changes. */
.cre-cam-hidden { display: none; }

/* ── Filament slot: pencil edit button (the ONLY edit trigger) ───────────────
   The square itself is now a select target (.snap-fil--selectable); editing is
   isolated to this small button so a click no longer means "edit". */
.snap-fil-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 18px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
.snap-fil-edit-btn .icon { background: var(--muted); transition: background .12s; }
.snap-fil-edit-btn:hover { background: color-mix(in srgb, var(--info) 10%, transparent); }
.snap-fil-edit-btn:hover .icon { background: var(--primary); }

/* Filament slot square — three looks:
   • coloured  = identified filament (RFID or configured)
   • --empty   = no filament (striped, defined in 50-snapmaker.css)
   • --unknown = filament present but unidentified — a SOLID neutral chip with a
     dashed edge + "?" so it reads as "loaded but unknown", distinct from empty. */
.snap-fil-square--unknown {
  color: var(--text);
  background: var(--surface-2);
  border: 2px dashed var(--muted);
  box-shadow: none;
}
.snap-fil-square--unknown .snap-fil-main {
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
  text-shadow: none;
}

/* ── Fans (Part / Case / Side) — rendered as cards with a [−] [%] [+] stepper,
   reusing the shared `.elg-fan-*` control-widget styles (see Snapmaker/Elegoo).
   Step buttons send M106 via the 9999 WS (creActionFan, optimistic). */

/* ── Filament card: title row + Feed / Unload of the selected CFS slot ───────
   The "Filament" title shares its row with the Selected label and the Feed /
   Unload buttons, which send the proprietary `feedInOrOut` WS command for the
   slot highlighted with the blue ring (firmware runs auto-heat → cut → feed). */
.cre-fil-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cre-fil-head .snap-block-title { margin: 0; }
.cre-fil-feed { display: flex; align-items: center; gap: 6px; }
.cre-fil-feed-sel { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cre-fil-feed-sel b { color: var(--primary-text); font-weight: 800; margin-left: 2px; }
.cre-fil-feed-btn {
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.cre-fil-feed-btn--in:hover {
  color: var(--on-accent);
  background: var(--primary);
  border-color: var(--primary);
}
.cre-fil-feed-btn--out:hover {
  color: var(--warning-hover);
  border-color: var(--warning);
  background: rgba(217, 119, 6, .1);
}
