/*
  BlazorBlueprint overlay positioning fix.

  Blueprint's shipped stylesheet (blazorblueprint.css) is built with a Tailwind
  that scopes its utilities inside native CSS `@layer` rules. This app's own
  Tailwind output (css/app.css) is UNLAYERED. Per the cascade, unlayered rules
  beat layered ones regardless of selector specificity — so the app's base reset
  `*, ::before, ::after { --tw-translate-x: 0; --tw-translate-y: 0 }` outranks
  Blueprint's `.translate-x-[-50%]` / `.translate-y-[-50%]` utilities.

  The visible symptom: centered overlays (BbDialog, BbSheet) keep their
  `position:fixed; left:50%; top:50%` but lose the `translate(-50%,-50%)` pull-back,
  so they render with their top-left corner at screen center (down-and-right of
  center) instead of truly centered.

  This unlayered, !important rule restores the centering transform for any element
  that opts into both-axis centering. Floating-ui-positioned overlays (dropdowns,
  popovers, comboboxes) position via inline styles and don't carry these classes,
  so they're unaffected.

  This file is loaded AFTER blazorblueprint.css in _Layout.cshtml and is NOT
  generated by Tailwind (so it won't be overwritten by the RunTailwind step).
*/
[class*="translate-x-[-50%]"][class*="translate-y-[-50%]"] {
    transform: translate(-50%, -50%) !important;
}

/*
  Brand the create/edit form's Blueprint dropdown triggers (Brand, Company,
  Category, Tastes) to match the cream textbox inputs. Each component exposes its
  `Class` parameter differently (BbCombobox → container, not the trigger button),
  and Blueprint's layered utilities make per-element `!` Tailwind classes
  unreliable here — so we style the trigger buttons directly. All three render a
  `<button role="combobox">`. Scoped to `.sd-form` so only this form is affected.
  Colours mirror the Tailwind theme: cream #F5EBDB, ink #2A2520, peach #F0A671.
*/
.sd-form button[role="combobox"] {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 0;
    border-radius: 1rem;
    background-color: rgb(245 235 219 / 0.4);
    color: #2A2520;
    box-shadow: none;
    font-size: 1rem;
    line-height: 1.5;
}
.sd-form button[role="combobox"]:hover {
    background-color: rgb(245 235 219 / 0.7);
}
.sd-form button[role="combobox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #F0A671;
}

/*
  Brand the dropdown PANELS to match the app's paper cards. These portal out to
  the page root (BbPortalHost), so the `.sd-form` scope can't reach them — we
  target by Blueprint's stable id pattern instead: selects render
  `select-N-content`, combobox/multiselect popovers render `popover-N-content`.
  Neither matches BbDialog, so the check-in modal is untouched. Softer radius and
  the card-lg shadow to match Components/SdCard. (paper #FFF, ink/10 border)
*/
[id^="select-"][id$="-content"],
[id^="popover-"][id$="-content"] {
    background-color: #FFFFFF !important;
    border-radius: 1rem !important;
    border-color: rgba(42, 37, 32, 0.10) !important;
    box-shadow: 0 12px 40px -12px rgba(42, 37, 32, 0.18), 0 4px 8px -4px rgba(42, 37, 32, 0.08) !important;
}

/*
  Admin button hierarchy. BbButton emits shadcn-style utilities (bg-primary,
  border-input, bg-destructive) whose theme variables this app never sets, so
  "primary" rendered as a washed-out near-gray — Save/Merge/Use were genuinely
  hard to spot among the outlines. Same unlayered-overrides-win mechanism as the
  translate fix above, scoped to .admin-shell so the consumer app is untouched.

  Tiers: primary = solid ink (slate-900) · outline = white w/ visible slate
  border · destructive = solid red · ghost stays quiet on purpose (Close only).
*/
.admin-shell button[class*="text-primary-foreground"] {
    background-color: #0f172a !important;   /* slate-900 */
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25);
}
.admin-shell button[class*="text-primary-foreground"]:hover:not(:disabled) {
    background-color: #334155 !important;   /* slate-700 */
}
.admin-shell button[class*="border-input"] {
    background-color: #ffffff !important;
    border-color: #cbd5e1 !important;       /* slate-300 */
    color: #334155 !important;              /* slate-700 */
}
.admin-shell button[class*="border-input"]:hover:not(:disabled) {
    background-color: #f8fafc !important;   /* slate-50 */
    border-color: #94a3b8 !important;       /* slate-400 */
}
.admin-shell button[class*="text-destructive-foreground"] {
    background-color: #dc2626 !important;   /* red-600 */
    color: #ffffff !important;
}
.admin-shell button[class*="text-destructive-foreground"]:hover:not(:disabled) {
    background-color: #b91c1c !important;   /* red-700 */
}
