/* launchpad-top-n-feed — visual styles for the top-N-by-mcap launchpad
   tweet feed. Companion to shared/modules/launchpad-top-n-feed.js.

   Built on the project's "AVICI card" recipe (docs/design-tokens.md §4):
   gradient surface, gold top-accent line, terracotta hover border,
   tabular-nums on every numeric cell. Class prefix `.lt-*`
   (launchpad-top) for namespace cleanliness — sister to .cc-* on
   mcg-clips-panel.

   Reduced motion: handled globally in shared/css/base.css (clamps every
   transition to 0.01ms with !important). No module-level guard needed —
   see docs/design-tokens.md §9. */

#launchpad-top-n-feed-section { margin-top: 2rem; }

/* ── Panel container — large AVICI card surface ─────────────────── */

.lt-panel {
    position: relative;
    background: linear-gradient(145deg, var(--color-bg-card) 0%, rgba(0, 0, 0, 0.18) 100%);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 1.5rem 1.6rem;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(var(--color-terracotta-rgb), 0.06),
        inset 0 1px rgba(255, 255, 255, 0.04);
    transition: border-color var(--motion-fast, .15s) var(--ease-out, ease),
                box-shadow   var(--motion-fast, .15s) var(--ease-out, ease),
                opacity      var(--motion-normal, .25s) var(--ease-out, ease);
}

/* Soft-fade-in on every (re)render. The JS adds .lt-fade-init first
   to commit opacity:0, then .lt-fade-in on the next paint to trigger
   the transition target — without the rAF dance some browsers paint
   the final state immediately. The global prefers-reduced-motion in
   base.css clamps the transition to 0.01ms automatically, so this
   reads as instant for users who request it. */
.lt-panel.lt-fade-init { opacity: 0; }
.lt-panel.lt-fade-in   { opacity: 1; }

.lt-panel::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(var(--color-terracotta-rgb), 0.45) 50%,
        transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.lt-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.lt-panel-titles {
    flex: 1 1 auto;
    min-width: 0;
}

.lt-panel-head h2 {
    margin: 0 0 0.25rem 0;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* "Updated 4m ago" pill — sits right of the title, mono numerals,
   self-tickly via launchpad-top-n-feed.js. Uses the gold-tint scale
   per docs/design-tokens.md §1 so it reads as part of the panel
   chrome rather than a stray label. */
.lt-updated {
    flex: 0 0 auto;
    align-self: flex-start;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(var(--color-terracotta-rgb), 0.06);
    border: 1px solid rgba(var(--color-terracotta-rgb), 0.14);
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.lt-fixture-flag {
    /* Operator-visible "this is fake data" pill — only renders when
       payload._fixture === true. Real fetches drop this key, so the
       chip never shows on production data. Distinct color (warning
       orange) so it can't be missed. */
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(var(--color-warning-rgb), 0.14);
    color: #ffa502;
    border: 1px solid rgba(var(--color-warning-rgb), 0.30);
}

.lt-panel-sub {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
}

/* ── Grid: token blocks ─────────────────────────────────────────── */

.lt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 1.4rem;
}

@media (max-width: 900px) {
    .lt-grid { grid-template-columns: 1fr; }
}

/* ── Per-token block (inner AVICI card) ─────────────────────────── */

.lt-token-block {
    position: relative;
    background: linear-gradient(145deg, var(--color-bg-card) 0%, rgba(0, 0, 0, 0.12) 100%);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1.15rem;
    overflow: hidden;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    transition: border-color var(--motion-fast, .15s) var(--ease-out, ease),
                box-shadow   var(--motion-fast, .15s) var(--ease-out, ease);
}

.lt-token-block::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(var(--color-terracotta-rgb), 0.30) 50%,
        transparent 100%);
    z-index: 1;
    pointer-events: none;
}

.lt-token-block:hover {
    border-color: rgba(var(--color-terracotta-rgb), 0.22);
    box-shadow:
        0 0 32px rgba(var(--color-terracotta-rgb), 0.08),
        inset 0 1px rgba(255, 255, 255, 0.05);
}

/* ── Token header — rank + avatar + name + ticker + mcap + handle ── */

.lt-token-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.lt-rank {
    flex-shrink: 0;
    width: 22px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
}

.lt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: rgba(var(--color-terracotta-rgb), 0.04);
    border: 1px solid rgba(var(--color-terracotta-rgb), 0.10);
    box-shadow: inset 0 0 0 1px rgba(var(--color-terracotta-rgb), 0.08);
    transition: box-shadow var(--motion-fast, .15s) var(--ease-out, ease);
}

.lt-token-block:hover .lt-avatar {
    box-shadow:
        inset 0 0 0 1px rgba(var(--color-terracotta-rgb), 0.22),
        0 0 0 3px rgba(var(--color-terracotta-rgb), 0.08);
}

.lt-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--color-terracotta-rgb), 0.10);
    color: var(--color-terracotta-text);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

.lt-token-id {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.lt-token-name {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--motion-fast, .15s) var(--ease-out, ease);
}

.lt-token-name:hover,
.lt-token-name:focus-visible {
    color: var(--color-terracotta-text);
}

.lt-token-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
    align-items: baseline;
}

.lt-ticker {
    color: var(--color-terracotta-text);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.lt-mcap {
    color: var(--color-text);
    font-weight: 600;
}

.lt-token-handle {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--motion-fast, .15s) var(--ease-out, ease);
}

.lt-token-handle:hover,
.lt-token-handle:focus-visible {
    color: var(--color-terracotta-text);
}

/* ── Tweet list inside a token block ────────────────────────────── */

.lt-tweets {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lt-tweet {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem 0.55rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(var(--color-terracotta-rgb), 0.06);
    transition: background-color var(--motion-fast, .15s) var(--ease-out, ease),
                border-color     var(--motion-fast, .15s) var(--ease-out, ease);
}

.lt-tweet:hover {
    background: rgba(var(--color-terracotta-rgb), 0.04);
    border-color: rgba(var(--color-terracotta-rgb), 0.16);
}

.lt-tweet-body {
    font-family: var(--font-sans);
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--color-text);
    word-break: break-word;
}

.lt-tweet-body a {
    color: var(--color-terracotta-text);
    text-decoration: none;
}

.lt-tweet-body a:hover { text-decoration: underline; }

.lt-tweet-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
}

.lt-tweet-when {
    font-weight: 500;
}

.lt-tweet-source {
    margin-left: auto;
    color: var(--color-text-dim);
    text-decoration: none;
    transition: color var(--motion-fast, .15s) var(--ease-out, ease);
    font-weight: 600;
}

.lt-tweet-source:hover,
.lt-tweet-source:focus-visible {
    color: var(--color-terracotta-text);
    text-decoration: underline;
}

/* ── Engagement chip strip — same vocabulary as mcg-clips-panel ── */

.lt-engagement {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.lt-eng-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(var(--color-terracotta-rgb), 0.06);
    font-size: 0.66rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.lt-eng-icon {
    font-size: 0.68rem;
    line-height: 1;
    color: var(--color-text-dim);
}

.lt-eng-val {
    color: var(--color-text);
    font-weight: 600;
}

/* ── Empty state — token surfaced but 0 tweets returned ─────────── */

.lt-empty {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    color: var(--color-text-dim);
    font-style: italic;
    padding: 0.4rem 0.2rem;
}

/* ── Mobile reflow ──────────────────────────────────────────────── */

@media (max-width: 640px) {
    .lt-panel { padding: 1.1rem 1.2rem; border-radius: 12px; }
    .lt-token-block { padding: 0.95rem 1rem 1rem; border-radius: 10px; }
    .lt-token-head { gap: 0.55rem; }
    .lt-rank { width: 18px; font-size: 0.72rem; }
    .lt-avatar { width: 32px; height: 32px; }
    .lt-token-name { font-size: 0.9rem; }
    .lt-tweet { padding: 0.55rem 0.6rem 0.5rem; }
    .lt-tweet-body { font-size: 0.82rem; }
    .lt-eng-chip { font-size: 0.62rem; }
}
