/* ── Stats row ──────────────────────────────────────────────────────────── */
.market-asset-card-v2-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 8px 14px 10px;
}

.market-asset-card-v2-stats-cell {
    flex: 1;
    text-align: center;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.market-asset-card-v2-stats-cell:first-child {
    border-left: none;
}

/* ── 7D range — sits below the period-diff cells ────────────────────────── */
.market-asset-card-v2-range-cell {
    flex: 1 0 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 8px 12px 0;
    margin-top: 8px;
}

.market-asset-card-v2-range-pair {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Label is in DOM after the value — reverse so it renders left of the value */
.market-asset-card-v2-range-pair--start {
    flex-direction: row-reverse;
}

/* DOM order: value → label — renders as [value] 7D HIGH */
.market-asset-card-v2-range-pair--end {
    flex-direction: row;
}

.market-asset-card-v2-range-label {
    font-size: 9px;
    letter-spacing: 0.06em;
    opacity: 0.4;
    line-height: 1.2;
}

.market-asset-card-v2-range-value {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    line-height: 1.2;
}

/* ── Skeleton placeholder (MarketAssetCardV2Skeleton.razor) ─────────────── */
/*
   Lives beside the card it stands in for, because the two only stay interchangeable while their
   geometry is edited together. Anything here that repeats a number from above is repeating it
   because the card declares it inline and has no class to share.
*/

/* Same four declarations as the inline style on MarketAssetCardV2's inner box. */
.mac-v2-sk__box {
    background-color: #1b1c1e;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    margin-bottom: 20px;
}

/* Padding and flex copied from MarketAssetCardV2.HeaderStyle. The height is deliberately left to
   the content rather than pinned to a number: the placeholder's chip wears the real chip's own
   classes (see .mac-v2-sk__chip), so the row measures 52px for exactly the reason the real header
   does — 10px + (28px chip + its 4px margins) + 6px — and follows it if that ever changes. */
.mac-v2-sk__head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 6px;
}

.mac-v2-sk__ident {
    display: inline-flex;
    align-items: center;
}

/* .currency-icon-bigger is 24px wide and the source image is square. */
.mac-v2-sk__icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* CurrencyLabel's CustomTextLeftPaddingStyle at CurrencyLabelSize.Default. */
.mac-v2-sk__name {
    margin-left: 16px;
}

/* MudStack(Row, Spacing="2") is an 8px gap. */
.mac-v2-sk__meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stands in for the decision chip. The element carrying this class also carries .mud-chip and
   .mud-chip-size-medium, so its height, margins and pill radius are whatever the real chip's are
   — currently 28px, because app.css overrides MudBlazor's 32px, which is precisely the kind of
   number a placeholder must not copy. Only the width is the placeholder's own business. */
.mac-v2-sk__chip {
    flex: 0 0 auto;
    width: 62px;
}

/* KennyExchangeView renders .kenny-panels-container unconditionally — empty, and so zero-height,
   when the currency panel is disabled as it is here, but still carrying mb-1. Reproduce that 4px
   or the placeholder's chart sits 4px higher than the real one. */
.mac-v2-sk__chart-gap {
    height: 0;
    margin-bottom: 4px;
}

/* Full-bleed and square-cornered, matching KennyExchangeView's chart div. Height comes from the
   component parameter, which is the same constant the real card is given.

   Filled well below the standard block: this is by far the largest placeholder on the card, and
   what replaces it is a dark, mostly empty chart area. At the usual skeleton opacity the swap is
   a bright slab turning dark — the brightness step reads as a flash even when nothing moves. */
.mac-v2-sk .mac-v2-sk__chart {
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.035);
}

/* The real label is deliberately faint (opacity .4); at that opacity a skeleton block reads as a
   missing row rather than a pending one, so the placeholder lifts it just enough to be seen. */
.mac-v2-sk .market-asset-card-v2-range-label {
    opacity: 0.75;
}

/* Paints any element as a pending block: its text becomes a width-and-line-height ruler that is
   never seen. Every element carrying this class is either a block or a flex item, so it always
   has a box for the ::after overlay to fill. */
.mac-v2-sk-block {
    position: relative;
    overflow: hidden;
    color: transparent;
    background-color: var(--mud-palette-skeleton, rgba(255, 255, 255, 0.09));
    border-radius: 6px;
    user-select: none;
}

/* MudSkeleton's own wave is a dark gradient tuned for light surfaces and is invisible on this
   card's #1b1c1e, which is why the placeholder brings its own. */
.mac-v2-sk-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: mac-v2-sk-wave 1.6s linear 0.5s infinite;
}

@keyframes mac-v2-sk-wave {
    to { transform: translateX(100%); }
}

/* ── Unavailable variant (MarketAssetCardV2Skeleton, Unavailable=true) ──── */
/*
   The terminal state of a slot the initial stream never filled (DEF-062). Geometry is untouched by
   design — every rule here changes paint only, so a slot flipping from pending to unavailable moves
   nothing. That is the whole reason this is a modifier on the skeleton rather than its own
   component.
*/

/* content: none, not animation: none. Removing the pseudo-element takes the compositing layer with
   it; merely pausing the animation would leave 12 idle overlay boxes per card standing. A grid of
   21 unfilled slots runs 252 of these, and the FPS investigation measured that state at 34.7 FPS
   idle with 856 ms of long tasks per 5 s — this is the rule that makes the terminal state cheap. */
.mac-v2-sk--unavailable .mac-v2-sk-block::after {
    content: none;
}

/* Dimmer than pending. A pending block is bright because something is coming; this one is a
   statement that nothing is, and it must not compete with the real cards beside it. */
.mac-v2-sk--unavailable .mac-v2-sk-block {
    background-color: rgba(255, 255, 255, 0.045);
}

/* The chart block is the caption's positioning context — .mac-v2-sk-block already sets
   position: relative, so this only has to centre. Absolute rather than flex so the caption cannot
   influence the block's height, which is pinned to the same ChartHeightInVh the real card gets. */
.mac-v2-sk__note {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    /* .mac-v2-sk-block paints its ruler text transparent; the caption is real content and opts
       back in. Deliberately faint — this is an explanation, not an alarm. */
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    user-select: none;
}

/* ── Direction glow — right-edge atmospheric tint ───────────────────────── */
.market-asset-card-v2-glow-wrapper {
    border-radius: 20px;
    transition: box-shadow 300ms ease;
    animation: mac-v2-appear 350ms ease-out both;
}

.market-asset-card-v2-glow-up {
    -webkit-box-shadow: 0 0 15px -9px rgba(2, 140, 19, 1);
    -moz-box-shadow:    0 0 15px -9px rgba(2, 140, 19, 1);
    box-shadow:         0 0 15px -9px rgba(2, 140, 19, 1);
}

.market-asset-card-v2-glow-down {
    /*
    box-shadow: 0 0 8px 0 rgba(219, 46, 65, 0.3),
    inset -3px 0 16px 0 rgba(219, 46, 65, 0.3);

     */

    -webkit-box-shadow: 0 0 15px -9px rgba(219, 46, 65, 1);
    -moz-box-shadow:    0 0 15px -9px rgba(219, 46, 65, 1);
    box-shadow:         0 0 15px -9px rgba(219, 46, 65, 1);
}

/* ── Card appear animation ──────────────────────────────────────────────── */
@keyframes mac-v2-appear {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Price flash micro-animation ────────────────────────────────────────── */
@keyframes market-asset-card-v2-price-flash {
    0%   { opacity: 1; }
    25%  { opacity: 0.55; }
    75%  { opacity: 0.55; }
    100% { opacity: 1; }
}

.market-asset-card-v2-price-flash {
    animation: market-asset-card-v2-price-flash 250ms ease-in-out;
}

/* ── Respect user's reduced-motion preference ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .market-asset-card-v2-price-flash,
    .market-asset-card-v2-glow-wrapper {
        animation: none;
    }

    /* A full grid of shimmering placeholders is exactly the kind of motion this query is for.
       The blocks stay — only the wave stops — so the pending state is still legible. */
    .mac-v2-sk-block::after {
        animation: none;
    }

    .market-asset-card-v2-glow-wrapper,
    .market-asset-card-v2-glow-up,
    .market-asset-card-v2-glow-down {
        box-shadow: none;
    }
}

