/* CTGMC live UI layer — motion and micro-interaction only, no layout rewrites. */

:root {
  --live-gold: var(--secondary, #c9a850);
  --live-ink: var(--primary, #0a3d62);
  --live-shadow: 0 18px 44px rgba(8, 20, 32, 0.14);
}

::selection { background: rgba(201, 168, 80, 0.28); }

body { -webkit-font-smoothing: antialiased; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--live-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(201, 168, 80, 0.45) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 80, 0.38); border-radius: 9px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── entrance ─────────────────────────────────────────── */
@keyframes liveUp {
  from { opacity: 0; transform: translateY(14px) scale(0.995); }
  to   { opacity: 1; transform: none; }
}
@keyframes liveFade { from { opacity: 0; } to { opacity: 1; } }

/* Entrance animations were the main "content disappears" source: a fill-mode
   animation that never runs (backgrounded tab, slow paint) leaves the element
   at opacity 0 forever. The static page is now visible from the first frame and
   the motion lives on hover + the modal only. Cards keep no animation at all. */

/* ── surfaces ─────────────────────────────────────────── */
/* will-change on every card kept ~40 composited layers alive and made text
   shimmer; only promote what is actually moving (hover) */
.card,
.stat-card,
.mini-stat {
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.32s ease, border-color 0.32s ease;
}

@media (hover: hover) {
  .card:hover,
  .stat-card:hover,
  .mini-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--live-shadow);
    border-color: rgba(201, 168, 80, 0.5);
  }
}

/* ── buttons ──────────────────────────────────────────── */
.btn,
button:not(.modal-close):not(.topbar-menu-btn) {
  transition: transform 0.16s ease, box-shadow 0.24s ease, background 0.24s ease, color 0.24s ease;
}
.btn:active,
button:not(.modal-close):not(.topbar-menu-btn):active { transform: scale(0.975); }

.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.38) 46%, transparent 72%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.btn-primary:hover::after { transform: translateX(130%); }

/* ── navigation ───────────────────────────────────────── */
.sidebar-link {
  position: relative;
  transition: background 0.22s ease, color 0.22s ease, padding-left 0.22s ease;
}
.sidebar-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--live-gold);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}
.sidebar-link:hover::before,
.sidebar-link.active::before { transform: scaleY(1); }
.sidebar-link:hover { padding-left: 4px; }

/* ── tables ───────────────────────────────────────────── */
tbody tr { transition: background 0.18s ease; }
tbody tr:hover { background: rgba(201, 168, 80, 0.07); }

/* ── overlays ─────────────────────────────────────────── */
.modal-overlay.active { backdrop-filter: blur(3px); }
.wb-amount, #wbBalance, .stat-card-value { font-variant-numeric: tabular-nums; }
/* only animate when open - a fill-mode animation on every overlay pins it to opacity 1 */
.modal-overlay.active { opacity: 1; animation: liveFade 0.2s ease both; }
.modal-overlay.active .modal { animation: liveUp 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* keep the fixed mobile nav off the content */
@media (max-width: 900px) {
  .main-content { padding-bottom: 96px; }
}

/* ── live FX strip ────────────────────────────────────── */
.fx-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  padding: 8px 20px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-muted, #667);
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 90%, transparent 100%);
}
.fx-strip__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--live-gold);
  border-right: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  padding-right: 16px;
}
.fx-item { display: inline-flex; gap: 8px; align-items: baseline; font-variant-numeric: tabular-nums; }
.fx-item b { font-weight: 600; color: var(--text, #222); }
.fx-up { color: #1c8f5a; }
.fx-down { color: #c0392b; }
.fx-strip__time { margin-left: auto; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.55; }
/* phones: keep every pair, the strip simply scrolls */
@media (max-width: 720px) { .fx-strip { gap: 14px; } }

/* ── notification pulse ──────────────────────────────── */
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}
.notif-dot { animation: livePulse 2.2s infinite; }

/* ── skeleton ────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06) 25%, rgba(0, 0, 0, 0.03) 37%, rgba(0, 0, 0, 0.06) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── counters ────────────────────────────────────────── */
[data-live-count] { font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .live-ready .card,
  .live-ready .stat-card,
  .live-ready .mini-stat,
  .live-ready .db-section,
  .live-ready .sidebar-link,
  .modal,
  .modal-overlay { animation: none; }
  .card:hover, .stat-card:hover, .mini-stat:hover { transform: none; }
  .btn-primary::after { display: none; }
  .notif-dot { animation: none; }
}
