﻿/* ── [cmc_fear_greed_2] Fear & Greed Full Dashboard ──────────────────────── */

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

.cmc-fg2-error {
    padding: 20px;
    color: #64748b;
    font-size: 13px;
}

/* ── Top grid (chart + sidebar) ── */
.cmc-fg2-top {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 400px;
}

/* ── Chart panel ── */
.cmc-fg2-chart-panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 16px 20px 12px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cmc-fg2-chart-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: rtl;
}

.cmc-fg2-chart-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

/* Range tabs */
.cmc-fg2-tabs {
    display: flex;
    gap: 4px;
    direction: ltr;
}

.cmc-fg2-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.4!important;
}

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

/* Legend */
.cmc-fg2-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    direction: rtl;
}

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

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

.cmc-fg2-leg-bar { border-radius: 2px; }

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

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

/* ── Sidebar ── */
.cmc-fg2-sidebar {
    flex: 0 0 230px;
    display: flex;
    flex-direction: column;
    order: -1;
}

/* ── Gauge card ── */
.cmc-fg2-gauge-card {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    flex-shrink: 0;
}

.cmc-fg2-gauge-title {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.45;
    margin-bottom: 2px;
}

.cmc-fg2-gauge-wrap { position: relative; }

.cmc-fg2-gauge-svg {
    width: 100%;
    max-height: 95px;
    display: block;
}

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

.cmc-fg2-gauge-num {
    font-size: 34px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.cmc-fg2-gauge-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-top: 3px;
}

/* Gauge accent colors */
.cmc-fg2-fng-extreme-fear  .cmc-fg2-gauge-num { color: #ea3943; }
.cmc-fg2-fng-fear          .cmc-fg2-gauge-num { color: #ff9f43; }
.cmc-fg2-fng-neutral       .cmc-fg2-gauge-num { color: #f0b429; }
.cmc-fg2-fng-greed         .cmc-fg2-gauge-num { color: #93d150; }
.cmc-fg2-fng-extreme-greed .cmc-fg2-gauge-num { color: #16c784; }

/* ── Shared sidebar card ── */
.cmc-fg2-hist-card,
.cmc-fg2-hilo-card {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}

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

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

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

.cmc-fg2-hist-lbl {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
}

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

/* ── Value badges ── */
.cmc-fg2-hist-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.cmc-fg2-badge-extreme-fear  { background: #fef2f2; color: #ea3943; }
.cmc-fg2-badge-fear          { background: #fff7ed; color: #f97316; }
.cmc-fg2-badge-neutral       { background: #fefce8; color: #ca8a04; }
.cmc-fg2-badge-greed         { background: #f0fdf4; color: #16a34a; }
.cmc-fg2-badge-extreme-greed { background: #dcfce7; color: #16c784; }

/* ── Hi/Lo card ── */
.cmc-fg2-hilo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    gap: 6px;
    border-bottom: 1px solid #f8fafc;
}

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

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

.cmc-fg2-hilo-what {
    font-size: 11px;
    color: #0f172a;
    font-weight: 600;
}

.cmc-fg2-hilo-date {
    font-size: 9px;
    color: #94a3b8;
}

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

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

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

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

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

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

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

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

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

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

.cmc-fg2-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-fg2-article-title:hover { color: #3b82f6; }
p.cmc-fg2-article-title { margin: 0; }

.cmc-fg2-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-fg2-article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
}

.cmc-fg2-article-src { font-size: 10px; color: #64748b; }

.cmc-fg2-article-time {
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 3px;
}

.cmc-fg2-article-time svg { color: #94a3b8; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .cmc-fg2-top { flex-direction: column; }
    .cmc-fg2-chart-panel { border-right: none; border-bottom: 1px solid #e2e8f0; }
    .cmc-fg2-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cmc-fg2-gauge-card { flex: 0 0 200px; border-left: 1px solid #f1f5f9; }
    .cmc-fg2-hist-card,
    .cmc-fg2-hilo-card { flex: 1 1 160px; }
    .cmc-fg2-articles-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .cmc-fg2-sidebar { flex-direction: column; }
    .cmc-fg2-gauge-card { flex: none; border-left: none; }
    .cmc-fg2-articles-grid { grid-template-columns: 1fr; }
    .cmc-fg2-chart-wrap { min-height: 220px; }
    .cmc-fg2-tabs { flex-wrap: wrap; }
}
