/* Laird Layout — responsive AppLayout styles */

/* ── Navbar ── */
.laird-layout .navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
}

.laird-layout .navbar-brand-icon {
    color: var(--lumo-primary-color);
    font-size: 20px;
}

.laird-layout .navbar-brand-text {
    color: var(--lumo-primary-contrast-color);
}

/* ── Drawer ── */
.laird-layout [slot="drawer"] {
    background: var(--lumo-base-color);
    border-right: 1px solid var(--lumo-contrast-10pct);
}

/* Drawer header */
.laird-layout .drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--lumo-contrast-10pct);
}

.laird-layout .drawer-header-icon {
    color: var(--lumo-primary-color);
    font-size: 24px;
}

.laird-layout .drawer-header-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--lumo-primary-contrast-color);
}

/* Navigation section */
.laird-layout .drawer-nav {
    padding: 8px 0;
}

.laird-layout .drawer-nav-label {
    padding: 8px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lumo-contrast-50pct);
}

/* Nav links */
.laird-layout .drawer-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--lumo-body-text-color);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.laird-layout .drawer-nav-link:hover {
    background: var(--lumo-contrast-5pct);
}

.laird-layout .drawer-nav-link[highlight] {
    background: var(--lumo-primary-color-10pct);
    color: var(--lumo-primary-color);
    font-weight: 600;
}

.laird-layout .drawer-nav-link[highlight]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--lumo-primary-color);
}

.laird-layout .drawer-nav-link vaadin-icon {
    font-size: 18px;
    min-width: 20px;
}

/* Drawer footer */
.laird-layout .drawer-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--lumo-contrast-10pct);
}

.laird-layout .drawer-footer-text {
    font-size: 12px;
    color: var(--lumo-contrast-50pct);
}

.big-text {
    font-weight: bold;
    font-size: xxx-large;
}


/* ── Materials grid — rows with unsaved edits (the update batch) ── */
vaadin-grid::part(dirty-row) {
    background-color: rgba(245, 158, 11, 0.15);
}

/* ── Mix & Match — the row that is the cross-filter source (owning grid) ── */
vaadin-grid::part(cross-selected-row) {
    background-color: rgba(132, 204, 22, 0.5);
}

/* ── Mix & Match — 3-column view locked to the viewport ── */
.mix-match-view    { height: 100%; overflow: hidden; }             /* kills page scroll */
.mix-match-content { min-height: 0; overflow: hidden; }            /* row shrinks -> grids scroll */
.mix-match-column  { min-width: 0; min-height: 0; overflow: hidden; }
.mix-match-column > vaadin-grid { min-height: 0; }                 /* definite height -> internal scroll */
.mix-match-status  { height: 20px; line-height: 20px; flex-shrink: 0;
                     white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Mix & Match — title-bar actions ──
   "Reset Filters" is the one command, the Hide/Show buttons are view state — a
   hairline rule between the two so the reset never reads as another toggle.

   Everything goes through Lumo's own --vaadin-button-tertiary-* knobs. Setting
   `background`/`border` on the host would NOT work: Lumo declares
   `background: var(--vaadin-button-tertiary-background, transparent) !important`
   on :host([theme~=tertiary]), so a plain background rule is silently dropped.
   Custom properties inherit into the shadow tree, so they win *and* the
   :hover / [active] / [focus-ring] states keep working. No box-shadow either —
   an outer-document box-shadow outranks Lumo's :host([focus-ring]) ring and
   would kill the keyboard focus outline. */
.mix-match-title-divider  { width: 1px; height: 22px; flex: 0 0 auto;
                            background: var(--lumo-contrast-15pct); }

/* Hide/Show column toggles — neutral outline, reads as view state */
.mix-match-toggle         { --vaadin-button-border-radius: 999px;
                            --vaadin-button-tertiary-padding: 0 14px;
                            --vaadin-button-tertiary-background: transparent;
                            --vaadin-button-tertiary-text-color: var(--lumo-body-text-color);
                            --vaadin-button-tertiary-border: 1px solid var(--lumo-contrast-20pct);
                            transition: background .15s, border-color .15s; }
.mix-match-toggle:hover   { --vaadin-button-tertiary-background: var(--lumo-contrast-5pct);
                            --vaadin-button-tertiary-border-color: var(--lumo-contrast-30pct); }
.mix-match-toggle[active] { --vaadin-button-tertiary-background: var(--lumo-contrast-10pct); }

/* Reset Filters — the accented action, without stealing the bin's primary Load */
.mix-match-reset          { --vaadin-button-border-radius: 999px;
                            --vaadin-button-tertiary-padding: 0 14px;
                            --vaadin-button-tertiary-background: transparent;
                            --vaadin-button-tertiary-text-color: var(--lumo-primary-text-color);
                            --vaadin-button-tertiary-border: 1px solid var(--lumo-primary-color-50pct);
                            transition: background .15s, border-color .15s; }
.mix-match-reset:hover    { --vaadin-button-tertiary-background: var(--lumo-primary-color-10pct);
                            --vaadin-button-tertiary-border-color: var(--lumo-primary-color); }
.mix-match-reset[active]  { --vaadin-button-tertiary-background: var(--lumo-primary-color-20pct); }

/* ── Mix & Match — reserved filter area ──
   One fixed height for all three columns (2 x 64px field decks + 8px gap) so the
   Materials (5 filters) and Products (3) columns cannot wrap and the three
   grids still start on the same line. `justify-content: flex-end` drops the
   filter-free PCS column's Load to the bottom row, same as the others. */
.mix-match-filters   { width: 100%; height: 136px; flex-shrink: 0; padding: 0;
                       justify-content: flex-end; gap: 8px; }
.mix-match-filter-row{ width: 100%; min-width: 0; flex: 0 0 auto;
                       flex-wrap: nowrap; gap: 8px; }

/* ── Mix & Match — the top bin, styled as an AI prompt/search bar ──
   One rounded shell holding the staged-row chips; a soft border that warms up
   on hover/focus is the whole "AI bar" cue — no gradients over the chips.
   Padding and gaps are set inline in the DSL (isPadding/isSpacing also write
   inline styles, which would otherwise win over this file). */
.mix-match-bin            { width: 100%; flex-shrink: 0; min-height: 52px;
                            border: 1px solid var(--lumo-contrast-15pct);
                            border-radius: 26px;
                            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
                            box-shadow: 0 1px 2px rgba(15, 23, 42, .04),
                                        0 10px 24px -18px rgba(15, 23, 42, .45);
                            transition: border-color .15s ease, box-shadow .15s ease; }
.mix-match-bin:hover      { border-color: var(--lumo-primary-color-50pct); }
.mix-match-bin:focus-within { border-color: var(--lumo-primary-color);
                              box-shadow: 0 0 0 3px var(--lumo-primary-color-10pct); }

/* Single line of chips — crowded bins scroll sideways instead of growing the bar */
.mix-match-bin-chips      { flex: 1 1 auto; min-width: 0; height: 36px;
                            flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.mix-match-bin-icon       { flex: 0 0 auto; color: var(--lumo-primary-color); }
.mix-match-bin-empty      { color: var(--lumo-secondary-text-color); font-size: .85rem; }

/* ── Staged-row chips — one color per catalog ──
   Teal is deliberately left free: it is reserved for the derived-value
   highlighting that is still to come. */
.mix-match-chip           { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px;
                            border: 1px solid transparent; border-radius: 999px;
                            padding: 3px 4px 3px 10px;
                            font-size: .78rem; font-weight: 500; white-space: nowrap; }
.mix-match-chip-type      { font-size: .62rem; font-weight: 700; letter-spacing: .06em; opacity: .7; }
.mix-match-chip-label     { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.mix-match-chip-close     { width: 14px; height: 14px; border-radius: 999px;
                            cursor: pointer; opacity: .6; }
.mix-match-chip-close:hover { opacity: 1; background: rgba(15, 23, 42, .12); }
.mix-match-chip--material { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.mix-match-chip--pcs      { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.mix-match-chip--product  { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
/* Pill Load button — via Lumo's own custom property so the default padding
   (and therefore the height) is kept; raw vertical padding would grow the bar. */
.mix-match-bin-load       { --vaadin-button-border-radius: 999px; padding: 0 18px; }


/* ── Danger-outline action button ("Clear") ──
   Sizing is handled in the component exactly like the Combine button
   (`large` theme + inline padding/font). Only the danger-outline look lives
   here, driven through the public --vaadin-button-* custom properties Lumo's
   base vaadin-button style consumes — no theme-name fights, no !important. */
vaadin-button.clearActionButton {
    --vaadin-button-background: transparent;
    --vaadin-button-text-color: #dc2626;
    --vaadin-button-border: 8px solid #dc2626;
    --vaadin-button-border-radius: var(--lumo-border-radius-m);
}

vaadin-button.clearActionButton:hover {
    --vaadin-button-background: #dc2626;
    --vaadin-button-text-color: #ffffff;
}

/* Vaadin sets the [active] attribute while the button is pressed */
vaadin-button.clearActionButton[active] {
    --vaadin-button-background: #b91c1c;
    --vaadin-button-text-color: #ffffff;
}

vaadin-button.clearActionButton[disabled] {
    opacity: 0.5;
}


/* ── Responsive ── */
/* When drawer is closed (mobile), the brand shows in navbar */
@media (max-width: 800px) {
    .laird-layout .navbar-brand {
        font-size: 14px;
    }
}
