/* =============================================
   CMC Trending Overview Widget  v1.4.0
   Shortcode: [cmc_trending_overview]
   4-column layout: trending | gainers | cards | news
   ============================================= */

/* ── Wrapper ──────────────────────────────── */
.cmc-trending-overview {
    font-family: inherit;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    max-width: 100%;
}

/* ── Question pills bar ───────────────────── */
.cmc-to-pills-bar {
    background: #fafbfc;
    border-bottom: 1px solid #e9ecef;
    padding: 0 16px;
}

.cmc-to-pills-track {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}

.cmc-to-pills-track::-webkit-scrollbar { display: none; }

.cmc-to-pill {
    flex-shrink: 0;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 2px;
    white-space: nowrap;
    cursor: default;
    border: 1px solid transparent;
}

.cmc-to-pill:first-child {
    background: #eef2ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

/* ── 4-column grid ────────────────────────── */
.cmc-to-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 300px;
}

.cmc-to-col {
    flex: 1 1 0;
    min-width: 160px;
    border-left: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.cmc-to-col:last-child { border-left: none; }

/* ── Column header ────────────────────────── */
.cmc-to-col-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    gap: 6px;
    flex-shrink: 0;
}

.cmc-to-col-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header icon group (👁 🕒 🔥) */
.cmc-to-hd-icons {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.cmc-to-hd-icon {
    font-size: 12px;
    line-height: 1;
    cursor: default;
    opacity: 0.35;
    font-style: normal;
}

.cmc-to-hd-icon--on { opacity: 1; }

/* ── Coin list rows ───────────────────────── */
.cmc-to-list {
    padding: 4px 0;
    flex: 1;
}

.cmc-to-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f8fafc;
    gap: 6px;
    transition: background 0.1s;
}

.cmc-to-row:last-child { border-bottom: none; }
.cmc-to-row:hover { background: #fafbfc; }

/* Left side: rank bubble + logo + meta */
.cmc-to-row-l {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.cmc-to-rank-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 800;
    color: #ffffff;
    flex-shrink: 0;
    line-height: 1;
}

.cmc-to-logo {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #f1f5f9;
}

.cmc-to-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
    min-width: 0;
}

.cmc-to-sym {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.cmc-to-name {
    font-size: 10px;
    font-weight: 500;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Right side: price + change + sparkline */
.cmc-to-row-r {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.cmc-to-price-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.cmc-to-price {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    direction: ltr;
    white-space: nowrap;
    display: block;
}

.cmc-to-chg {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    display: block;
    direction: ltr;
}

/* Sparkline (CoinGecko SVG image) */
.cmc-to-spark-img {
    width: 52px;
    height: 24px;
    display: inline-block;
    object-fit: contain;
    flex-shrink: 0;
}

.cmc-spark-up   { filter: hue-rotate(85deg)  saturate(1.5) brightness(0.9);  }
.cmc-spark-down { filter: hue-rotate(300deg) saturate(2)   brightness(0.85); }

/* ── Stat cards column (col 3) ────────────── */
.cmc-to-col-cards {
    flex: 0 0 260px;
    min-width: 0;
}

/* 2-card horizontal row inside cards column */
.cmc-to-cards-row {
    display: flex;
    gap: 8px;
    padding: 8px 8px 4px;
    flex: 1;
}

.cmc-to-cards-row:last-child { padding-bottom: 8px; }

.cmc-to-mini-card {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 2px;
    padding: 8px 10px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cmc-to-mc-lbl {
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    display: block;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Stat card body: inline SVG spark + value/change */
.cmc-to-mc-body {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    direction: ltr;
    flex: 1;
}

.cmc-to-mini-spark {
    width: 42px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.cmc-to-mc-vals {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cmc-to-mc-val {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
    white-space: nowrap;
}

.cmc-to-mc-chg {
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── F&G mini card ────────────────────────── */
.cmc-to-mini-card--fng {
    padding: 8px 6px 4px;
    justify-content: space-between;
}

.cmc-fng-gauge-wrap {
    position: relative;
    margin-top: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cmc-fng-svg {
    width: 100%;
    display: block;
    max-height: 70px;
}

.cmc-fng-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -6px;
}

.cmc-fng-num {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    display: block;
}

.cmc-fng-lbl {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    margin-top: 2px;
    display: block;
}

/* F&G accent colours */
.cmc-to-fng-extreme-fear  .cmc-fng-num { color: #ea3943; }
.cmc-to-fng-fear          .cmc-fng-num { color: #ff9f43; }
.cmc-to-fng-neutral       .cmc-fng-num { color: #f0b429; }
.cmc-to-fng-greed         .cmc-fng-num { color: #93d150; }
.cmc-to-fng-extreme-greed .cmc-fng-num { color: #16c784; }

/* ── Alt season mini card ─────────────────── */
.cmc-to-mini-card--alt {
    justify-content: space-between;
}

.cmc-to-alt-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.cmc-to-alt-score {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    display: block;
    text-align: center;
}

.cmc-to-alt-track-wrap { padding: 2px 0; }

.cmc-to-alt-track {
    position: relative;
    height: 6px;
    border-radius: 2px;
    background: linear-gradient(to right, #16c784, #f0b429, #ea3943);
    direction: ltr;
}

.cmc-to-alt-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #1e293b;
    border: 2.5px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.cmc-to-alt-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    direction: ltr;
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
}

/* ── News column (col 4) ─────────────────── */
.cmc-to-col-news {
    flex: 0 0 210px;
    min-width: 0;
}

.cmc-to-news-card {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    flex: 1;
}

.cmc-to-news-card:last-of-type { border-bottom: none; }

.cmc-to-news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
    gap: 6px;
}

.cmc-to-news-src {
    font-size: 10px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmc-to-news-time {
    font-size: 9px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.cmc-to-news-title {
    font-size: 11px;
    font-weight: 600;
    color: #334155;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

a.cmc-to-news-title:hover { color: #4338ca; text-decoration: none; }
p.cmc-to-news-title { margin: 0; }

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

.cmc-to-no-data {
    padding: 20px 14px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    margin: 0;
}

.cmc-error {
    padding: 16px;
    font-size: 12px;
    color: #64748b;
    text-align: center;
}

/* ── Footer ───────────────────────────────── */
.cmc-to-footer {
    font-size: 10px;
    color: #cbd5e1;
    text-align: left;
    margin: 0;
    padding: 8px 16px;
    border-top: 1px solid #f1f5f9;
    direction: ltr;
}

/* ── Responsive: tablet (2-col) ───────────── */
@media (max-width: 960px) {
    .cmc-to-col-cards { flex: 0 0 230px; }
    .cmc-to-col-news  { flex: 0 0 180px; }
}

@media (max-width: 760px) {
    .cmc-to-grid {
        flex-direction: column;
    }
    .cmc-to-col,
    .cmc-to-col-cards,
    .cmc-to-col-news {
        flex: unset;
        width: 100%;
        border-left: none;
        border-top: 1px solid #f1f5f9;
    }
    .cmc-to-col:first-child { border-top: none; }
    .cmc-to-cards-row { flex-wrap: wrap; }
    .cmc-to-mini-card { min-width: 120px; }
    .cmc-to-col-news  { width: 100%; }
    .cmc-to-news-card { border-bottom: 1px solid #f1f5f9; border-top: none; }
}

/* ── Responsive: mobile ───────────────────── */
@media (max-width: 480px) {
    .cmc-to-pill         { font-size: 10px; padding: 4px 10px; }
    .cmc-to-mc-val       { font-size: 12px; }
    .cmc-fng-num         { font-size: 16px; }
    .cmc-to-alt-score    { font-size: 18px; }
    .cmc-to-rank-bubble  { width: 18px; height: 18px; font-size: 8px; }
}
