/* The "My Bids" surface, shared by /auctions and /marketplace.
 *
 * A bidder has to be able to find the lots they are winning and the ones they
 * still owe money on from whichever page they happen to be on, and find them
 * looking the same. templates/auctions.html still declares its own .mybids-*
 * rules inline for its drawer; those land after this file and win there by
 * design, so this stays the single definition for every OTHER surface.
 *
 * Both pages do not share colour variable names (--dim/--txt on auctions,
 * --muted/--text on marketplace), so every colour here carries a fallback.
 */

/* ---------------------------------------------------------------- tab row */

/* Matches the .tabs/.tab rules in marketplace.html so the two pages present
   the same control; auctions has no tab row of its own to inherit. */
.mybids-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line, #2a2a32);
    margin: 0 0 18px;
}

.mybids-tab {
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--dim, var(--muted, #9aa4b8));
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.mybids-tab.active {
    color: var(--txt, var(--text, #f4f4f6));
    border-bottom-color: var(--red, #e01021);
}

.mybids-tab[hidden] {
    display: none;
}

/* A tab that navigates instead of swapping a panel (Collectors lives on the
   marketplace). Never takes the active underline -- that bar means "this panel
   is showing". */
a.mybids-tab-link {
    text-decoration: none;
}

a.mybids-tab-link:hover {
    color: var(--txt, var(--text, #f4f4f6));
}

/* The count of lots still to pay for. Gold, not red: it is money owed, and it
   is the one thing on this page that costs the bidder a card if ignored. */
.mybids-tabn {
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 1px 7px;
    min-width: 18px;
    text-align: center;
    background: var(--gold, #e5b53a);
    color: #17140a;
}

.mybids-tabn.zero {
    background: #2a2a32;
    color: var(--dim, var(--muted, #9aa4b8));
}

/* ------------------------------------------------------------ list + rows */

.mybids-panel {
    border: 1px solid var(--line, #2a2a32);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg2, #121216);
}

.mybids-panel:empty {
    display: none;
}

/* A fixed grid rather than wrapping flex: every row then has the same shape
   whatever the title length. */
.mybids-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas:
        "thumb title state"
        "thumb meta  action";
    column-gap: 12px;
    row-gap: 3px;
    align-items: center;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line, #2a2a32);
    font-size: 13px;
}

.mybids-row:last-child {
    border-bottom: none;
}

.mybids-row:hover {
    background: rgba(255, 255, 255, .02);
}

.mybids-thumb {
    grid-area: thumb;
    width: 42px;
    height: 63px;
    border-radius: 5px;
    object-fit: contain;
    background: #000;
    align-self: center;
    /* Kept even with no image so every row lines up on the same column. */
    display: block;
}

.mybids-row a.mybids-title {
    grid-area: title;
    color: var(--txt, var(--text, #f4f4f6));
    font-weight: 700;
    font-size: 13.5px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.mybids-row a.mybids-title:hover {
    text-decoration: underline;
}

.mybids-amt {
    grid-area: meta;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 2px;
    min-width: 0;
}

.mybids-price {
    color: var(--gold, #e5b53a);
    font-weight: 800;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.mybids-sub {
    color: var(--dim, var(--muted, #9aa4b8));
    font-size: 12px;
    white-space: nowrap;
}

.mybids-clock {
    color: #2ecc71;
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.mybids-state {
    grid-area: state;
    justify-self: end;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: .4px;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 3px 9px;
    white-space: nowrap;
}

.mybids-action {
    grid-area: action;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mybids-state.win {
    color: #0d2a12;
    background: #57d977;
}

.mybids-state.lose {
    color: #2a0d0d;
    background: #ef8a8a;
}

.mybids-state.done {
    color: var(--dim, var(--muted, #9aa4b8));
    background: var(--bg2, #121216);
    border: 1px solid var(--line, #2a2a32);
}

/* An unpaid win is money already committed, so it outranks every other state. */
.mybids-state.pay {
    color: #2a1f00;
    background: var(--gold, #d4af37);
}

.mybids-row a.mybids-pay {
    flex: 0 0 auto;
    background: var(--gold, #e5b53a);
    color: #17140a;
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.mybids-row a.mybids-pay:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.mybids-row a.mybids-view {
    flex: 0 0 auto;
    color: var(--dim, var(--muted, #9aa4b8));
    border: 1px solid var(--line, #2a2a32);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.mybids-row a.mybids-view:hover {
    color: var(--txt, var(--text, #f4f4f6));
    text-decoration: none;
}

/* Sits above the list because it replaces every Add-to-cart below it. */
.mybids-panel a.mybids-payall {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line, #2a2a32);
    background: linear-gradient(180deg, #d4af37, #b8932b);
    color: #14110a;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.mybids-panel a.mybids-payall:hover {
    filter: brightness(1.06);
    text-decoration: none;
}

.mybids-more {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    border-top: 1px solid var(--line, #2a2a32);
    color: var(--dim, var(--muted, #9aa4b8));
    font: inherit;
    font-size: 12px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.mybids-more:hover {
    color: var(--txt, var(--text, #f4f4f6));
}

.mybids-settled {
    display: block;
    opacity: .75;
}

/* An author display: beats the UA [hidden] rule. */
.mybids-settled[hidden] {
    display: none;
}

.mybids-note {
    color: var(--dim, var(--muted, #9aa4b8));
    font-size: 13px;
    padding: 18px 14px;
    text-align: center;
}

.mybids-note a {
    color: var(--gold, #e5b53a);
}

/* A notification row: one icon, one line of text, no money. */
.mybids-row.mybids-note-row {
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-areas: "thumb title";
    text-decoration: none;
}

.mybids-ico {
    width: 28px;
    height: 28px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.mybids-row.mybids-note-row .mybids-title {
    grid-area: title;
    color: var(--txt, var(--text, #f4f4f6));
    font-size: 13.5px;
    min-width: 0;
    white-space: normal;
    font-weight: 600;
}
