/* FoodServe Admin reusable utilities.

   Utilities solve one small, repeatable concern and should compose with components.
   Do not build page layouts or full component variants here; those belong in
   components.css or the owning page stylesheet. */

/* Retained for legacy/non-card elements that need the standard elevation only.
   New cards and app bars receive their shadow from components.css automatically. */
.foodserve-shadow {
    box-shadow: var(--fs-shadow-md);
}

/* Shared clear affordance for Admin search fields, including narrow/mobile layouts. */
.fs-search-clear-host {
    position: relative;
    min-width: 0;
}

.fs-search-clear-host > input[type="search"],
.fs-search-clear-host > input.fs-search-input {
    padding-right: 2.5rem !important;
}

.fs-search-clear-host > input[type="search"]::-webkit-search-cancel-button {
    appearance: none;
}

.fs-search-clear {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: .45rem;
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--fs-color-text-muted);
    font: inherit;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.fs-search-clear:hover {
    background: rgba(107, 114, 128, .12);
    color: var(--fs-color-text-emphasis);
}

.fs-search-clear:focus-visible {
    outline: 2px solid var(--fs-color-focus);
    outline-offset: 1px;
}

.fs-search-clear svg {
    width: .9rem;
    height: .9rem;
}

/* Shared decorative animation retained for existing icon interactions. Do not use
   it for essential status feedback because motion may be disabled by the user. */
@keyframes swing {
    0%,30%,50%,70%,100% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(10deg);
    }

    40% {
        transform: rotate(-10deg);
    }

    60% {
        transform: rotate(5deg);
    }

    80% {
        transform: rotate(-5deg);
    }
}

/* Full-viewport blocking overlay. Prefer the lighter .fs-loading/.fs-spin pattern
   when the user can continue interacting with the rest of the page. */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--fs-color-overlay);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Shared status badge colour variants used by DataAction grids and order details.
   These rules supply semantic colour only; the consuming badge owns base geometry.
   !important is intentional because several consumers include vendor badge styles. */
.fs-status-badge--success {
    background: var(--fs-color-success-bg) !important;
    color: var(--fs-color-success-text) !important;
    border: 1px solid var(--fs-color-success-border) !important;
}

.fs-status-badge--secondary {
    background: var(--fs-color-surface-muted) !important;
    color: var(--fs-color-text-muted) !important;
    border: 1px solid var(--fs-color-border) !important;
}

.fs-status-badge--danger {
    background: var(--fs-color-danger-bg) !important;
    color: var(--fs-color-danger-text) !important;
    border: 1px solid var(--fs-color-danger-border) !important;
}

.fs-status-badge--warning {
    background: var(--fs-color-warning-bg) !important;
    color: var(--fs-color-warning-text) !important;
    border: 1px solid var(--fs-color-warning-border) !important;
}

.fs-status-badge--info {
    background: var(--fs-color-info-bg) !important;
    color: var(--fs-color-info-text) !important;
    border: 1px solid var(--fs-color-info-border) !important;
}
