/* ============================================================================
   LUMIQ STUDIO — OUTPUT PANEL (Polished)
   ============================================================================ */

.out-hdr {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: linear-gradient(to bottom, rgba(155,21,21,0.02), transparent);
}

.out-hdr-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.out-hdr-actions {
  display: flex;
  gap: 8px;
}

.out-btn {
  width: 30px;
  height: 30px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s var(--ease);
  color: var(--text-sec);
}

.out-btn:hover {
  background: var(--bg4);
  border-color: var(--border-hi);
  color: var(--text);
  transform: translateY(-1px);
}

.out-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.out-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.out-grid.g1,
.out-grid.g2,
.out-grid.g-multi {
  display: flex;
  flex-direction: column;
}

/* ---- Quantity Selector ---- */
.qty-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-selector button {
  width: 26px;
  height: 26px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.qty-selector button:hover {
  background: var(--bg4);
  border-color: var(--border-hi);
  transform: translateY(-1px);
}

.qty-selector .qty-val {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text);
  min-width: 18px;
  text-align: center;
}

/* ---- Cancel Button ---- */
.btn-cancel-gen {
  padding: 7px 16px;
  background: transparent;
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: none;
}

.btn-cancel-gen:hover {
  background: rgba(248, 113, 113, 0.1);
  transform: translateY(-1px);
}

.btn-cancel-gen.visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- Output Slots ---- */
.o-slot {
  aspect-ratio: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  width: 100%;
  flex-shrink: 0;
}

.o-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: imgFadeIn 0.4s ease;
}

@keyframes imgFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.o-slot:hover {
  border-color: rgba(155,21,21,0.3);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.o-slot-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.o-slot:hover .o-slot-overlay {
  opacity: 1;
}

.o-slot-action {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.o-slot-action:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* Empty state */
.o-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  padding: 16px;
}

.o-empty-icon {
  font-size: 28px;
  color: var(--text-ter);
  line-height: 1;
  opacity: 0.5;
}

.o-empty p {
  font-size: 11px;
  color: var(--text-ter);
  margin: 0;
  text-align: center;
}

.o-num {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.2);
  z-index: 2;
}

/* ---- Hover overlay ---- */
.o-ov {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
  z-index: 3;
}

.o-slot:hover .o-ov {
  opacity: 1;
}

.ov-row {
  display: flex;
  gap: 4px;
}

.ov-btn {
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--sans);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.ov-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.ov-btn.pf {
  color: var(--green);
  border-color: rgba(45, 212, 191, 0.25);
}

.ov-btn.pf:hover {
  background: rgba(45, 212, 191, 0.1);
}

/* ---- Loading State ---- */
.o-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 14px;
}

.spin {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(155,21,21,0.2);
  border-top-color: var(--accent-bright);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spin-lbl {
  font-size: 11px;
  color: var(--text-sec);
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- Lightbox ---- */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.lb-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  max-height: 90vh;
}

.lb-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(4px);
}

.lb-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

.lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lb-bar {
  display: flex;
  gap: 8px;
}

.lb-btn {
  padding: 9px 18px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  backdrop-filter: blur(4px);
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.lb-btn.pf {
  color: var(--green);
  border-color: rgba(45, 212, 191, 0.25);
}

.lb-btn.pf:hover {
  background: rgba(45, 212, 191, 0.1);
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(21,21,24,0.95);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  max-width: 400px;
  z-index: 900;
  animation: toastIn 0.4s var(--ease-spring);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  text-align: center;
}

.toast.success {
  border-color: rgba(45, 212, 191, 0.25);
  color: var(--green);
}

.toast.error {
  border-color: rgba(248, 113, 113, 0.25);
  color: var(--red);
}

.toast.warning {
  border-color: rgba(251, 191, 36, 0.25);
  color: var(--amber);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
