/* Druckermenü: Druckerliste, laufender Druck, Vorlagen, Laser, AMS, Farbwahl (Ladereihenfolge siehe index.html) */

/* ---------- Druckermenü ---------- */

.control-grid { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
/* Links die Liste aller Drucker, rechts die Details des gewählten */
.pm-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 14px; align-items: start; }
.pm-list { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.pm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid #555c69;
  border-radius: 7px;
  background: #2a2e36;
  color: #e6e8ec;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pm-row:hover { background: #313641; }
.pm-row.selected { background: #20406a; border-color: #3aa0ff; }
.pm-row.ready { border-left-color: #7ee08a; }
.pm-row.printing { border-left-color: #3aa0ff; }
.pm-row.paused { border-left-color: #f2c419; }
.pm-row.done { border-left-color: #2f8f4a; }
.pm-row.failed { border-left-color: #e0503f; }
.pm-row-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  font-size: 1.4rem;
}
.pm-row-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pm-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pm-row-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-row-name small { font-weight: 400; opacity: 0.55; }
.pm-row-status { font-size: 0.8rem; opacity: 0.85; font-variant-numeric: tabular-nums; }
.pm-row.ready .pm-row-status { color: #7ee08a; }
.pm-row.printing .pm-row-status { color: #7cc4ff; }
.pm-row.paused .pm-row-status { color: #f2c419; }
.pm-row.done .pm-row-status { color: #8fe3a2; }
.pm-row.failed .pm-row-status { color: #ff8a7a; }
.pm-row .progress { margin-top: 2px; height: 4px; }
.pm-row .progress .bar { display: block; }
.pm-detail { min-width: 0; }
.pm-detail-card { gap: 14px; }

/* Laufender Druck: Teil groß, Prozent und Restzeit gut lesbar */
.pm-job { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: 8px; background: #22262d; }
.pm-job-image {
  flex: none;
  width: 160px;
  max-width: 40%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
}
.pm-job-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pm-job-name { font-weight: 600; }
.pm-job-pct { font-size: 2.4rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: #7cc4ff; }
.pm-job.done .pm-job-pct { color: #8fe3a2; }
.pm-job.paused .pm-job-pct { color: #f2c419; }
.pm-job.failed .pm-job-pct { color: #ff8a7a; }
.pm-job-left { font-size: 0.9rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.pm-job .progress { margin-top: 6px; height: 8px; }

/* Vorlagen als Bildergalerie */
.pm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pm-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #1f2228;
  color: #dde;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.pm-tile:hover { border-color: rgba(255, 255, 255, 0.3); }
.pm-tile.chosen { border-color: #3aa0ff; background: #20406a; color: #fff; }
.pm-tile.blocked { opacity: 0.5; }
.pm-tile.blocked.chosen { opacity: 0.85; }
.pm-tile img, .pm-tile-noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: grid; place-items: center; font-size: 1.6rem; }
.pm-tile-name { font-weight: 600; font-size: 0.82rem; }
.pm-tile-meta { font-size: 0.72rem; opacity: 0.7; font-variant-numeric: tabular-nums; }
.pm-tile-problem {
  font-size: 0.7rem;
  color: #ff8a7a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 700px) {
  .pm-layout { grid-template-columns: minmax(0, 1fr); }
  .pm-list { position: static; }
  .pm-job { flex-direction: column; align-items: stretch; }
  .pm-job-image { width: 100%; max-width: none; height: 140px; }
}
.shop-content .empty { opacity: 0.75; }

.status {
  padding: 6px 10px;
  border-radius: 5px;
  background: #343944;
  font-size: 0.9rem;
  font-weight: 600;
}
.status.ready { color: #7ee08a; }
.status.printing { color: #7cc4ff; }
.status.paused { color: #f2c419; }
.status.done { color: #fff; background: #2f8f4a; }
.status.idle { opacity: 0.6; }
.status.urgent { color: #fff; background: #b5392b; }

.progress {
  height: 6px;
  margin-top: -6px;
  border-radius: 3px;
  background: #1a1d22;
  overflow: hidden;
}
.progress .bar { height: 100%; background: #3aa0ff; transition: width 0.25s linear; }

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  opacity: 0.95;
}

.field select,
.field input.laser-text {
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  background: #1f2228;
  color: #eee;
  font: inherit;
}
/* Laser R1: Vorschau der Holzplatte mit Gravur bzw. Schnittlinien */
.laser-preview {
  display: block;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 3 / 2;
  margin: 2px 0 4px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.speeds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.speeds button {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: #1f2228;
  color: #ccd;
  font-weight: 600;
  cursor: pointer;
}
.speeds button small { font-weight: 400; opacity: 0.7; }
.speeds button.active { border-color: #3aa0ff; background: #20406a; color: #fff; }
.speeds button:disabled { opacity: 0.4; cursor: not-allowed; }
.speeds.leds { grid-template-columns: repeat(3, 1fr); }
.speeds.leds button { flex-direction: row; justify-content: center; gap: 6px; }

/* AMS-Fächer im Druckermenü */
.ams-slots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.ams-slots button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: #1f2228;
  color: #dde;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}
.ams-slots button small { opacity: 0.6; }
.ams-slots button.active { border-color: #3aa0ff; background: #20406a; color: #fff; }
.ams-slots button:disabled { cursor: not-allowed; }
/* Farbwahl bei zwei- und mehrfarbigen Drucken: Vorschau links, pro Teil eine Reihe Farbknöpfe (gewählt grün) */
.color-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 4px; }
.color-preview {
  width: 160px;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
}
.color-rows { flex: 1 1 180px; display: flex; flex-direction: column; gap: 6px; }
.color-row small { display: block; margin-bottom: 3px; opacity: 0.7; }
.color-options { display: flex; flex-wrap: wrap; gap: 4px; }
.color-options button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: #3a3c41;
  color: #a9adb4;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.color-options button:hover { background: #46494f; }
.color-options button.chosen { border-color: #3bd16f; background: #1d7a3c; color: #fff; }
.tag.two-color { background: linear-gradient(90deg, #2f6fd6, #d62f2f); color: #fff; }
.tag.laser { background: linear-gradient(90deg, #ff8a1a, #b8692f); color: #fff; }

.actions { justify-content: flex-end; }
.secondary, .danger {
  padding: 7px 14px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.secondary { background: #4a5160; }
.danger { background: #b5392b; }

.shop-toast {
  position: absolute;
  left: 50%;
  bottom: 68px; /* über der Taskleiste */
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  background: #2f8f4a;
  border-radius: 6px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.shop-toast.visible { opacity: 1; transform: translate(-50%, 0); }
