/* ============================================================
   Coindaily - ETF flow pages (overview + per-asset)
   Complements styles.css.
   ============================================================ */

.page-hero { padding: 18px 0 22px; border-bottom: 1px solid var(--hairline); }
.page-hero .ph-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-hero .ph-logo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: #16171b; }
.page-hero h1 { font-size: 24px; font-weight: 700; color: var(--tx-hi); letter-spacing: -0.025em; }
.page-hero .ph-sym { font-family: var(--mono); font-size: 12px; color: var(--tx-mid); background: var(--panel-2); border: 1px solid var(--hairline); padding: 2px 7px; border-radius: 5px; text-transform: uppercase; }
.page-hero .ph-sub { font-size: 13px; color: var(--tx-dim); margin-top: 6px; max-width: 720px; }
.page-hero .ph-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.note-banner { display: flex; gap: 10px; align-items: flex-start; background: rgba(201,154,75,.05); border: 1px solid rgba(201,154,75,.2); border-radius: var(--r); padding: 12px 15px; margin: 18px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--tx-mid); }
.note-banner b { color: var(--amber); }

/* stat strip */
.etf-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--hairline-2); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden; margin: 20px 0; }
.etf-stat { background: var(--panel); padding: 15px 16px; }
.etf-stat .l { font-size: 10px; color: var(--tx-dim); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px; }
.etf-stat .v { font-family: var(--mono); font-size: 18px; color: var(--tx-hi); font-weight: 600; letter-spacing: -0.01em; }
.etf-stat .d { font-family: var(--mono); font-size: 11px; margin-top: 6px; }

/* chart */
.etf-tabs { display: flex; gap: 1px; background: var(--hairline-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); overflow: hidden; }
.etf-tabs button { padding: 4px 11px; font-family: var(--mono); font-size: 11px; color: var(--tx-dim); background: var(--panel); transition: .12s; }
.etf-tabs button.active { color: var(--amber); }
.etf-tabs button:hover { color: var(--tx); }
.fchart-wrap { position: relative; padding: 16px 16px 8px; }
.fchart-svg { width: 100%; height: 320px; display: block; }
.fchart-ylab { position: absolute; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); transform: translateY(-50%); pointer-events: none; }
.fchart-ylab.l { left: 14px; } .fchart-ylab.r { right: 14px; color: var(--amber); }
.fchart-xlab { position: absolute; bottom: 6px; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); transform: translateX(-50%); }
.fchart-legend { display: flex; align-items: center; gap: 16px; padding: 11px 18px; border-top: 1px solid var(--hairline-2); font-size: 12px; color: var(--tx-mid); }
.fchart-legend .lg { display: flex; align-items: center; gap: 7px; }
.fchart-legend .sw { width: 11px; height: 11px; border-radius: 3px; }
.fchart-legend .swl { width: 14px; height: 2px; }

/* stacked "net assets by issuer" chart */
.schart-wrap { position: relative; padding: 16px 16px 8px; }
.schart-svg { width: 100%; height: 300px; display: block; }
.schart-ylab { position: absolute; right: 14px; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); background: var(--panel); padding: 0 4px; transform: translateY(-50%); pointer-events: none; }
.schart-xlab { position: absolute; bottom: 6px; font-family: var(--mono); font-size: 10px; color: var(--tx-dim); transform: translateX(-50%); }
.schart-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--hairline-2); font-size: 11.5px; color: var(--tx-mid); }
.schart-legend .lg { display: flex; align-items: center; gap: 6px; }
.schart-legend .lg b { color: var(--tx); font-family: var(--mono); margin-left: 3px; }
.schart-legend .sw { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* funds table */
.fund-table { width: 100%; border-collapse: collapse; }
.fund-table thead th { text-align: right; font-size: 10px; color: var(--tx-dim); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--hairline); }
.fund-table th:nth-child(1), .fund-table th:nth-child(2), .fund-table td:nth-child(1), .fund-table td:nth-child(2) { text-align: left; }
.fund-table td { padding: 12px 14px; border-bottom: 1px solid var(--hairline-2); text-align: right; font-family: var(--mono); font-size: 12.5px; color: var(--tx); }
.fund-table tbody tr:last-child td { border-bottom: none; }
.fund-table tbody tr:hover { background: rgba(255,255,255,.018); }
.fund-table tfoot td { padding: 12px 14px; border-top: 1px solid var(--hairline); font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--tx-hi); text-align: right; }
.fund-table tfoot td:first-child { text-align: left; }
.fund-iss { display: flex; align-items: center; gap: 10px; }
.fund-iss .badge-iss { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.fund-iss img.badge-iss { object-fit: cover; background: #fff; border: 1px solid var(--hairline); }
.fund-iss .nm { font-family: var(--sans); font-weight: 600; color: var(--tx-hi); }
.fund-tk { font-family: var(--mono); color: var(--tx-mid); }
.flow-pos { color: var(--up); } .flow-neg { color: var(--down); }

/* layout for lower grid */
.etf-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; padding: 4px 0 22px; }
.etf-col { display: flex; flex-direction: column; gap: 18px; }
.sim-row { display: flex; align-items: center; gap: 11px; padding: 11px 16px; border-bottom: 1px solid var(--hairline-2); font-size: 13px; }
.sim-row:last-child { border-bottom: none; } .sim-row:hover { background: rgba(255,255,255,.018); }
.sim-row img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sim-row .s { font-weight: 600; color: var(--tx-hi); } .sim-row .n { font-size: 11px; color: var(--tx-dim); }
.sim-row .px { margin-left: auto; font-family: var(--mono); text-align: right; }
.arrow-link { color: var(--amber); font-size: 12px; }

@media (max-width: 1000px) {
  .etf-stats { grid-template-columns: repeat(3, 1fr); }
  .etf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .etf-stats { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   Loading skeleton - shimmer the stats/charts/tables until the
   real CoinGlass ETF data lands (never flash modelled numbers).
   ============================================================ */
@keyframes etf-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
body.etf-loading .etf-stat .v,
body.etf-loading #ov-today, body.etf-loading #ov-cum, body.etf-loading #ov-aum {
  color: transparent !important; border-radius: 5px;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: etf-shimmer 1.3s ease-in-out infinite;
}
body.etf-loading #fchart-wrap, body.etf-loading #schart-wrap { position: relative; }
body.etf-loading #fchart-wrap::after, body.etf-loading #schart-wrap::after {
  content: ""; position: absolute; inset: 0; border-radius: 8px; pointer-events: none; z-index: 4;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--elevated) 37%, var(--panel-2) 63%);
  background-size: 400% 100%; animation: etf-shimmer 1.3s ease-in-out infinite;
}
body.etf-loading #funds-body, body.etf-loading #ov-body { visibility: hidden; }
