﻿/* Shelvera Inventory bulk actions */

.entity-card {
    position: relative;
}

.entity-selection-control {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(19, 37, 75, 0.12);
    box-shadow: 0 12px 28px rgba(19, 37, 75, 0.14);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.entity-card:hover .entity-selection-control,
.entity-card:focus-within .entity-selection-control,
.entity-card.is-bulk-selected .entity-selection-control {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.entity-selection-control input {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.entity-selection-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.35rem;
    border: 2px solid rgba(78, 92, 130, 0.52);
    color: #ffffff;
    background: #ffffff;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

    .entity-selection-box::after {
        content: "";
        width: 0.38rem;
        height: 0.68rem;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg) translate(-1px, -1px) scale(0);
        transform-origin: center;
        transition: transform 160ms ease;
    }

.entity-selection-control input:checked + .entity-selection-box {
    background: var(--sv-primary);
    border-color: var(--sv-primary);
}

    .entity-selection-control input:checked + .entity-selection-box::after {
        transform: rotate(45deg) translate(-1px, -1px) scale(1);
    }

.entity-selection-control:focus-within {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.14), 0 12px 28px rgba(19, 37, 75, 0.14);
}


.entity-card.is-workspace-included {
    border-color: rgba(148, 163, 184, 0.46);
    background: rgba(248, 250, 252, 0.86);
}

    .entity-card.is-workspace-included .entity-card-primary {
        opacity: 0.82;
    }

    .entity-card.is-workspace-included .entity-selection-control {
        opacity: 1;
        cursor: not-allowed;
        transform: translateY(0) scale(1);
    }

    .entity-card.is-workspace-included .entity-selection-box {
        border-color: rgba(148, 163, 184, 0.72);
        background: #f1f5f9;
    }

.entity-workspace-included-badge {
    position: absolute;
    right: 0.82rem;
    bottom: 0.82rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.52rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.entity-bulk-toolbar.is-workspace-mode .entity-bulk-actions {
    flex-wrap: nowrap;
}

.entity-bulk-toolbar.is-workspace-mode [data-entity-bulk-review] {
    white-space: nowrap;
}

.entity-card.is-bulk-selected {
    z-index: 1 !important;
    border-color: rgba(47, 111, 237, 0.55);
    box-shadow: 0 18px 46px rgba(47, 111, 237, 0.18), 0 0 0 3px rgba(47, 111, 237, 0.10);
}

    .entity-card.is-bulk-selected .entity-card-primary {
        background: linear-gradient(135deg, rgba(47, 111, 237, 0.08), rgba(35, 184, 166, 0.07));
    }

/* =========================================================
   Shelvera reusable floating bottom action bar

   This section intentionally styles existing action bars using the same
   visual language so the pattern can be reused without changing working
   controller/service logic.

   Existing consumers:
   - Inventory multi-select: .entity-bulk-toolbar
   - Edit folder/item unsaved changes: .entity-edit-sticky-actions

   Future reusable classes:
   - .shelvera-floating-action-bar
   - .shelvera-floating-action-bar-summary
   - .shelvera-floating-action-bar-actions
   ========================================================= */

:root {
    --shelvera-floating-action-bar-max-width: 1120px;
    --shelvera-floating-action-bar-side-gap: 1rem;
    --shelvera-floating-action-bar-bottom-gap: 1rem;
    --shelvera-floating-action-bar-radius: 1.35rem;
    --shelvera-floating-action-bar-shadow: 0 18px 48px rgba(15, 23, 42, 0.16), 0 2px 0 rgba(255, 255, 255, 0.78) inset;
    --shelvera-floating-action-bar-height: 4.75rem;
    --shelvera-floating-action-bar-reserved-space: calc(var(--shelvera-floating-action-bar-height) + 2.75rem + env(safe-area-inset-bottom, 0px));
}

body.shelvera-floating-action-bar-active,
body.entity-edit-has-sticky-actions {
    scroll-padding-bottom: var(--shelvera-floating-action-bar-reserved-space);
}

    /*
 * Edit pages do not use the Inventory spacer below, so retain their existing
 * page-level bottom reservation. Inventory reserves space only at the actual
 * end of its content through .shelvera-floating-action-bar-spacer.
 */
    body.entity-edit-has-sticky-actions .app-page {
        padding-bottom: var(--shelvera-floating-action-bar-reserved-space);
    }

.shelvera-floating-action-bar-spacer {
    display: block;
    height: 0;
    pointer-events: none;
    visibility: hidden;
    transition: height 180ms ease;
}

body.shelvera-floating-action-bar-active .shelvera-floating-action-bar-spacer {
    height: var(--shelvera-floating-action-bar-reserved-space);
}

body.shelvera-floating-action-bar-active .entities-browser-card,
body.shelvera-floating-action-bar-active .entity-dashboard-content,
body.shelvera-floating-action-bar-active [data-entities-initial-content-region] {
    scroll-padding-bottom: var(--shelvera-floating-action-bar-reserved-space);
}

.entity-bulk-actions-root {
    position: relative;
    z-index: 12;
}

.entity-bulk-toolbar,
.entity-edit-sticky-actions,
.shelvera-floating-action-bar {
    position: fixed !important;
    left: max( var(--shelvera-floating-action-bar-side-gap), calc((100vw - var(--shelvera-floating-action-bar-max-width)) / 2) ) !important;
    right: max( var(--shelvera-floating-action-bar-side-gap), calc((100vw - var(--shelvera-floating-action-bar-max-width)) / 2) ) !important;
    bottom: calc(var(--shelvera-floating-action-bar-bottom-gap) + env(safe-area-inset-bottom, 0px)) !important;
    top: auto !important;
    /* Keep the floating bar above page content but below Bootstrap/custom modals. */
    z-index: 1040 !important;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 !important;
    padding: 0.74rem 0.86rem;
    min-height: 4.55rem;
    max-height: none !important;
    overflow: visible !important;
    border: 1px solid rgba(203, 213, 225, 0.86);
    border-radius: var(--shelvera-floating-action-bar-radius);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shelvera-floating-action-bar-shadow);
    opacity: 0;
    transform: translateY(calc(100% + 1.35rem)) scale(0.985);
    transform-origin: bottom center;
    pointer-events: none;
    transition: opacity 190ms ease, transform 210ms cubic-bezier(.2, .85, .2, 1), border-color 190ms ease, box-shadow 190ms ease;
}

    .entity-bulk-toolbar.is-visible,
    .entity-edit-sticky-actions.is-visible,
    .shelvera-floating-action-bar.is-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: auto;
    }

    .entity-bulk-toolbar[hidden],
    .shelvera-floating-action-bar[hidden] {
        display: none !important;
    }

/*
 * Floating action bars are page-level controls. They must never sit above
 * review drawers or the Move destination modal.
 */
body.entity-workspace-review-open .entity-bulk-toolbar,
body.entity-move-modal-open .entity-bulk-toolbar,
body.entity-move-modal-open .entity-edit-sticky-actions,
body.entity-move-modal-open .shelvera-floating-action-bar {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(calc(100% + 1.35rem)) scale(0.985) !important;
    pointer-events: none !important;
}

.entity-bulk-summary,
.entity-edit-sticky-copy,
.shelvera-floating-action-bar-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.entity-bulk-count-pill,
.shelvera-floating-action-count-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    background: #13254b;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.entity-edit-sticky-dot {
    width: 0.72rem;
    height: 0.72rem;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #f59e0b;
    box-shadow: 0 0 0 0.38rem rgba(245, 158, 11, 0.14);
}

.entity-bulk-copy,
.entity-edit-sticky-copy > div,
.shelvera-floating-action-bar-copy {
    min-width: 0;
}

    .entity-bulk-copy strong,
    .entity-edit-sticky-copy strong,
    .shelvera-floating-action-bar-copy strong {
        display: block;
        color: var(--sv-text);
        font-family: "Montserrat", "Inter", sans-serif;
        font-size: 0.96rem;
        font-weight: 800;
        line-height: 1.2;
        letter-spacing: -0.01em;
    }

    .entity-bulk-copy span,
    .entity-edit-sticky-copy span:not(.entity-edit-sticky-dot),
    .shelvera-floating-action-bar-copy span {
        display: block;
        margin-top: 0.13rem;
        color: var(--sv-text-muted);
        font-size: 0.84rem;
        font-weight: 500;
        line-height: 1.35;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.entity-bulk-actions,
.entity-edit-sticky-buttons,
.shelvera-floating-action-bar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex: 0 0 auto;
    flex-wrap: wrap;
}

.entity-bulk-action-button,
.shelvera-floating-action-button {
    border: 0;
    border-radius: 999px;
    padding: 0.72rem 1rem;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

    .entity-bulk-action-button:not(:disabled):hover,
    .shelvera-floating-action-button:not(:disabled):hover {
        transform: translateY(-1px);
    }

    .entity-bulk-action-button:disabled,
    .shelvera-floating-action-button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.entity-bulk-action-secondary,
.shelvera-floating-action-secondary {
    background: #eef2ff;
    color: #243b73;
}

    .entity-bulk-action-secondary:not(:disabled):hover,
    .shelvera-floating-action-secondary:not(:disabled):hover {
        background: #e0e7ff;
    }

.entity-bulk-action-primary,
.shelvera-floating-action-primary {
    background: var(--sv-primary);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(19, 37, 75, 0.20);
}

    .entity-bulk-action-primary:not(:disabled):hover,
    .shelvera-floating-action-primary:not(:disabled):hover {
        box-shadow: 0 16px 30px rgba(19, 37, 75, 0.26);
    }

.entity-bulk-action-danger,
.shelvera-floating-action-danger {
    background: #c42f50;
    color: #ffffff;
    box-shadow: 0 12px 26px rgba(196, 47, 80, 0.22);
}

    .entity-bulk-action-danger:not(:disabled):hover,
    .shelvera-floating-action-danger:not(:disabled):hover {
        background: #ae2644;
        box-shadow: 0 16px 32px rgba(196, 47, 80, 0.28);
    }

.entity-edit-sticky-buttons .btn {
    border-radius: 999px;
    min-width: 9.25rem;
    padding: 0.73rem 1rem;
    font-weight: 800;
}

.entity-bulk-status {
    margin: -0.25rem 0 1rem;
    padding: 0.6rem 0.8rem;
    border-radius: 14px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.84rem;
    font-weight: 600;
}

    .entity-bulk-status[hidden] {
        display: none !important;
    }

@media (max-width: 767.98px) {
    :root {
        --shelvera-floating-action-bar-side-gap: 0.75rem;
        --shelvera-floating-action-bar-bottom-gap: 0.75rem;
    }

    :root {
        --shelvera-floating-action-bar-reserved-space: calc(var(--shelvera-floating-action-bar-height) + 2.25rem + env(safe-area-inset-bottom, 0px));
    }

    body.entity-edit-has-sticky-actions .app-page {
        padding-bottom: var(--shelvera-floating-action-bar-reserved-space);
    }

    .entity-selection-control {
        opacity: 1;
        transform: none;
    }

    .entity-bulk-toolbar,
    .entity-edit-sticky-actions,
    .shelvera-floating-action-bar {
        align-items: stretch;
        flex-direction: column;
        border-radius: 1.35rem;
        padding: 0.82rem;
        min-height: auto;
    }

    .entity-bulk-summary,
    .entity-edit-sticky-copy,
    .shelvera-floating-action-bar-summary {
        align-items: flex-start;
    }

        .entity-bulk-copy span,
        .entity-edit-sticky-copy span:not(.entity-edit-sticky-dot),
        .shelvera-floating-action-bar-copy span {
            white-space: normal;
        }

    .entity-bulk-actions,
    .entity-edit-sticky-buttons,
    .shelvera-floating-action-bar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

        .entity-bulk-action-button,
        .entity-edit-sticky-buttons .btn,
        .shelvera-floating-action-button {
            width: 100%;
            min-width: 0;
        }

    .entity-bulk-action-secondary[data-entity-bulk-clear] {
        grid-column: span 2;
    }

    .entity-bulk-toolbar.is-workspace-mode .entity-bulk-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .entity-bulk-toolbar.is-workspace-mode [data-entity-bulk-clear] {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .entity-bulk-toolbar,
    .entity-edit-sticky-actions,
    .shelvera-floating-action-bar {
        transition: opacity 120ms ease;
        transform: none;
    }

        .entity-bulk-toolbar.is-visible,
        .entity-edit-sticky-actions.is-visible,
        .shelvera-floating-action-bar.is-visible {
            transform: none;
        }
}

/* =========================================================
   Entities selection basket - Phase 1 Move only
   ========================================================= */

.entities-workspace-selection-toggle {
    border: 1px solid rgba(47, 111, 237, 0.20);
    border-radius: 999px;
    padding: 0.72rem 1rem;
    background: #eef2ff;
    color: #243b73;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

    .entities-workspace-selection-toggle:hover,
    .entities-workspace-selection-toggle:focus-visible {
        background: #e0e7ff;
        border-color: rgba(47, 111, 237, 0.34);
        box-shadow: 0 10px 22px rgba(47, 111, 237, 0.14);
        transform: translateY(-1px);
    }

    .entities-workspace-selection-toggle.is-active {
        background: #13254b;
        border-color: #13254b;
        color: #ffffff;
        box-shadow: 0 14px 28px rgba(19, 37, 75, 0.22);
    }

.entity-workspace-selection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(47, 111, 237, 0.18);
    border-radius: 1.15rem;
    background: linear-gradient(135deg, rgba(47, 111, 237, 0.10), rgba(35, 184, 166, 0.10));
    color: var(--sv-text);
}

    .entity-workspace-selection-banner[hidden] {
        display: none !important;
    }

    .entity-workspace-selection-banner strong {
        display: block;
        font-family: "Montserrat", "Inter", sans-serif;
        font-size: 0.96rem;
        font-weight: 800;
        line-height: 1.2;
    }

    .entity-workspace-selection-banner span {
        display: block;
        margin-top: 0.16rem;
        color: var(--sv-text-muted);
        font-size: 0.86rem;
        font-weight: 600;
        line-height: 1.35;
    }

.entity-workspace-selection-exit {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    padding: 0.62rem 0.88rem;
    background: #ffffff;
    color: #243b73;
    font-size: 0.84rem;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(19, 37, 75, 0.10);
}

.entity-workspace-selection-active .entity-selection-control {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.entity-bulk-toolbar.is-workspace-mode {
    border-color: rgba(47, 111, 237, 0.34);
    box-shadow: 0 20px 54px rgba(47, 111, 237, 0.20), 0 2px 0 rgba(255, 255, 255, 0.78) inset;
}

.entity-bulk-action-button[hidden] {
    display: none !important;
}

.entity-workspace-review-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.34);
    opacity: 0;
    transition: opacity 160ms ease;
}

    .entity-workspace-review-backdrop.is-visible {
        opacity: 1;
    }

    .entity-workspace-review-backdrop[hidden] {
        display: none !important;
    }

.entity-workspace-review-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1060;
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: min(100vw, 480px);
    background: #ffffff;
    box-shadow: -22px 0 54px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    transition: transform 210ms cubic-bezier(.2, .85, .2, 1);
}

    .entity-workspace-review-drawer.is-visible {
        transform: translateX(0);
    }

    .entity-workspace-review-drawer[hidden] {
        display: none !important;
    }

.entity-workspace-review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.72);
}

    .entity-workspace-review-header h3 {
        margin: 0.22rem 0 0;
        color: var(--sv-text);
        font-family: "Montserrat", "Inter", sans-serif;
        font-size: 1.28rem;
        font-weight: 850;
        letter-spacing: -0.02em;
    }

    .entity-workspace-review-header p {
        margin: 0.35rem 0 0;
        color: var(--sv-text-muted);
        font-size: 0.9rem;
        font-weight: 600;
        line-height: 1.4;
    }

.entity-workspace-review-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 1.4rem;
    line-height: 1;
}

.entity-workspace-review-body {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem 1.25rem;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.entity-workspace-review-empty {
    padding: 1rem;
    border: 1px dashed rgba(148, 163, 184, 0.75);
    border-radius: 1rem;
    color: var(--sv-text-muted);
    font-weight: 700;
    text-align: center;
}

.entity-workspace-review-group {
    margin-bottom: 1rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 1.1rem;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.entity-workspace-review-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border-bottom: 1px solid rgba(203, 213, 225, 0.66);
}

    .entity-workspace-review-group-heading h4 {
        margin: 0;
        color: var(--sv-text);
        font-family: "Montserrat", "Inter", sans-serif;
        font-size: 0.95rem;
        font-weight: 850;
        line-height: 1.25;
    }

    .entity-workspace-review-group-heading span {
        flex: 0 0 auto;
        color: var(--sv-text-muted);
        font-size: 0.78rem;
        font-weight: 800;
    }

.entity-workspace-review-items {
    display: grid;
    gap: 0;
}

.entity-workspace-review-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.72rem;
    padding: 0.78rem 0.9rem;
}

    .entity-workspace-review-item + .entity-workspace-review-item {
        border-top: 1px solid rgba(226, 232, 240, 0.88);
    }

.entity-workspace-review-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.8rem;
    background: #eef2ff;
    font-size: 1.05rem;
}

.entity-workspace-review-item-copy {
    min-width: 0;
}

    .entity-workspace-review-item-copy strong {
        display: block;
        overflow: hidden;
        color: var(--sv-text);
        font-size: 0.92rem;
        font-weight: 850;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .entity-workspace-review-item-copy span {
        display: block;
        margin-top: 0.14rem;
        color: var(--sv-text-muted);
        font-size: 0.78rem;
        font-weight: 650;
        line-height: 1.25;
    }

.entity-workspace-review-remove {
    border: 0;
    border-radius: 999px;
    padding: 0.42rem 0.62rem;
    background: #fff1f2;
    color: #be123c;
    font-size: 0.78rem;
    font-weight: 850;
}

.entity-workspace-review-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(203, 213, 225, 0.72);
    background: rgba(255, 255, 255, 0.96);
}

.entity-workspace-review-action-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 767.98px) {
    .entities-workspace-selection-toggle {
        width: 100%;
        justify-content: center;
    }

    .entity-workspace-selection-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .entity-workspace-selection-exit {
        width: 100%;
    }

    .entity-workspace-review-drawer {
        width: 100vw;
    }

    .entity-workspace-review-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .entity-workspace-review-action-group {
        align-items: stretch;
        flex-direction: column-reverse;
        width: 100%;
    }

    .entity-workspace-review-footer .entity-bulk-action-button {
        width: 100%;
    }
}