/* What the Lager map scripts (wwwroot/js/maps) create themselves — canvas, labels, pins — outside any component's
   CSS scope, shared by the viewer and the editor. */

.wm-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    outline: none;
}

.wm-labels {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.wm-label {
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.86);
    color: var(--text-ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16, 40, 64, 0.14);
    user-select: none;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.26s ease;
}

.wm-label-area {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-muted);
    font-weight: 500;
}

/* The shelf or area under the pointer (warehouse-map-focus.js drawHover). CSS2DRenderer owns the transform, so the
   label is lit by colour and a ring that pulses in the same rhythm as the highlight in the scene (1.25 s). */
.wm-label.is-hovered,
.wm-label.is-selected {
    background: #2563eb;
    color: #fff;
    animation: wm-label-pulse 1.25s ease-in-out infinite;
}

@keyframes wm-label-pulse {
    0%, 100% { box-shadow: 0 1px 2px rgba(16, 40, 64, 0.14), 0 0 0 0 rgba(37, 99, 235, 0.35); }
    50% { box-shadow: 0 1px 2px rgba(16, 40, 64, 0.14), 0 0 0 5px rgba(37, 99, 235, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .wm-label.is-hovered,
    .wm-label.is-selected {
        animation: none;
    }
}

/* The picture above a picked bay (warehouse-map-focus.js drawSelection): what lies there, framed in the colour of
   its stock — green right, yellow below minimum, red nothing free, grey without Sollbestand. The same colours as the
   card below the map (WarehouseMapView.razor.css). */
.wm-pic {
    --wm-pic-frame: #94a3b8;
    position: relative;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 2px;
    border: 3px solid var(--wm-pic-frame);
    border-radius: 10px;
    background: #fff;
    color: var(--text-muted);
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(16, 40, 64, 0.28);
    pointer-events: none;
    user-select: none;
}

.wm-pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wm-pic.is-loaded img {
    opacity: 1;
}

.wm-pic.is-ok { --wm-pic-frame: #16a34a; }
.wm-pic.is-low { --wm-pic-frame: #eab308; }
.wm-pic.is-empty { --wm-pic-frame: #dc2626; }
.wm-pic.is-committed { --wm-pic-frame: #d97706; }

.wm-pic-more {
    position: absolute;
    right: -8px;
    bottom: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--text-ink);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.wm-label-entrance,
.wm-marker-start {
    background: #16a34a;
    color: #fff;
}

.wm-marker-text {
    background: none;
    box-shadow: none;
    color: var(--text-muted);
}

.wm-pin {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #fff;
    color: var(--accent-color);
    border: 2px solid currentColor;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(16, 40, 64, 0.25);
}

.wm-pin.is-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.wm-pin-start {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
    font-weight: 600;
}

.wm-tag {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    background: #fff;
    color: #3f7d8c;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(16, 40, 64, 0.2);
}

/* The editor's box at the pointer: what a click does there, the measure on top. Placed by the script beside the
   pointer and kept inside the drawing; never in the way of a click. */
.wm-cursor-tip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 4;
    padding: 6px 10px;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    pointer-events: none;
}

.wm-cursor-tip .is-strong {
    font-size: 14px;
    font-weight: 700;
}

.wm-cursor-tip[hidden],
.wm-confirm-bar[hidden] {
    display: none;
}

/* Finishing a wall chain on a touch screen, which has no Enter key: centred at the bottom of the drawing. */
.wm-confirm-bar {
    position: absolute;
    left: 50%;
    bottom: 48px;
    z-index: 4;
    display: flex;
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    background: var(--menu-surface);
    backdrop-filter: var(--menu-backdrop);
    box-shadow: var(--menu-shadow);
    transform: translateX(-50%);
}

.wm-confirm-bar button {
    min-width: 120px;
    height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: var(--text-ink);
    font-size: var(--fs-base);
    font-weight: 600;
}

.wm-confirm-bar button.is-primary {
    background: var(--accent-color);
    color: #fff;
}
