/* =========================================================================
   Selecting food items (Vandaag, Recent gelogd): a circle per item, a circle
   per meal heading, and the action bar at the bottom while something is
   selected (Kopiëren, Recept maken, Verwijderen, Toevoegen).
   Light theme overrides at the end of this file.
   ========================================================================= */

/* The selection circle: a 44px tap target around a 24px ring; selected it fills pink with a check. */
.tbm-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--tbm-on-pink);
    cursor: pointer;
}

.tbm-select__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 2px solid var(--tbm-border-strong);
    border-radius: var(--tbm-radius-pill);
    transition: background 0.15s, border-color 0.15s;
}

.tbm-select:focus-visible {
    outline: none;
}

.tbm-select:focus-visible .tbm-select__circle {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--tbm-pink) 45%, transparent);
}

.tbm-select.is-selected .tbm-select__circle,
.tbm-select.is-mixed .tbm-select__circle {
    border-color: var(--tbm-pink);
    background: var(--tbm-pink);
}

.tbm-select__circle .mud-icon-root {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}

.tbm-select__dash {
    width: 10px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}

/* A selectable row: the circle on the left, the rest of the row is still the link to the entry. */
.tbm-entry--selectable {
    gap: 0;
    padding: 0 12px 0 2px;
    transition: background 0.15s;
}

.tbm-entry--selectable.is-selected {
    background: color-mix(in srgb, var(--tbm-pink) 9%, transparent);
}

.tbm-entry__link {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
    min-width: 0;
    padding: 10px 0 10px 4px;
    color: inherit;
    text-decoration: none;
}

/* Meal heading: the circle in front of the title selects the whole meal. */
.tbm-meal__heading {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
}

.tbm-meal__select {
    margin-left: -10px;
}

/* The action bar: fixed at the bottom (above the bottom navigation on Vandaag), in the content column. */
.tbm-selection-bar {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1050;
    width: min(var(--tbm-content-width), 100%);
    max-width: calc(100% - 2 * var(--tbm-gutter));
    padding: 8px 10px 10px 14px;
    background: var(--tbm-panel);
    color: var(--tbm-text);
    border: 1px solid var(--tbm-border-strong);
    border-radius: var(--tbm-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateX(-50%);
}

.tbm-selection-bar--above-nav {
    bottom: calc(var(--tbm-bottom-nav-height) + env(safe-area-inset-bottom) + 8px);
}

.tbm-selection-bar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tbm-selection-bar__count {
    font-size: 1.15rem;
}

.tbm-selection-bar__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--tbm-radius-pill);
    background: none;
    color: var(--tbm-text-secondary);
    cursor: pointer;
}

.tbm-selection-bar__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.tbm-selection-bar__action {
    display: inline-flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 4px;
    border: 1px solid var(--tbm-border-strong);
    border-radius: var(--tbm-radius);
    background: transparent;
    color: var(--tbm-text);
    font-family: var(--tbm-font);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    cursor: pointer;
}

.tbm-selection-bar__action .mud-icon-root {
    width: 20px;
    height: 20px;
}

.tbm-selection-bar__action--danger {
    border-color: color-mix(in srgb, var(--tbm-error) 55%, transparent);
    color: var(--tbm-error);
}

.tbm-selection-bar__action:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Room under the last item, so the bar never covers it. */
.tbm-today--selecting {
    padding-bottom: 128px;
}

.tbm-recent--selecting {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
}

/* Eten toevoegen: "Mijn recepten" and "Recent gelogd" side by side. */
.tbm-add__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
}

.tbm-recent__list {
    overflow: hidden;
}

/* Light theme */
html[data-content-theme="light"] .tbm-selection-bar {
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(17, 17, 24, 0.2);
}

html[data-content-theme="light"] .tbm-entry--selectable.is-selected {
    background: color-mix(in srgb, var(--tbm-pink) 7%, transparent);
}
