/* NotBot live workflow demo — scoped CSS.
 *
 * Label visual vocabulary matches the existing Print Modes section on the
 * same page (marketing_notbot.templ:597-689): white background, soft shadow,
 * absolutely-positioned percentage children, 3:2 landscape aspect.
 */

/* ─── Stream events ───────────────────────────────────────────────────── */

.notbot-demo .stream-event {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.notbot-demo .stream-event[data-state="upcoming"] {
  opacity: 0;
  transform: translateY(-10px);
}

.notbot-demo .stream-event[data-state="active"] {
  opacity: 1;
  animation: simSlideIn 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

.notbot-demo .stream-event[data-state="past"] {
  opacity: 0.45;
}

@keyframes simSlideIn {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notbot-demo .live-dot {
  animation: liveBadgePulse 1.8s ease-in-out infinite;
}

@keyframes liveBadgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.75); }
}

/* ─── Notification card ───────────────────────────────────────────────── */

.notbot-demo .notification-card {
  opacity: 0;
  transform: scale(0.85) translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.notbot-demo .notification-card[data-visible="true"] {
  opacity: 1;
  transform: scale(1) translateY(0);
  animation: simNotifPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes simNotifPop {
  0%   { opacity: 0; transform: scale(0.7) translateY(12px); }
  60%  { opacity: 1; transform: scale(1.05) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Printer ─────────────────────────────────────────────────────────── */

.notbot-demo .printer-led {
  animation: printerLedPulse 1.6s ease-in-out infinite;
}

@keyframes printerLedPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

.notbot-demo .printer-body[data-feeding="true"] {
  animation: printerPaperFeed 0.18s ease-in-out 3;
}

@keyframes printerPaperFeed {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(1.5px); }
}

/* ─── Flying labels (2x3 thermal label aesthetic) ─────────────────────── */

.notbot-demo .flying-label {
  position: absolute;
  width: 96px;
  height: 64px;          /* 3:2 landscape, matches 2x3" label proportions */
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.1);
  color: #000;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  overflow: hidden;
  --fly-x: 0px;
  --fly-y: 0px;
  --fly-rotate: 0deg;
}

.notbot-demo .flying-label[data-stage="feeding"] {
  animation: simLabelFeed 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.notbot-demo .flying-label[data-stage="flying"] {
  animation: simLabelFly 0.8s cubic-bezier(0.45, 0.05, 0.55, 0.95) forwards;
}

.notbot-demo .flying-label[data-stage="landed"] {
  animation: simLabelLand 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
  opacity: 1;
}

@keyframes simLabelFeed {
  0%   { opacity: 0; transform: translate(0, -22px); }
  60%  { opacity: 1; transform: translate(0, 6px); }
  100% { opacity: 1; transform: translate(0, 4px); }
}

@keyframes simLabelFly {
  0%   { opacity: 1; transform: translate(0, 4px) rotate(0deg); }
  100% { opacity: 1; transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-rotate)); }
}

@keyframes simLabelLand {
  0%   { transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-rotate)); opacity: 1; }
  40%  { transform: translate(var(--fly-x), calc(var(--fly-y) - 3px)) rotate(calc(var(--fly-rotate) + 2deg)); opacity: 1; }
  100% { transform: translate(var(--fly-x), var(--fly-y)) rotate(var(--fly-rotate)); opacity: 1; }
}

/* Buyer-only label content layout (large #N centered top, name below) */
.notbot-demo .flying-label__num--big {
  position: absolute;
  left: 5%;
  top: 15%;
  width: 90%;
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.notbot-demo .flying-label__name--big {
  position: absolute;
  left: 5%;
  top: 60%;
  width: 90%;
  height: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1.1;
  text-align: center;
}

/* Item label content layout (small #N + user on top row, item text middle,
 * badge bottom) */
.notbot-demo .flying-label__row {
  position: absolute;
  left: 5%;
  top: 5%;
  width: 90%;
  height: 18%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-size: 9px;
  line-height: 1.1;
}

.notbot-demo .flying-label__num {
  font-weight: 800;
  flex-shrink: 0;
}

.notbot-demo .flying-label__user {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.notbot-demo .flying-label__item {
  position: absolute;
  left: 5%;
  top: 28%;
  width: 90%;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 8px;
  line-height: 1.1;
  white-space: normal;
  overflow: hidden;
}

.notbot-demo .flying-label__badge {
  position: absolute;
  left: 5%;
  top: 82%;
  width: 90%;
  height: 13%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6px;
  font-weight: bold;
  letter-spacing: 0.3px;
  line-height: 1.1;
}

/* ─── No-label caption ────────────────────────────────────────────────── */

.notbot-demo .no-label-caption {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.notbot-demo .no-label-caption[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Phase indicator ─────────────────────────────────────────────────── */

.notbot-demo .phase-step {
  color: rgb(156 163 175);
  transition: color 0.3s ease;
}

.notbot-demo .phase-step[data-active="true"] {
  color: rgb(99 102 241);
  font-weight: 600;
}

.notbot-demo .phase-arrow[data-active="true"] {
  color: rgb(99 102 241);
}

/* ─── Box highlights (pulse on the active buyer's box) ──────────────── */

.notbot-demo .box-highlight {
  transition: stroke 0.2s ease;
}

.notbot-demo .box-highlight[data-active="true"] {
  stroke: #6366f1;
  animation: simBoxPulse 0.7s ease-out;
}

@keyframes simBoxPulse {
  0%   { stroke: #6366f1; stroke-width: 2.5; opacity: 1; }
  60%  { stroke: #a78bfa; stroke-width: 3.5; opacity: 1; }
  100% { stroke: #6366f1; stroke-width: 2; opacity: 1; }
}

/* ─── Item chips (small "package" icons that drop into boxes) ────────── */

.notbot-demo .item-chip {
  position: absolute;
  width: 44px;
  height: 32px;
  background: linear-gradient(180deg, #d4a574 0%, #b88555 100%);
  border: 1px solid rgba(120, 70, 30, 0.5);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  --drop-x: 0px;
  --drop-y: 0px;
}

/* Tape strip across the top of the package */
.notbot-demo .item-chip::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.45);
}

/* Center seam */
.notbot-demo .item-chip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(80, 40, 10, 0.3);
}

/* Item chip with a label stuck on it (Both mode): same package look,
 * just larger so the 96x64 label fits cleanly on top with margin. */
.notbot-demo .item-chip[data-with-label="true"] {
  width: 120px;
  height: 80px;
}

/* Hide the default top tape stripe when a label is sitting on it
 * (the label covers that area anyway and the tape would peek out). */
.notbot-demo .item-chip[data-with-label="true"]::before {
  display: none;
}

.notbot-demo .item-chip[data-stage="appearing"] {
  animation: simItemAppear 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

.notbot-demo .item-chip[data-stage="dropping"] {
  animation: simItemDrop var(--drop-duration, 1.2s) cubic-bezier(0.5, 0, 0.75, 0) forwards;
}

@keyframes simItemAppear {
  0%   { opacity: 0; transform: translateY(-8px) scale(0.7); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes simItemDrop {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  60%  { opacity: 1; transform: translate(var(--drop-x), calc(var(--drop-y) - 4px)) scale(0.85); }
  100% { opacity: 0; transform: translate(var(--drop-x), var(--drop-y)) scale(0.6); }
}

/* ─── Persisted box labels (rendered as foreignObject inside the SVG) ─── */

.notbot-demo .box-label {
  width: 44px;
  height: 30px;
  background: white;
  border-radius: 1.5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transform-origin: center;
  animation: simBoxLabelPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

@keyframes simBoxLabelPop {
  0%   { opacity: 0; transform: scale(0.4) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.notbot-demo .box-label__num {
  position: absolute;
  left: 5%;
  top: 15%;
  width: 90%;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #000;
  line-height: 1;
}

.notbot-demo .box-label__name {
  position: absolute;
  left: 5%;
  top: 65%;
  width: 90%;
  height: 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5px;
  color: #1f2937;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─── Reduced motion ──────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .notbot-demo *,
  .notbot-demo *::before,
  .notbot-demo *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
