/**
 * JewDIY Bead Library Premium UX — catalog, drag, popover, canvas hints
 */

:root {
  --bead-premium-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bead-premium-shadow: 0 14px 36px rgba(31, 40, 28, 0.10);
  --bead-premium-glow: 0 0 0 1px rgba(35, 79, 55, 0.08);
}

/* ── Catalog cards ── */
.left-panel .product-card,
.bottom-tray .tray-item {
  border-radius: 14px;
  border: 1px solid rgba(226, 223, 213, 0.92);
  background: linear-gradient(180deg, #fff 0%, #faf8f3 100%);
  box-shadow: var(--bead-premium-glow);
  transition:
    transform 0.22s var(--bead-premium-ease),
    box-shadow 0.22s var(--bead-premium-ease),
    border-color 0.22s var(--bead-premium-ease);
}

.left-panel .product-card:hover,
.bottom-tray .tray-item:hover {
  transform: translateY(-2px);
  border-color: rgba(35, 79, 55, 0.22);
  box-shadow: var(--bead-premium-shadow);
}

.left-panel .product-card.is-synced {
  border-color: rgba(196, 148, 46, 0.55);
  box-shadow: 0 0 0 2px rgba(196, 148, 46, 0.12);
}

.left-panel .product-card.tap-added,
.bottom-tray .tray-item.tap-added {
  animation: beadTapPulse 0.42s var(--bead-premium-ease);
}

@keyframes beadTapPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(35, 79, 55, 0); }
  40% { transform: scale(0.97); box-shadow: 0 0 0 6px rgba(35, 79, 55, 0.12); }
  100% { transform: scale(1); box-shadow: var(--bead-premium-glow); }
}

.left-panel .product-card .product-art,
.bottom-tray .tray-item .mini-bead {
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 8px 18px rgba(31, 40, 28, 0.08);
}

.left-panel .product-card .product-art.photo-backed,
.bottom-tray .tray-item .mini-bead.photo-backed {
  background-color: #f3f0e8;
}

.left-panel .product-card .product-card-price {
  display: none;
}

.left-panel .product-card .price-line strong {
  color: var(--moss, #1f5137);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.left-panel .product-card .detail-chip {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(35, 79, 55, 0.14);
  font-weight: 700;
}

.left-panel .catalog-empty-state {
  padding: 28px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(35, 79, 55, 0.18);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.left-panel .catalog-empty-state .catalog-empty-action {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(35, 79, 55, 0.2);
  background: rgba(35, 79, 55, 0.06);
  color: var(--moss, #1f5137);
  font-weight: 700;
  cursor: pointer;
}

/* ── Size selector ── */
.size-selector-head strong {
  color: var(--moss, #1f5137);
  font-variant-numeric: tabular-nums;
}

.size-options button.active {
  background: rgba(35, 79, 55, 0.12);
  border-color: rgba(35, 79, 55, 0.35);
  color: var(--moss, #1f5137);
  font-weight: 800;
}

/* ── Drag ghost ── */
.drag-ghost {
  width: 72px;
  height: 72px;
  transition: opacity 0.16s ease, transform 0.08s linear;
}

.drag-ghost .preview-bead,
.drag-ghost .product-art,
.drag-ghost .mini-bead {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 18px 32px rgba(31, 40, 28, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.drag-ghost.in-canvas {
  opacity: 0.72;
  transform: translate(var(--ghost-x, -50%), var(--ghost-y, -50%)) scale(0.92);
  filter: drop-shadow(0 12px 20px rgba(31, 40, 28, 0.18));
}

.drag-ghost.touch-ghost {
  width: 58px;
  height: 58px;
  opacity: 0.92;
}

/* ── Drop marker with real bead preview ── */
.drop-marker {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.drop-marker.show {
  animation: dropMarkerLand 0.22s var(--bead-premium-ease);
}

@keyframes dropMarkerLand {
  from { transform: scale(0.55); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

.drop-marker .drop-marker-bead {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 0 3px rgba(35, 79, 55, 0.22),
    0 14px 28px rgba(31, 40, 28, 0.16);
}

.drop-marker.invalid .drop-marker-bead {
  box-shadow:
    0 0 0 3px rgba(172, 69, 43, 0.55),
    0 14px 28px rgba(172, 69, 43, 0.12);
  filter: saturate(0.75);
}

.drop-marker-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(35, 79, 55, 0.35);
  pointer-events: none;
  animation: markerPulse 1.2s ease-in-out infinite;
}

.drop-marker.invalid .drop-marker-ring {
  border-color: rgba(172, 69, 43, 0.55);
}

/* ── Canvas drag hints ── */
.design-canvas.drag-over::after {
  opacity: 1;
}

.design-canvas[data-drag-hint]::before {
  font-weight: 700;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
}

/* ── Material popover ── */
.material-popover {
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(31, 40, 28, 0.16),
    0 0 0 1px rgba(35, 79, 55, 0.06);
}

.material-popover .popover-reference {
  margin: 12px 0 4px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #faf8f3, #fff);
  border: 1px solid rgba(226, 223, 213, 0.9);
}

.material-popover .popover-reference-cutout {
  width: 88px;
  height: 88px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 10px 22px rgba(31,40,28,0.08);
}

.material-popover .popover-reference p {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #697165);
  line-height: 1.45;
  text-align: center;
}

.material-popover .popover-actions .primary {
  box-shadow: 0 10px 24px rgba(35, 79, 55, 0.18);
}

/* ── Smart complete toast enhancement ── */
.smart-complete-flash .preview-item {
  animation: smartCompleteFlash 0.55s var(--bead-premium-ease);
}

@keyframes smartCompleteFlash {
  0% { filter: brightness(1); }
  35% { filter: brightness(1.08); }
  100% { filter: brightness(1); }
}

/* ── Tray mobile ── */
@media (max-width: 860px) {
  .bottom-tray .tray-item .detail-chip {
    display: inline-flex;
  }

  .bottom-tray.expanded {
    box-shadow: 0 -18px 40px rgba(31, 40, 28, 0.12);
  }
}

/* ── Catalog filter pills ── */
.left-panel .filter.active {
  background: rgba(35, 79, 55, 0.12);
  border-color: rgba(35, 79, 55, 0.32);
  color: var(--moss, #1f5137);
}

.bead-library-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: rgba(35, 79, 55, 0.05);
  font-size: 12px;
  color: var(--muted, #697165);
}

.bead-library-status-bar strong {
  color: var(--moss, #1f5137);
  font-variant-numeric: tabular-nums;
}
