/* ── Local Tips feature (no inline styles — see docs/plans/2026-06-08-local-tips-backoffice.md §8) ── */

/* Tips-scoped theme tokens. The brand amber accent is anchored to the MudBlazor palette's
   Tertiary slot (--mud-palette-tertiary, set in BackOfficeTheme), so a theme change recolours
   the group gradients. The lighter gradient stops and the glass/photo overlays stay literal —
   they sit on a colour gradient or a photo, not on a theme surface, so they must not track
   light/dark. */
:root {
    --aa-tips-accent: var(--mud-palette-tertiary);
    --aa-tips-group-gradient: linear-gradient(135deg, var(--aa-tips-accent) 0%, #e8a030 60%, #f5c060 100%);
    --aa-tips-group-gradient-thumb: linear-gradient(135deg, var(--aa-tips-accent) 0%, #e8a030 100%);
    --aa-tips-on-accent: #fff;
    --aa-tips-glass: rgba(255, 255, 255, 0.22);
    --aa-tips-overlay: rgba(0, 0, 0, 0.5);
    --aa-tips-overlay-hover: rgba(0, 0, 0, 0.7);
}

.clickable-row {
    cursor: pointer;
}

.filter-select {
    max-width: 200px;
    /* Zero the default dense top margin so the search box and every toolbar filter
       share one baseline (they sit in an AlignItems.Center flex row). */
    margin-top: 0 !important;
}

/* The DataGrid toolbar is a `.mud-toolbar` whose `.mud-toolbar` rule pins a fixed
   `height: var(--mud-internal-toolbar-height)` (64px in this theme). A second toolbar
   row (BelowToolBarContent, e.g. status filter chips) stacks vertically and overflows
   that fixed height into the column headers. MudBlazor's own remedy for an oversized
   toolbar is `.mud-toolbar-wrap-content` (height:auto + min-height fallback); we apply
   the same declarations, scoped to grids that actually render a second row. */
.standard-grid--two-row-toolbar .mud-table-toolbar {
    height: auto;
    min-height: var(--mud-internal-toolbar-height);
    padding-top: 8px;
    padding-bottom: 8px;
}

/* Hide the multi-column sort-priority badge next to the sort arrow. These grids
   sort one column at a time, so the index number ("1") is noise. */
.standard-grid .mud-sort-index {
    display: none;
}

.drawer-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.drawer-header {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--mud-palette-table-lines);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.drawer-footer {
    flex-shrink: 0;
    padding: 16px 20px;
    border-top: 1px solid var(--mud-palette-table-lines);
}

/* Customer preview card (tip & group editors) */
.local-tips-preview {
    overflow: hidden;
    border-radius: 10px;
}

.local-tips-preview-hero {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.local-tips-preview-hero--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-secondary);
}

.local-tips-preview-group-hero {
    position: relative;
    background: var(--aa-tips-group-gradient);
}

.local-tips-preview-collection {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--aa-tips-glass);
    color: var(--aa-tips-on-accent);
    border-radius: 20px;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Published tips list — row thumbnail */
.local-tips-thumb {
    width: 40px;
    height: 40px;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-secondary);
}

/* Group rows use a gradient placeholder when no hero image is set (matches the group hero). */
.local-tips-thumb--group {
    background: var(--aa-tips-group-gradient-thumb);
    color: var(--aa-tips-on-accent);
}

/* Published tips list — stats footer */
.local-tips-stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    padding: 12px 16px;
}

.local-tips-stat {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
}

.local-tips-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    margin-top: 2px;
}

.local-tips-stat-value--green {
    color: var(--mud-palette-success);
}

.local-tips-stat-value--amber {
    color: var(--mud-palette-warning);
}

/* Tip editor — drag-and-drop image zone */
.tip-dropzone {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1.5px dashed var(--mud-palette-lines-inputs);
    border-radius: 8px;
    background: var(--mud-palette-background-grey);
    transition: border-color .15s, background .15s;
}

.tip-dropzone--wide {
    aspect-ratio: 16 / 9;
}

.tip-dropzone--square {
    aspect-ratio: 1 / 1;
    max-width: 240px;
}

.tip-dropzone:hover,
.tip-dropzone:focus-within {
    border-color: var(--mud-palette-primary);
    background: var(--mud-palette-action-default-hover);
}

.tip-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.tip-dropzone-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tip-dropzone-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    pointer-events: none;
}

.tip-dropzone-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    background: var(--aa-tips-overlay);
    color: var(--aa-tips-on-accent);
}

.tip-dropzone-remove:hover {
    background: var(--aa-tips-overlay-hover);
}

/* Contribution form — cap width and pack the hero/cover dropzones into a
   compact row so the form doesn't sprawl with whitespace. Scoped to the
   contribute page only; the editor drawers keep the full-width dropzones. */
.local-tips-contribute {
    max-width: 800px;
}

.local-tips-contribute-images {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.local-tips-contribute-hero {
    width: 280px;
}

.local-tips-contribute-cover {
    width: 160px;
}

/* Source panel — guide-submitted contribution image thumbnails */
.local-tips-contribution-img {
    border-radius: 6px;
    object-fit: cover;
    background: var(--mud-palette-background-grey);
}

.local-tips-contribution-img--wide {
    width: 160px;
    aspect-ratio: 16 / 9;
}

.local-tips-contribution-img--square {
    width: 90px;
    aspect-ratio: 1 / 1;
}

/* Group editor — drag-and-drop tip list */
.local-tips-tip-item {
    cursor: grab;
    user-select: none;
}

.local-tips-tip-item:active {
    cursor: grabbing;
}

.local-tips-tip-drag-handle {
    cursor: grab;
}

/* Dim the row being dragged so the drop preview line stands out. */
.local-tips-tip-dropzone .mud-drop-item-dragging {
    opacity: 0.5;
}

/* Let editors drag-resize multi-line fields (description, internal note) vertically. */
.local-tips-resizable textarea {
    resize: vertical;
}

/* Product code shown next to a product name (dropdown item + selected chip).
   Spaced from the name and weighted up so it reads clearly against the name. */
.local-tips-product-code {
    margin-left: 0.5em;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}
