/* =============================================================================
   TIMELINE PAGE — Chronological Transaction Log
   ============================================================================= */

body {
  background: var(--zinc-950);
  color: var(--zinc-400);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  overflow-y: auto;
  min-height: 100vh;
}

/* -- Grain overlay -- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* -- Dot grid -- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(circle, var(--zinc-700) 0.5px, transparent 0.5px);
  background-size: 24px 24px;
}

/* -- Main container -- */
.tl-main {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 52px 20px 60px;
}

/* =============================================================================
   STATS STRIP OVERRIDES (shared with index)
   ============================================================================= */

#stats-strip {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(9,9,11,0.98);
  border-bottom: 1px solid var(--zinc-800);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 36px;
}

.strip-nav-link {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--zinc-500);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--zinc-800);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.strip-nav-link:hover {
  color: var(--zinc-200);
  border-color: var(--zinc-600);
  background: rgba(39,39,42,0.3);
}
.strip-nav-link.active {
  color: var(--zinc-200);
  border-color: var(--zinc-600);
  background: rgba(39,39,42,0.25);
}

/* =============================================================================
   PAGE TITLE
   ============================================================================= */

.page-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--zinc-500);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-500);
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}

.page-subtitle {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-600);
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

/* =============================================================================
   INSIGHTS PANEL
   ============================================================================= */

.insights-panel {
  background: rgba(18,18,20,0.95);
  border: 1px solid var(--zinc-800);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  contain: layout paint;
}

.insights-title {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--zinc-600);
  margin-bottom: 10px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
  margin-bottom: 12px;
}

.insights-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.insights-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--zinc-600);
}

.insights-value {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-300);
  font-variant-numeric: tabular-nums;
}

.insights-note {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-500);
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid rgba(39,39,42,0.5);
}

/* =============================================================================
   TIMELINE LIST
   ============================================================================= */

.tl-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  contain: layout paint;
}

/* -- Day separator -- */
.tl-day-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 8px;
  content-visibility: auto;
  contain-intrinsic-size: 30px;
}

.tl-day-sep-line {
  flex: 1;
  height: 1px;
  background: var(--zinc-800);
}

.tl-day-sep-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--zinc-600);
  white-space: nowrap;
}

/* -- Phase separator -- */
.tl-phase-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 6px;
  content-visibility: auto;
  contain-intrinsic-size: 28px;
}

.tl-phase-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(185,28,28,0.12);
  color: var(--red-400);
  border: 1px solid rgba(185,28,28,0.2);
  white-space: nowrap;
}

.tl-phase-label {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-500);
  white-space: nowrap;
}

.tl-phase-line {
  flex: 1;
  height: 1px;
  background: rgba(185,28,28,0.15);
}

/* -- Time gap indicator -- */
.tl-gap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  content-visibility: auto;
  contain-intrinsic-size: 20px;
}

.tl-gap-line {
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--zinc-800) 0,
    var(--zinc-800) 4px,
    transparent 4px,
    transparent 8px
  );
}

.tl-gap-label {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--zinc-600);
  white-space: nowrap;
}

/* -- Transaction row -- */
.tl-row {
  display: grid;
  grid-template-columns: 42px 42px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  min-height: 32px;
  transition: background 0.1s ease;
  content-visibility: auto;
  contain: layout paint style;
  contain-intrinsic-size: 32px;
}

.tl-row:hover {
  background: rgba(39,39,42,0.2);
}

.tl-row.frozen {
  border-left: 3px solid #2563eb;
  padding-left: 5px;
}

/* Time */
.tl-time {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--zinc-500);
  white-space: nowrap;
}

/* Chain badge */
.tl-chain {
  display: inline-block;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  text-align: center;
  white-space: nowrap;
}

.tl-chain-eth  { background: #4a6a9e; color: #e4e4e7; }
.tl-chain-bsc  { background: #a38614; color: #09090b; }
.tl-chain-tron { background: #b04455; color: #e4e4e7; }
.tl-chain-cross { background: #2d7a3e; color: #e4e4e7; }

/* Flow: from -> to + amount */
.tl-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  color: var(--zinc-400);
  min-width: 0;
  overflow: hidden;
}

.tl-node-link {
  color: var(--zinc-300);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: color 0.15s;
}
.tl-node-link:hover {
  color: var(--zinc-50);
}

.tl-arrow {
  color: var(--zinc-600);
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  flex-shrink: 0;
}

.tl-amount {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--zinc-300);
  white-space: nowrap;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

/* TX link + frozen badge */
.tl-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.tl-tx-link {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--blue-400);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.tl-tx-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.tl-frozen-badge {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(37,99,235,0.2);
  color: #60a5fa;
  border: 1px solid rgba(37,99,235,0.3);
}

/* Spacer column for frozen badge alignment */
.tl-badge-col {
  min-width: 50px;
  text-align: right;
}

/* =============================================================================
   WATERMARK
   ============================================================================= */

.tl-watermark {
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: rgba(39,39,42,0.35);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 20px 0;
  user-select: none;
  content-visibility: auto;
  contain-intrinsic-size: 40px;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 700px) {
  .tl-main {
    padding: 52px 8px 40px;
  }
  .insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tl-row {
    grid-template-columns: 38px 36px 1fr auto auto;
    gap: 4px;
    padding: 3px 4px;
    font-size: 12px;
  }
  .tl-time { font-size: 12px; }
  .tl-chain { font-size: 6px; padding: 1px 3px; }
  .tl-node-link { font-size: 12px; }
  .tl-amount { font-size: 12px; }
  .tl-tx-link { font-size: 12px; }
}

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

/* =============================================================================
   REDUCED MOTION
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not (content-visibility: auto) {
  .tl-row,
  .tl-day-sep,
  .tl-phase-sep,
  .tl-gap,
  .tl-watermark {
    contain: layout paint;
  }
}
