/* MudBlazor does the styling. This covers what shows before it loads (the loading
   indicator, in the same dark colours as the app) and Blazor's error bar. */

html, body {
    margin: 0;
    background: #121316;
    color: #e6e6e6;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1:focus {
    outline: none;
}

.loading-logo {
    position: absolute;
    display: block;
    width: 9rem;
    inset: 12vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 4rem;
    height: 4rem;
    inset: calc(12vh + 13.5rem) 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #2a2d33;
        stroke-width: 0.5rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #66bb6a;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    inset: calc(12vh + 18rem) 0 auto 0.2rem;
    font-size: 0.875rem;
    color: #9e9e9e;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

#blazor-error-ui {
    background: #5c1f1f;
    color: #fff;
    bottom: 0;
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

    #blazor-error-ui a {
        color: #ffb74d;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.6rem;
    }

/* ---- List screen ---------------------------------------------------------
   Sized for one hand in a store: big rows, a generous checkbox area, and an
   add bar pinned above the keyboard. */

.list-page {
    padding-bottom: 8.5rem; /* clears the add bar */
    transform: translateY(var(--allo-pull, 0px));
    transition: transform 0.15s ease-out;
}

.list-selectors {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0 0.5rem;
}

    .list-selectors > * {
        flex: 1;
    }

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0.25rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.entry-row {
    display: flex;
    align-items: center;
    min-height: 3rem;
    gap: 0.25rem;
}

.entry-body {
    flex: 1;
    padding: 0.5rem 0.25rem;
    cursor: pointer;
    min-width: 0;
}

.entry-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-checked .entry-body {
    opacity: 0.5;
    text-decoration: line-through;
}

.empty-state {
    padding: 4rem 1rem;
}

.clear-checked {
    display: flex;
    justify-content: center;
    padding: 1rem 0 0;
}

/* ---- Add bar ---- */

.add-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.5rem max(0.75rem, env(safe-area-inset-left)) calc(0.5rem + env(safe-area-inset-bottom));
    background: #1b1d21;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1200;
}

.add-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .add-input > .mud-input-control {
        flex: 1;
    }

.add-suggestions {
    max-height: 13rem;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

.add-suggestion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

    .add-suggestion:active {
        background: rgba(255, 255, 255, 0.08);
    }

.add-feedback {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.25rem 0.25rem;
}

/* ---- Dialogs and manage screens ---- */

.quantity-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-value {
    min-width: 2.5rem;
    text-align: center;
}

.unit-select {
    flex: 1;
}

.manage-row {
    display: flex;
    align-items: center;
    min-height: 3rem;
    padding: 0.25rem 0.5rem 0.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.manage-row-child {
    padding-left: 2.5rem;
}

.manage-row:last-child {
    border-bottom: none;
}

.store-pill,
.store-pill-preview {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border: 1px solid currentColor;
    border-radius: 1rem;
    font-size: 0.7rem;
    line-height: 1.25rem;
    white-space: nowrap;
    color: var(--mud-palette-primary);
}

.store-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.colour-preview {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.colour-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .colour-row > .mud-input-control {
        flex: 1;
    }

.colour-swatch {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.25rem;
}

/* The colour popup sized itself to the spectrum and scrolled its Done button out of
   sight on a phone. Let it grow to fit, up to most of the screen. */
.mud-picker-paper {
    height: auto;
    max-height: 90vh;
}

/* Popovers (the colour picker, selects) open from inside dialogs, which sit at 1402-1403.
   Without this they render under the dialog that opened them. !important because the
   z-index comes from an inline style. */
.mud-popover-provider .mud-popover {
    z-index: 1500 !important;
}

/* "In the cart": below the live list, dimmed, with its own heading. Still grouped by
   category so it can be checked over before the till. */
.checked-section {
    margin-top: 1.5rem;
    padding-top: 0.5rem;
    border-top: 2px solid rgba(255, 255, 255, 0.12);
    opacity: 0.75;
}

.checked-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25rem 0.25rem 0;
}

/* Tags: small and under the name, so they never crowd the item itself. */
.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.15rem;
}

.tag-chip {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.09);
    color: var(--mud-palette-text-secondary);
    font-size: 0.68rem;
    line-height: 1.15rem;
    white-space: nowrap;
}

.tag-filter {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding: 0 0.25rem 0.5rem;
    scrollbar-width: none;
}

    .tag-filter::-webkit-scrollbar {
        display: none;
    }

.tag-filter-chip {
    flex: 0 0 auto;
    padding: 0.2rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    font-size: 0.78rem;
    white-space: nowrap;
    cursor: pointer;
}

.tag-filter-chip.selected {
    border-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary);
    background: rgba(102, 187, 106, 0.12);
}

.tag-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-suggestion {
    cursor: pointer;
}
