/* ── [cmc_btc_dominance] Bitcoin Dominance Dashboard ─────────────────────── */

.cmc-bdom {
    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%;
}

/* ── Top section (chart + sidebar) ── */
.cmc-bdom-top {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 380px;
    border-bottom: 1px solid #e2e8f0;
}

/* ── Chart panel ── */
.cmc-bdom-chart-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 18px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-right: 1px solid #e2e8f0;
}

.cmc-bdom-chart-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    direction: rtl;
}

.cmc-bdom-chart-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cmc-bdom-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

/* Legend */
.cmc-bdom-legend {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    direction: rtl;
}

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

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

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

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

/* Watermark */
.cmc-bdom-watermark {
    font-size: 9px;
    color: #cbd5e1;
    text-align: center;
    direction: ltr;
    padding-bottom: 2px;
}

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

.cmc-bdom-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-bdom-tab:hover { background: #f8fafc!important; color: #334155!important; }
.cmc-bdom-tab--active { background: #f7931a!important; color: #fff!important; border-color: #f7931a!important; }

/* ── Sidebar ── */
.cmc-bdom-sidebar {
    flex: 0 0 260px;
    display: flex;
    flex-direction: column;
    background: #fff;
    order: -1;
}

/* Sidebar header: current dominance */
.cmc-bdom-sb-hd {
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.cmc-bdom-sb-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
    margin-bottom: 12px;
}

/* 3-column dominance row */
.cmc-bdom-dom-row {
    display: flex;
    justify-content: space-between;
    direction: rtl;
    margin-bottom: 10px;
    gap: 4px;
}

.cmc-bdom-dom-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
}

.cmc-bdom-dom-lbl {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.cmc-bdom-dom-val {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.cmc-bdom-dom-chg {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.cmc-bdom-chg-up { background: #f0fdf4; color: #16c784; }
.cmc-bdom-chg-dn { background: #fef2f2; color: #ea3943; }

/* Progress bar */
.cmc-bdom-bar {
    height: 6px;
    border-radius: 3px;
    background: #f1f5f9;
    overflow: hidden;
    direction: ltr;
    display: flex;
    margin-top: 2px;
}

.cmc-bdom-bar-btc { background: #f7931a; transition: width 0.4s; }
.cmc-bdom-bar-eth { background: #627eea; transition: width 0.4s; }
.cmc-bdom-bar-oth { background: #94a3b8; transition: width 0.4s; }

/* Sidebar sections */
.cmc-bdom-sb-section {
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.cmc-bdom-sb-section:last-child { border-bottom: none; flex: 1; }

.cmc-bdom-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    text-align: right;
}

/* Historical rows */
.cmc-bdom-hist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f8fafc;
    direction: rtl;
    gap: 6px;
}

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

.cmc-bdom-hist-lbl {
    font-size: 10px;
    color: #64748b;
    flex-shrink: 0;
    text-align: right;
    min-width: 80px;
}

.cmc-bdom-hist-na { font-size: 11px; color: #94a3b8; }

.cmc-bdom-hist-vals {
    display: flex;
    align-items: center;
    gap: 5px;
    direction: ltr;
    flex-shrink: 0;
}

.cmc-bdom-hist-val {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.cmc-bdom-hist-sep { color: #e2e8f0; font-size: 10px; }

.cmc-bdom-hist-val-btc { color: #f7931a; }
.cmc-bdom-hist-val-eth { color: #627eea; }
.cmc-bdom-hist-val-oth { color: #94a3b8; }

/* Hi/Lo rows */
.cmc-bdom-hilo-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f8fafc;
    direction: rtl;
    gap: 6px;
}

.cmc-bdom-hilo-row:last-child { border-bottom: none; }

.cmc-bdom-hilo-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.cmc-bdom-hilo-lbl {
    font-size: 10px;
    color: #64748b;
    text-align: right;
}

.cmc-bdom-hilo-date {
    font-size: 9px;
    color: #94a3b8;
    direction: ltr;
    text-align: right;
}

/* ── Articles section ── */
.cmc-bdom-articles {
    padding: 18px 20px 24px;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.cmc-bdom-articles-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 14px;
    text-align: right;
}

.cmc-bdom-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    direction: rtl;
}

.cmc-bdom-article-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}

.cmc-bdom-article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.cmc-bdom-article-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
    flex-shrink: 0;
}

.cmc-bdom-article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}

.cmc-bdom-article-card:hover .cmc-bdom-article-thumb img { transform: scale(1.03); }

.cmc-bdom-article-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff7ed, #fde68a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmc-bdom-article-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    direction: rtl;
    text-align: right;
}

.cmc-bdom-article-tag {
    font-size: 9px;
    font-weight: 700;
    color: #f7931a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.cmc-bdom-article-title {
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.55;
    text-decoration: none;
    display: block;
    transition: color 0.15s;
}

a.cmc-bdom-article-title:hover { color: #f7931a; }
p.cmc-bdom-article-title { margin: 0; }

.cmc-bdom-article-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cmc-bdom-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.cmc-bdom-article-src  { font-size: 10px; color: #64748b; }
.cmc-bdom-article-time { font-size: 10px; color: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .cmc-bdom-top { flex-direction: column; }
    .cmc-bdom-chart-panel { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-bdom-sidebar {
        flex: none;
        flex-direction: row;
        flex-wrap: wrap;
        order: 0;
        border-top: 1px solid #e2e8f0;
    }
    .cmc-bdom-sb-hd { flex: 1 1 200px; }
    .cmc-bdom-sb-section { flex: 1 1 180px; }
    .cmc-bdom-articles-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .cmc-bdom-sidebar { flex-direction: column; }
    .cmc-bdom-articles-grid { grid-template-columns: 1fr; }
    .cmc-bdom-chart-wrap { min-height: 200px; }
    .cmc-bdom-dom-val { font-size: 18px; }
}
