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

/* Tips-scoped theme tokens. The brand amber/coral accent is anchored to yzen's own orange
   token (--orange-rgb, defined in assets/css/styles.css :root), so it tracks the yzen palette.
   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: rgb(var(--orange-rgb));
    --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 {
    /* 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);
}

/* Tiny uppercase caption under a dropzone prompt (e.g. "MAIN PHOTO · 16:9"). */
.tip-dropzone-caption {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bp-text-ghost);
}

/* ══════════════════════════════════════════════════════════════════════════
   Contribute a tip — two-column form (ltc- = local-tips-contribute).
   Form page outside the list+pane pattern; token-driven off --bp-* / yzen so
   it tracks the palette (§10.14). No off-palette hexes.
   ══════════════════════════════════════════════════════════════════════════ */

/* Header row: title/subtitle left, segmented toggle right. */
.ltc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ltc-header-titles {
    min-width: 0;
}

/* Segmented pill toggle — grey track, white active pill with a soft shadow. */
.ltc-toggle {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    background: var(--bp-surface-alt);
    border: 0.5px solid var(--bp-border);
    border-radius: 999px;
    flex-shrink: 0;
}

.ltc-toggle-btn {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 500;
    color: var(--bp-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, box-shadow .15s;
}

    .ltc-toggle-btn:hover {
        color: var(--bp-text);
    }

    .ltc-toggle-btn.ltc-active {
        background: var(--bp-surface);
        color: var(--bp-text);
        font-weight: 600;
        box-shadow: var(--bp-shadow-menu);
    }

/* Two-column body: main form card + sticky right rail. */
.ltc-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    max-width: 980px;
}

.ltc-main {
    flex: 1;
    min-width: 0;
    background: var(--bp-surface);
    border: 0.5px solid var(--bp-border);
    border-radius: var(--bp-radius);
    padding: 24px 26px;
}

.ltc-rail {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Numbered sections inside the main card. */
.ltc-section {
    margin-bottom: 26px;
}

    .ltc-section:last-child {
        margin-bottom: 0;
    }

.ltc-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ltc-step-badge {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--bp-accent-bg);
    color: var(--bp-accent-strong);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ltc-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--bp-text);
}

.ltc-optional {
    font-size: 12px;
    font-weight: 400;
    color: var(--bp-text-faint);
}

/* Label-above field wrapper. */
.ltc-field {
    margin-bottom: 14px;
}

    .ltc-field:last-child {
        margin-bottom: 0;
    }

.ltc-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--bp-text);
    margin-bottom: 6px;
}

.ltc-req {
    color: var(--mud-palette-error);
    margin-left: 2px;
}

.ltc-field-hint {
    font-size: 12px;
    color: var(--bp-text-muted);
    margin-top: 6px;
}

/* Two fields side by side; stacks on narrow widths. */
.ltc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 14px;
}

    .ltc-row:last-child {
        margin-bottom: 0;
    }

    .ltc-row .ltc-field {
        margin-bottom: 0;
    }

@media (max-width: 560px) {
    .ltc-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

        .ltc-row .ltc-field {
            margin-bottom: 14px;
        }
}

/* Trim the outlined-input top margin so the field sits tight under our label. */
.ltc-field .mud-input-control-margin-dense {
    margin-top: 0;
}

/* Media dropzones: hero (16:9) fills the row, cover (1:1) is a fixed square. */
.ltc-media-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.ltc-media-hero {
    flex: 1;
    min-width: 0;
}

.ltc-media-cover {
    width: 160px;
    flex-shrink: 0;
}

/* ─── Right rail cards ─── */
.ltc-rail-card {
    background: var(--bp-surface);
    border: 0.5px solid var(--bp-border);
    border-radius: var(--bp-radius);
    padding: 16px;
}

.ltc-rail-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bp-text-faint);
    margin-bottom: 12px;
}

/* Live-preview card (mirrors the published tip). */
.ltc-preview {
    border: 0.5px solid var(--bp-border);
    border-radius: var(--bp-radius);
    overflow: hidden;
}

.ltc-preview-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Diagonal striped placeholder built from theme tokens (no literal hexes). */
    background: repeating-linear-gradient(135deg,
        var(--bp-surface-alt) 0, var(--bp-surface-alt) 9px,
        var(--bp-border-soft) 9px, var(--bp-border-soft) 18px);
}

    .ltc-preview-hero img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Group preview reuses the gradient hero language. */
.ltc-preview-hero.ltc-preview-hero--group {
    position: relative;
    background: var(--aa-tips-group-gradient);
}

.ltc-preview-hero-ghost {
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bp-text-ghost);
}

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

.ltc-preview-body {
    padding: 14px;
}

.ltc-preview-cat {
    display: inline-block;
    background: var(--bp-accent-bg);
    color: var(--bp-accent-strong);
    border-radius: var(--bp-radius-sm);
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.ltc-preview-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--bp-text);
    margin-bottom: 3px;
    overflow-wrap: anywhere;
}

    .ltc-preview-name.ltc-placeholder {
        color: var(--bp-text-faint);
    }

.ltc-preview-loc {
    font-size: 12px;
    color: var(--bp-text-muted);
    margin-bottom: 8px;
}

.ltc-preview-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--bp-text-muted);
    overflow-wrap: anywhere;
}

    .ltc-preview-desc.ltc-placeholder {
        color: var(--bp-text-faint);
    }

/* Before-you-submit checklist. */
.ltc-rail-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bp-text);
    margin-bottom: 12px;
}

.ltc-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.ltc-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--bp-text-muted);
    line-height: 1.4;
}

.ltc-check-mark {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    border-radius: 50%;
    border: 1.5px solid var(--bp-border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: transparent;
    transition: background .15s, border-color .15s, color .15s;
}

.ltc-check.ltc-check-done {
    color: var(--bp-text);
}

    .ltc-check.ltc-check-done .ltc-check-mark {
        background: var(--bp-accent);
        border-color: var(--bp-accent);
        color: var(--aa-tips-on-accent);
    }

/* Full-width primary submit inside the rail. */
.ltc-submit.mud-button-root {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--bp-radius);
}

.ltc-hint {
    text-align: center;
    font-size: 11px;
    color: var(--bp-text-faint);
    margin-top: 10px;
}

/* Stack the rail under the form on narrow viewports. */
@media (max-width: 1000px) {
    .ltc-layout {
        flex-direction: column;
    }

    .ltc-rail {
        position: static;
        width: 100%;
    }
}
