/* WallGold frontend — values, skeleton/blur, change chip, card */

/* Typography is inherited from the theme on purpose: the site sets its own
   Persian font in Bricks, and declaring a second family here fought with it. */

.wgx {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: rtl;
    vertical-align: middle;
}
.wgx-unit {
    font-size: .82em;
    opacity: .7;
    font-weight: 400;
}
.wgx-err { opacity: .45; }

/* Skeleton shimmer (shown only when a value is genuinely missing) */
.wgx-skeleton .wgx-val,
.wgx-skeleton.wgx-chip,
.wgx-skeleton.wgx-dir {
    display: inline-block;
    min-width: 64px;
    height: 1em;
    border-radius: 4px;
    color: transparent !important;
    background: linear-gradient(90deg, #e6e6e6 25%, #f2f2f2 50%, #e6e6e6 75%);
    background-size: 200% 100%;
    animation: wgx-shimmer 1.4s infinite;
}
.wgx-skeleton.wgx-dir { min-width: 16px; }
.wgx-skeleton-wide .wgx-val { min-width: 150px; }
@keyframes wgx-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Change chip (percent + icon + color) */
.wgx-chip {
    padding: 7px 7px !important;
    border-radius: 6px;
    font-size: .9em;
    font-weight: 400 !important;
    line-height: 1;
    gap: 3px;
    direction: ltr; /* arrow on the LEFT by default */
}
/* arrow="right" -> put the icon on the right side of the percent */
.wgx-chip.wgx-arrow-right { flex-direction: row-reverse; }
.wgx-chip .wgx-chip-icon { width: 12px; height: 12px; }
.wgx-chip-up    { color: #039874; background: rgba(3, 152, 116, .1); }
.wgx-chip-down  { color: #F65555; background: rgba(246, 85, 85, .1); }
.wgx-chip-neutral { color: #555; background: #f0f0f0; }

/* change_amount text coloring */
.wgx-num.wgx-up   .wgx-val { color: #039874; }
.wgx-num.wgx-down .wgx-val { color: #F65555; }

/* direction icon */
.wgx-dir-icon { width: 14px; height: 14px; vertical-align: middle; }

/* [wgx-card] */
.wgx-card {
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 14px;
    padding: 14px 16px;
    max-width: 420px;
    direction: rtl;
    background: #fff;
    font-family: inherit;
}
.wgx-card-head {
    font-weight: 700;
    font-size: 1.02em;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, .07);
}
.wgx-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
}
.wgx-card-name { font-size: .95em; color: #1a1a1a; }
.wgx-card-vals { display: inline-flex; align-items: center; gap: 8px; }

/* ============ GENERAL (عمومی) shortcodes ============ */

/* #3 smart blinking dot: 12px solid dot + pulsing halo (spreads ~12px) */
.wgx-blink { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; vertical-align: middle; }
.wgx-blink-dot { width: 12px; height: 12px; border-radius: 50%; position: relative; }
.wgx-blink-dot::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; border-radius: 50%;
    transform: translate(-50%, -50%); background: var(--wgx-halo, #eaeaea);
    animation: wgx-blink-halo 1.7s ease-out infinite;
}
.wgx-blink-up      { background: #039874; --wgx-halo: rgba(3, 152, 116, .35); }
.wgx-blink-down    { background: #F65555; --wgx-halo: rgba(246, 85, 85, .35); }
.wgx-blink-neutral { background: #c9c9c9; --wgx-halo: #eaeaea; }
@keyframes wgx-blink-halo {
    0%   { width: 12px; height: 12px; opacity: .9; }
    100% { width: 36px; height: 36px; opacity: 0; }
}

/* #9 conditional change icon (24×24) */
.wgx-cicon { display: inline-flex; align-items: center; }
.wgx-cicon-img { width: 24px; height: 24px; vertical-align: middle; }

/* #4 bubble icon */
.wgx-bicon { display: inline-flex; align-items: center; }
.wgx-bicon-img { height: 18px; width: auto; vertical-align: middle; }

/* #5 bubble indicator — INVERTED colors: positive = red, negative = green */
.wgx-bubble-pos     .wgx-val { color: #F65555; font-weight: 600; direction: ltr; }
.wgx-bubble-neg     .wgx-val { color: #039874; font-weight: 600; direction: ltr; }
.wgx-bubble-neutral .wgx-val { color: #555; direction: ltr; }

/* #7 percent-change word */
.wgx-cword.wgx-cw-up      .wgx-val { color: #039874; }
.wgx-cword.wgx-cw-down    .wgx-val { color: #F65555; }
.wgx-cword.wgx-cw-neutral .wgx-val { color: #c9c9c9; }

/* #8 conditional background (add class `wgx-cond-bg` + attribute data-wgx-skey) */
.wgx-cb-pos     { background: #F2FBF9 !important; border: 1px solid #CCF1E84D !important; }
.wgx-cb-neg     { background: #FFF6F6 !important; border: 1px solid #FEEEEE !important; }
.wgx-cb-neutral { background: #00000005 !important; border: 1px solid #0000000D !important; }

/* ============ [wgx-chart] ============ */

.wgx-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    direction: rtl;
    font-family: inherit;
}
.wgx-chart-canvas {
    position: relative;
    width: 100%;
    direction: ltr; /* SVG coordinates + tooltip math stay LTR */
}
.wgx-chart-canvas svg { display: block; width: 100%; height: 100%; }
.wgx-chart-loading {
    border-radius: 8px;
    background: linear-gradient(90deg, #f3f3f3 25%, #fafafa 50%, #f3f3f3 75%);
    background-size: 200% 100%;
    animation: wgx-shimmer 1.4s infinite;
}
.wgx-chart-empty {
    display: flex; align-items: center; justify-content: center;
    color: rgba(0, 0, 0, .4); font-size: 13px;
}

/* hover tooltip (like image 3) */
.wgx-chart-tip {
    position: absolute;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .14);
    padding: 6px 14px;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
    direction: rtl;
    z-index: 9;
}
.wgx-chart-tip-price { font-size: 14px; font-weight: 600; color: #252525; }
.wgx-chart-tip-date  { font-size: 12px; font-weight: 400; color: rgba(0, 0, 0, .6); margin-top: 2px; }

/* min/max row (chart2.css) — spec rhythm: chart →48px→ minmax →16px→ pills.
   The flat flex gap is 24px, so +24 above and -8 below reproduce 48/16. */
.wgx-chart-minmax {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 12px;
    direction: rtl;
    margin-top: 24px;
    margin-bottom: -8px;
}
.wgx-chart-mm-group { display: inline-flex; align-items: center; gap: 4px; direction: ltr; }
.wgx-chart-mm-group .lbl { font-size: 14px; font-weight: 400; line-height: 24px; color: rgba(0, 0, 0, .6); }
.wgx-chart-mm-group .num { font-size: 16px; font-weight: 500; line-height: 28px; color: #252525; }
.wgx-chart-mm-sep { width: 1px; height: 16px; background: rgba(0, 0, 0, .1); }

/* period pills (chart.css / chart2.css) */
.wgx-chart-pills {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    direction: rtl;
}
.wgx-chart-pill {
    font-family: inherit;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    color: rgba(0, 0, 0, .6);
    background: transparent;
    border: none;
    border-radius: 1000px;
    padding: 4px 0; /* spec: only the ACTIVE pill carries horizontal padding */
    cursor: pointer;
    transition: background .15s ease, color .15s ease, padding .15s ease;
}
.wgx-chart-pill:hover { color: #252525; }
.wgx-chart-pill.is-active {
    background: #F5F6F7;
    color: #252525;
    font-weight: 500;
    padding: 4px 8px;
}

/* ============ [wgx-table] (table.css / image 4) ============ */

.wgx-table {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 16px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 16px;
    background: #fff;
    direction: rtl;
    font-family: inherit;
}
.wgx-table-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 28px;
    color: #252525;
    text-align: right;
}
.wgx-table-divider { height: 1px; width: 100%; background: rgba(0, 0, 0, .1); }
.wgx-table-title-link { color: inherit !important; text-decoration: none !important; }
.wgx-table-title-link:hover { opacity: .8; }
a.wgx-trow { color: inherit !important; text-decoration: none !important; }
a.wgx-trow:hover .wgx-trow-name { opacity: .75; }
.wgx-table-rows { display: flex; flex-direction: column; gap: 16px; }
.wgx-trow {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.wgx-trow-right { display: inline-flex; align-items: center; gap: 8px; }
.wgx-trow-chev {
    width: 20px; height: 20px;
    background: #F2F2F2;
    border-radius: 15px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.wgx-trow-chev img { width: 20px; height: 20px; }
.wgx-trow-name { font-size: 14px; font-weight: 500; line-height: 24px; color: #252525; }
.wgx-trow-left { display: inline-flex; align-items: center; gap: 8px; }
.wgx-trow-price { display: inline-flex; align-items: center; gap: 4px; direction: ltr; }
.wgx-trow-unit { font-size: 14px; font-weight: 400; line-height: 24px; color: rgba(0, 0, 0, .6); }
.wgx-trow-num  { font-size: 14px; font-weight: 700; line-height: 24px; color: #252525; }
.wgx-trow-price.wgx-skeleton .wgx-val { min-width: 72px; }
.wgx-trow-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    direction: ltr;
}
.wgx-trow-chip img { width: 16px; height: 16px; }
.wgx-trow-chip.up      { background: #E6F5F1; color: #039874; }
.wgx-trow-chip.down    { background: rgba(246, 85, 85, .1); color: #F65555; }
.wgx-trow-chip.neutral { background: #F2F2F2; color: #555; }
.wgx-tchip-loading {
    width: 56px;
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: wgx-shimmer 1.4s infinite;
}

/* ============ Analytic widgets — shared card shell ============ */

.wgx-widget {
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 432px;            /* desktop fixed width */
    max-width: 100%;         /* never overflow narrow screens */
    margin-left: auto;
    margin-right: auto;
    min-height: 400px;
    padding: 12px 16px 16px;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden;
    direction: rtl;
    font-family: inherit;
}
@media (max-width: 768px) {
    .wgx-widget { width: 400px; }
}
.wgx-widget-mark {
    position: absolute;
    width: 276px;
    height: auto;
    left: -47px;
    top: -26px;
    pointer-events: none;
    user-select: none;
}
.wgx-widget-head {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}
.wgx-widget-icon { width: 48px; height: 48px; border-radius: 12px; }
.wgx-widget-title { font-size: 14px; font-weight: 700; line-height: 24px; color: #252525; }
.wgx-widget-sub   { font-size: 12px; font-weight: 400; line-height: 20px; color: rgba(0, 0, 0, .6); margin-top: -4px; }
.wgx-widget-body  { position: relative; flex: 1; margin-top: 12px; min-height: 130px; }
.wgx-widget-loading {
    position: absolute;
    inset: 0; /* fill the body -> the card never resizes when data lands */
    border-radius: 10px;
    background: linear-gradient(90deg, #f3f3f3 25%, #fafafa 50%, #f3f3f3 75%);
    background-size: 200% 100%;
    animation: wgx-shimmer 1.4s infinite;
}
.wgx-widget-strip {
    box-sizing: border-box;
    min-height: 56px;
    background: #FBFBFC;
    border: 1px solid rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    gap: 8px;
}
.wgx-widget-strip:empty { visibility: hidden; }
/* smart-bubble: price LEFT, vs-average pill RIGHT (user CSS) */
.wgx-sbw .wgx-widget-strip { direction: ltr; }
.wgx-sbw-vsavg { direction: rtl; }
/* fear: score LEFT / label RIGHT, each CENTERED in its half */
.wgx-fgw .wgx-widget-strip { flex-direction: row-reverse; }
.wgx-fgw .wgx-widget-strip .wgx-fgw-score,
.wgx-fgw .wgx-widget-strip .wgx-fgw-label { flex: 1; text-align: center; }
/* decompose: label + chip each CENTERED in its half */
.wgx-dcw .wgx-widget-strip .wgx-dcw-strip-label { flex: 1; text-align: center; }
.wgx-dcw .wgx-widget-strip .wgx-dcw-chip-wrap { flex: 1; display: flex; justify-content: center; }
.wgx-widget-divider { height: 1px; background: rgba(0, 0, 0, 0.05); margin: 12px 0; }
.wgx-widget-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 36px;
}
.wgx-widget-desc { font-size: 12px; font-weight: 400; line-height: 20px; color: rgba(0, 0, 0, .6); text-align: right; }
.wgx-widget-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #F5F6F7;
    border-radius: 1000px;
    font-size: 12px;
    font-weight: 500;
    color: #252525 !important;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}
.wgx-widget-err {
    display: flex; align-items: center; justify-content: center;
    min-height: 90px; color: rgba(0,0,0,.45); font-size: 12px; text-align: center;
}

/* strip value+unit (shared look) */
.wgx-widget-strip .val-wrap { display: inline-flex; align-items: center; gap: 4px; direction: ltr; }
.wgx-widget-strip .val-num  { font-size: 20px; font-weight: 700; line-height: 36px; }
.wgx-widget-strip .val-unit { font-size: 20px; font-weight: 200; line-height: 36px; color: rgba(0, 0, 0, .6); }
.wgx-widget-strip .strip-sep { width: 1px; height: 32px; background: rgba(0, 0, 0, .1); flex-shrink: 0; }

/* ============ 1) Smart bubble (wgx-sbw) ============ */

.wgx-sbw-zone {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 1000px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}
.wgx-sbw-zone.buy  { background: #F2FBF9; border: 1px solid #CCF1E8; color: #039874; }
.wgx-sbw-zone.mid  { background: #F5F6F7; border: 1px solid rgba(0,0,0,.06); color: #555; }
.wgx-sbw-zone.sell { background: #FFF6F6; border: 1px solid #FEEEEE; color: #F65555; }

.wgx-sbw-track-wrap { position: relative; margin-top: 40px; direction: ltr; }
.wgx-sbw-track {
    height: 12px;
    border-radius: 1000px;
    background: linear-gradient(90deg, #039874 0%, #33C6A1 25.29%, #FFAA00 50.03%, #F87777 74.73%, #F65555 100%);
}
.wgx-sbw-knob {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    background: #FFFFFF;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
    border-radius: 12px;
}
.wgx-sbw-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    direction: ltr; /* left = بیشترین, right = کم‌ترین (per design) */
    font-size: 12px;
    line-height: 20px;
    color: rgba(0, 0, 0, .6);
}

.wgx-sbw-vsavg {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
}
.wgx-sbw-vsavg.good { border: 1px solid #CCF1E8; color: #039874; }
.wgx-sbw-vsavg.bad  { border: 1px solid #FEEEEE; color: #F65555; }
.wgx-sbw-vsavg img  { width: 20px; height: 20px; }
.wgx-sbw-trendbox { text-align: right; }
.wgx-sbw-trend-cap { font-size: 10px; line-height: 16px; color: rgba(0, 0, 0, .6); }
.wgx-sbw-trend-val { font-size: 12px; font-weight: 700; line-height: 20px; color: #252525; }

/* ============ 2) Fear & greed (wgx-fgw) ============ */

.wgx-fgw-gauge-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 12px; }
.wgx-fgw-gauge {
    position: relative;
    width: 160px;
    height: 88px;
}
.wgx-fgw-gauge svg { display: block; }
/* Needle: SVG asset 58x34 whose hub (pivot) sits at (48.8, 25.6) and whose tip
   points up-left at ~-154°. JS rotates it around the hub; the hub is placed at
   the gauge's bottom-center (80, 80). */
.wgx-fgw-needle {
    position: absolute;
    width: 58px;
    height: 34px;
    left: calc(50% - 48.8px);
    top: 54.4px;
    transform-origin: 48.8px 25.6px;
    transition: transform .6s cubic-bezier(.34,1.3,.64,1);
    pointer-events: none;
}
.wgx-fgw-axis {
    display: flex;
    justify-content: space-between;
    width: 210px;
    margin-top: 12px;
    direction: ltr; /* left = طمع, right = ترس (like the figma) */
    font-size: 12px;
    line-height: 20px;
    color: rgba(0, 0, 0, .6);
}
.wgx-fgw-score { font-size: 20px; font-weight: 700; line-height: 36px; }
.wgx-fgw-label { font-size: 14px; font-weight: 700; color: #252525; }
.wgx-fgw-c-xfear { color: #039874; }
.wgx-fgw-c-fear  { color: #33C6A1; }
.wgx-fgw-c-mid   { color: #FFAA00; }
.wgx-fgw-c-greed { color: #F87777; }
.wgx-fgw-c-xgreed{ color: #F65555; }

/* ============ 3) Decomposition (wgx-dcw) ============ */

.wgx-dcw-rows { display: flex; flex-direction: column; gap: 17px; margin-top: 14px; }
.wgx-dcw-row { display: flex; align-items: center; gap: 8px; }
.wgx-dcw-name {
    width: 56px;
    flex-shrink: 0;
    font-size: 10px;
    line-height: 16px;
    color: rgba(0, 0, 0, .6);
    text-align: right;
}
.wgx-dcw-row.total .wgx-dcw-name { font-weight: 700; color: #252525; }
.wgx-dcw-track {
    position: relative;
    flex: 1;
    height: 12px;
    background: #F5F6F7;
    border-radius: 1000px;
    direction: ltr;
    overflow: hidden;
}
.wgx-dcw-track .mid {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(0, 0, 0, .08);
}
.wgx-dcw-fill { position: absolute; top: 0; height: 100%; }
.wgx-dcw-fill.pos { left: 50%; background: #00B88A; border-radius: 0 1000px 1000px 0; }
.wgx-dcw-fill.neg { right: 50%; background: #F65555; border-radius: 1000px 0 0 1000px; }
.wgx-dcw-row.total .wgx-dcw-fill.pos,
.wgx-dcw-row.total .wgx-dcw-fill.neg { background: #171D26; }
.wgx-dcw-pct {
    width: 52px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 500;
    line-height: 16px;
    direction: ltr;
    justify-content: flex-end;
}
.wgx-dcw-row.total .wgx-dcw-pct { font-weight: 700; }
.wgx-dcw-pct img { width: 16px; height: 16px; }
.wgx-dcw-pct.pos { color: #039874; }
.wgx-dcw-pct.neg { color: #F65555; }
.wgx-dcw-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 1000px;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    direction: ltr;
}
.wgx-dcw-chip.pos { background: #F2FBF9; border: 1px solid #CCF1E8; color: #039874; }
.wgx-dcw-chip.neg { background: #FFF6F6; border: 1px solid #FEEEEE; color: #F65555; }
.wgx-dcw-chip img { width: 16px; height: 16px; }
.wgx-dcw-strip-label { font-size: 14px; font-weight: 700; color: #252525; }
