﻿/* ── [cmc_etf_tracker] Crypto ETF Tracker Dashboard ──────────────────────── */

.cmc-etft {
    font-family: inherit!important;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    direction: rtl;
    width: 100%;
}

/* ── Row 1: Flow chart + sidebar ── */
.cmc-etft-row1 {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 340px;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Row 2: AUM % + Total AUM ── */
.cmc-etft-row2 {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 300px;
    border-bottom: 1px solid #e2e8f0;
}

.cmc-etft-row2 .cmc-etft-chart-panel {
    flex: 1 1 0;
    min-width: 0;
    border-left: 1px solid #e2e8f0;
}

.cmc-etft-row2 .cmc-etft-chart-panel:first-child { border-left: none; }

/* ── Flow panel ── */
.cmc-etft-flow-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid #e2e8f0;
}

/* ── Generic chart panel ── */
.cmc-etft-chart-panel {
    padding: 14px 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Flow header ── */
.cmc-etft-flow-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    direction: rtl;
}

.cmc-etft-flow-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.cmc-etft-title-date {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-left: 4px;
}

.cmc-etft-flow-tabs-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    direction: ltr;
}

/* ── Chart header ── */
.cmc-etft-chart-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
    flex-wrap: wrap;
    gap: 6px;
}

.cmc-etft-chart-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    line-height: 1.4;
}

/* ── Tabs ── */
.cmc-etft-tabs {
    display: flex;
    gap: 3px;
    direction: ltr;
    flex-shrink: 0;
}

.cmc-etft-tab {
    background: transparent!important;
    border: 1px solid #e2e8f0!important;
    cursor: pointer!important;
    font-size: 11px!important;
    font-weight: 600!important;
    color: #64748b!important;
    padding: 3px 10px!important;
    border-radius: 4px!important;
    transition: all 0.12s!important;
    font-family: inherit!important;
    line-height: 1.5!important;
    white-space: nowrap!important;
}

.cmc-etft-tab:hover { background: #f8fafc!important; color: #334155!important; }
.cmc-etft-tab--active { background: #0f172a!important; color: #fff!important; border-color: #0f172a!important; }

/* Filter tabs (currency/fund) */
.cmc-etft-filter-tabs {
    display: flex;
    gap: 3px;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    direction: rtl;
}

.cmc-etft-ftab {
    background: transparent!important;
    border: none!important;
    cursor: pointer!important;
    font-size: 11px!important;
    font-weight: 600!important;
    color: #64748b!important;
    padding: 3px 10px!important;
    border-radius: 4px!important;
    transition: all 0.12s!important;
    font-family: inherit!important;
    line-height: 1.5!important;
    white-space: nowrap!important;
}

.cmc-etft-ftab--active { background: #fff!important; color: #0f172a!important; box-shadow: 0 1px 3px rgba(0,0,0,0.1)!important; }

/* ── Flow legend ── */
.cmc-etft-flow-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.cmc-etft-leg {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #64748b;
}

.cmc-etft-leg strong { font-size: 13px; font-weight: 700; }

.cmc-etft-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Chart canvas ── */
.cmc-etft-chart-wrap {
    flex: 1;
    position: relative;
    min-height: 220px;
}

.cmc-etft-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* ── Watermark ── */
.cmc-etft-watermark {
    font-size: 10px;
    color: #cbd5e1;
    text-align: left;
    padding-top: 2px;
}

/* ── AUM % legend ── */
.cmc-etft-pct-legend {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.cmc-etft-pl-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #64748b;
}

.cmc-etft-pl-item strong { font-size: 13px; font-weight: 700; color: #0f172a; }

.cmc-etft-pl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Sidebar ── */
.cmc-etft-flow-sidebar {
    flex: 0 0 230px;
    display: flex;
    flex-direction: column;
    background: #fafbfc;
    border-left: 1px solid #e2e8f0;
    order: -1;
}

.cmc-etft-side-card {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.cmc-etft-side-sub {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 4px;
    white-space: nowrap;
    direction: ltr;
}

.cmc-etft-side-big {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    direction: ltr;
}

.cmc-etft-side-title {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    direction: ltr;
}

.cmc-etft-hist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f8fafc;
    direction: ltr;
    gap: 8px;
}

.cmc-etft-hist-row:last-child { border-bottom: none; }

.cmc-etft-hist-val {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.cmc-etft-hist-lbl {
    font-size: 10px;
    color: #64748b;
    text-align: right;
    flex: 1;
}

/* ── Colors ── */
.cmc-etft-pos { color: #16c784; }
.cmc-etft-neg { color: #ea3943; }

/* ── Table section ── */
.cmc-etft-table-section {
    padding: 0;
    background: #fff;
}

/* Table tab bar */
.cmc-etft-table-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 16px;
    direction: ltr;
}

.cmc-etft-ttab {
    background: transparent!important;
    border: none!important;
    border-bottom: 2px solid transparent!important;
    cursor: pointer!important;
    font-size: 13px!important;
    font-weight: 600!important;
    color: #64748b!important;
    padding: 12px 16px!important;
    transition: all 0.12s!important;
    font-family: inherit!important;
    line-height: 1.5!important;
    margin-bottom: -1px!important;
}

.cmc-etft-ttab:hover { color: #334155!important; }
.cmc-etft-ttab--active { color: #0f172a!important; border-bottom-color: #0f172a!important; }

/* Table views */
.cmc-etft-tview { display: none; }
.cmc-etft-tview--active { display: block; }

.cmc-etft-table-wrap { overflow-x: auto; }

.cmc-etft-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    min-width: 600px;
}

.cmc-etft-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 11px;
    padding: 10px 14px;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    cursor: default;
}

.cmc-etft-tc { text-align: right; }
.cmc-etft-tr { text-align: right; }

.cmc-etft-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    white-space: nowrap;
    vertical-align: middle;
}

.cmc-etft-table tr:last-child td { border-bottom: none; }
.cmc-etft-table tr:hover td { background: #f8fafc; }

/* Ticker cell */
.cmc-etft-ticker-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cmc-etft-ticker {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.cmc-etft-coin-tag {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
}

.cmc-etft-coin-btc { background: #fff7ed; color: #f97316; }
.cmc-etft-coin-eth { background: #eff6ff; color: #3b82f6; }

.cmc-etft-td-name {
    font-weight: 500;
    color: #475569;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmc-etft-type {
    color: #64748b;
    font-size: 11px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .cmc-etft-row1 { flex-direction: column; }
    .cmc-etft-flow-panel { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-etft-flow-sidebar {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
    .cmc-etft-side-card { flex: 1 1 180px; }
}

@media (max-width: 760px) {
    .cmc-etft-row2 { flex-direction: column; }
    .cmc-etft-row2 .cmc-etft-chart-panel { border-left: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-etft-flow-sidebar { flex-direction: column; }
}

@media (max-width: 480px) {
    .cmc-etft-chart-wrap { min-height: 180px; }
    .cmc-etft-flow-tabs-wrap { flex-direction: column; align-items: flex-start; }
}
