/**
 * Kiosk/operator skeleton layouts — builds on wesp-recipes-skeleton.css primitives.
 */

/* --- Grid cards (direct children of .dispenser-grid) --- */

.dispenser-card.kiosk-skeleton-card {
  pointer-events: none;
  cursor: default;
}

.dispenser-card.kiosk-skeleton-card:nth-child(1) { --skel-i: 0; }
.dispenser-card.kiosk-skeleton-card:nth-child(2) { --skel-i: 1; }
.dispenser-card.kiosk-skeleton-card:nth-child(3) { --skel-i: 2; }
.dispenser-card.kiosk-skeleton-card:nth-child(4) { --skel-i: 3; }

.dispenser-grid.kiosk-skeleton-host--exit {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.dashboard-skeleton-bar--kiosk-title {
  width: 72%;
  height: 1.75rem;
  margin-bottom: 12px;
}

.kiosk-skeleton-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-skeleton-bar--kiosk-meta {
  width: 88%;
  height: 0.72rem;
  margin-bottom: 0;
}

.dashboard-skeleton-bar--kiosk-meta:last-child {
  width: 62%;
}

/* Legacy grid wrapper (unused on recipes_selection; kept for compatibility) */

.kiosk-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
  min-height: 8rem;
  transition: opacity 0.15s ease;
}

.kiosk-skeleton-grid--exit {
  opacity: 0;
  pointer-events: none;
}

/* --- Unloading groups list --- */

.kiosk-skeleton-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 6rem;
  transition: opacity 0.15s ease;
}

.kiosk-skeleton-groups--exit {
  opacity: 0;
  pointer-events: none;
}

.kiosk-skeleton-group-item {
  background: var(--white, #fff);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  padding: 16px 20px;
  pointer-events: none;
}

.kiosk-skeleton-group-item:nth-child(1) { --skel-i: 0; }
.kiosk-skeleton-group-item:nth-child(2) { --skel-i: 1; }
.kiosk-skeleton-group-item:nth-child(3) { --skel-i: 2; }

.kiosk-skeleton-group-item .dashboard-skeleton-bar--title {
  width: 55%;
  height: 1.1rem;
  margin-bottom: 10px;
}

.kiosk-skeleton-group-item .dashboard-skeleton-bar--meta {
  width: 40%;
  height: 0.85rem;
  margin-bottom: 0;
}

/* --- Duplicate / weight panel --- */

.kiosk-skeleton-panel {
  transition: opacity 0.15s ease;
}

.kiosk-skeleton-panel--exit {
  opacity: 0;
  pointer-events: none;
}

.kiosk-skeleton-weight-hero {
  width: min(280px, 70%);
  height: clamp(2.5rem, 8vmin, 4rem);
  margin: 0 auto 16px;
  border-radius: 8px;
}

.kiosk-skeleton-recipe-header {
  padding: clamp(10px, 2.5vmin, 16px) clamp(12px, 3vw, 20px);
}

.kiosk-skeleton-recipe-header .dashboard-skeleton-bar--title {
  width: 65%;
  height: 1.25rem;
  margin-bottom: 8px;
}

.kiosk-skeleton-recipe-header .dashboard-skeleton-bar--subtitle {
  width: 45%;
  height: 0.85rem;
  margin-bottom: 0;
}

.kiosk-skeleton-component-name {
  width: min(320px, 85%);
  height: 1.5rem;
  margin: 0 auto 20px;
}

/* --- Ingredients table skeleton --- */

.kiosk-skeleton-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 12rem;
  transition: opacity 0.15s ease;
}

.kiosk-skeleton-table--exit {
  opacity: 0;
  pointer-events: none;
}

.kiosk-skeleton-table-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.kiosk-skeleton-table-row:nth-child(1) { --skel-i: 0; }
.kiosk-skeleton-table-row:nth-child(2) { --skel-i: 1; }
.kiosk-skeleton-table-row:nth-child(3) { --skel-i: 2; }
.kiosk-skeleton-table-row:nth-child(4) { --skel-i: 3; }
.kiosk-skeleton-table-row:nth-child(5) { --skel-i: 4; }
.kiosk-skeleton-table-row:nth-child(6) { --skel-i: 5; }

.kiosk-skeleton-table-row .dashboard-skeleton-bar {
  margin-bottom: 0;
  height: 0.85rem;
}

.kiosk-skeleton-table-row .dashboard-skeleton-bar:first-child {
  flex: 2 1 0;
  min-width: 0;
}

.kiosk-skeleton-table-row .dashboard-skeleton-bar:last-child {
  flex: 1 1 0;
  min-width: 0;
  max-width: 35%;
}

/* --- Dark theme --- */

html[data-theme="dark"] .dispenser-card.kiosk-skeleton-card {
  background: #242424;
  border-color: #3a3a3a;
}

html[data-theme="dark"] .kiosk-skeleton-group-item {
  background: #242424;
  border-color: #3a3a3a;
}

@media (prefers-reduced-motion: reduce) {
  .dispenser-grid.kiosk-skeleton-host--exit,
  .kiosk-skeleton-grid--exit,
  .kiosk-skeleton-groups--exit,
  .kiosk-skeleton-panel--exit,
  .kiosk-skeleton-table--exit {
    transition: none;
  }
}
