/*************************/
/*** INVENTORY PICK RUN ***/
/*************************/

/* Item name, location name, and the "Pick/Stock Quantity" line all reuse the shared
   .wf-card-description class so they stay visually identical, but that class is also used
   by the (differently-proportioned) workflow step cards - scoped larger here via the
   inventory-only .pick-card-item ancestor instead of editing the shared rule. */
.pick-card-item .wf-card-description {
    font-size: clamp(1.35rem, 3.6vh, 2.5rem) !important;
}

.pick-item-description {
    font-size: clamp(1rem, 2.2vh, 1.5rem) !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Item name + description read as a single tight-knit group; the .wf-card-text gap below
   (scoped to inventory pick cards only) then gives the group, location, and quantity line
   a slightly larger gap between each other. */
.pick-item-heading {
    display: flex;
    flex-direction: column;
    gap: clamp(0px, 0.2vh, 2px);
}

.pick-card .wf-card-text {
    gap: clamp(10px, 1.4vh, 20px);
}

/* Restores the original muted look for the location name and bold weight for the quantity
   line, now that both reuse .wf-card-description for consistent sizing with the item name. */
.pick-location-name {
    color: #000;
}

.pick-qty-line {
    font-weight: 700;
}

/* Reserves the image region even though no item images exist yet */
.pick-image-placeholder {
    flex: 1 1 0;
    width: 100%;
    min-height: 0;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

/* .wf-card sets cursor: pointer; pick cards are not clickable */
.pick-card {
    cursor: default;
}

/* While simply parked on the step (not yet completed, not yet failed): a static scrollbar-gray
   outline, no flashing/pulsating - reserve colour + animation for success/error feedback. */
.wf-card.pick-card--neutral {
    border-color: #c1c1c1;
}

/* With a location visual: left column is the location reference image + zone overlay,
   right column stacks item image over item info, split evenly 50/50. Without one (no
   reference image for this step's location), the card falls back untouched to the original
   .wf-card--horizontal default (text left, item image right). */
.wf-card--horizontal.pick-card.pick-card--with-visualizer {
    grid-template-columns: 1fr 1fr;
}

.pick-card-item {
    display: grid;
    grid-template-rows: minmax(0, 55fr) minmax(0, 45fr);
    row-gap: clamp(8px, 1.5vh, 16px);
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.08);
    padding-left: clamp(4px, 0.5vw, 8px);
}

.pick-card--with-visualizer .wf-card-image {
    min-height: 0;
    padding-left: 0;
    justify-content: flex-end;
}

.pick-card--with-visualizer .wf-card-text {
    min-height: 0;
    border-right: none;
    justify-content: flex-start;
}

.pick-card-visualizer {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: clamp(4px, 0.5vw, 8px);
}

/* The component's own root - must fill .pick-card-visualizer's space so the frame's
   max-height:100% below has something definite to resolve against. Without this, a wide/
   rectangular reference image renders near its native resolution instead of being capped
   to the card. */
.inv-zone-visualizer {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    container-type: size;
}

.inv-zone-visualizer-frame {
    position: relative;
    display: inline-block; /* shrink-wraps to the <img>'s rendered box so % overlay math stays correct */
    max-width: 100%;
    max-height: 100%;
}

.inv-zone-visualizer-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 4px;
}

.inv-zone-visualizer .inv-zone-visualizer-image {
    max-width: 100cqw;
    max-height: 100cqh;
}

.inv-zone-visualizer-placeholder {
    flex: 1 1 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

.inv-zone-overlay {
    position: absolute;
    box-sizing: border-box;
    border-radius: 4px;
    pointer-events: none;
    border: 2px solid transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.inv-zone-overlay--active {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.2);
    border-color: rgba(var(--mud-palette-primary-rgb), 0.9);
}

.inv-zone-overlay--completed {
    background-color: rgba(var(--mud-palette-success-rgb), 0.2);
    border-color: rgba(var(--mud-palette-success-rgb), 0.9);
}

.inv-zone-overlay--error {
    background-color: rgba(var(--mud-palette-error-rgb), 0.25);
    border-color: rgba(var(--mud-palette-error-rgb), 0.9);
}

@keyframes inv-zone-overlay-pulse {
    50% { opacity: 0.45; }
}

.inv-zone-overlay--pulsating {
    animation: inv-zone-overlay-pulse 1s ease-in-out infinite;
}

/* Error state flashes colour intensity instead of fading opacity, so the wrong zone reads
   as an actual red flash rather than a subtle dim - overrides the generic opacity pulse above
   via the two-class selector's higher specificity. */
@keyframes inv-zone-overlay-error-flash {
    0%, 100% {
        background-color: rgba(var(--mud-palette-error-rgb), 0.15);
        border-color: rgba(var(--mud-palette-error-rgb), 0.5);
    }
    50% {
        background-color: rgba(var(--mud-palette-error-rgb), 0.65);
        border-color: rgba(var(--mud-palette-error-rgb), 1);
    }
}

.inv-zone-overlay--error.inv-zone-overlay--pulsating {
    animation: inv-zone-overlay-error-flash 1s ease-in-out infinite;
}

/* Full-viewport error indicator for EnableInventoryManagementFlowErrorMessage - a border only
   (not a solid/translucent fill) so the location image's zone overlay stays the focal point
   for "where" the mistake happened. Reuses visualizer.css's flashRed keyframe. */
.inv-fullscreen-error-border {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    box-sizing: border-box;
    border-style: solid;
    border-width: clamp(0.5rem, 1.5vw, 1.25rem);
    animation: flashRed 1s infinite;
}

/* Gives the calibration image a real, generous height budget instead of shrink-wrapping
   to whatever the source photo's native resolution happens to produce - mirrors
   CalibrateInstructionZonesWizard's fixed-height visualizer container, but as a clamp()
   range per the responsive-sizing convention rather than a hard pixel value. Scoped to
   the calibration dialog only - the run-screen InventoryLocationZoneVisualizer keeps its
   existing sizing (governed by its own card layout) untouched. */
.inv-zone-drawer-frame-wrapper {
    height: clamp(220px, 55vh, 640px);
}

.inv-zone-drawer {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.inv-zone-drawer .inv-zone-visualizer-frame {
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
}

.inv-zone-drawer-image {
    cursor: crosshair;
}

/* Matches LocationView's GeometryVisualizer.js: fixed 0.15 fill opacity (not per-zone),
   plus a 3-layer border glow (darkened inner line, brightened mid glow, brightest outer
   glow) - approximated here with stacked box-shadow rings since CSS has no direct
   equivalent to layered 3D LineSegments. Same class for both the live in-progress preview
   and the finalized rectangle, matching LocationView's own identical-material behavior. */
.inv-zone-overlay--drawn {
    position: absolute;
    box-sizing: border-box;
    border-radius: 2px;
    pointer-events: none;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.15);
    border: 2px solid rgba(var(--mud-palette-primary-rgb), 1);
    box-shadow:
        0 0 0 3px rgba(var(--mud-palette-primary-rgb), 0.8),
        0 0 0 6px rgba(var(--mud-palette-primary-rgb), 0.5);
}
