/* ArzPaya Fear & Greed — CMC-inspired compact sidebar widget */

.aspv2-tools__fear-greed,
.arzfg-widget {
    --arzfg-surface: var(--bg-secondary, #f8fafc);
    --arzfg-border: var(--border-color, #e5e7eb);
    --arzfg-text: var(--text-body, #1f2937);
    --arzfg-muted: var(--text-muted, #64748b);
    --arzfg-fear: #ef4444;
    --arzfg-fear-mid: #f97316;
    --arzfg-neutral: #f59e0b;
    --arzfg-greed-mid: #84cc16;
    --arzfg-greed: #22c55e;
}

.aspv2-tools__fear-greed,
.arzfg-widget {
    direction: rtl;
}

.aspv2-tools__fear-greed *,
.aspv2-tools__fear-greed *::before,
.aspv2-tools__fear-greed *::after,
.arzfg-widget *,
.arzfg-widget *::before,
.arzfg-widget *::after {
    box-sizing: border-box;
}

.arzfg-error {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    font-size: 14px;
    direction: rtl;
}

/* Header */
.arzfg-card-header {
    padding: 0 0 8px;
    margin-bottom: 8px;
}

.arzfg-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--arzfg-text);
    margin: 0;
    line-height: 1.25;
}

.arzfg-card-body {
    padding: 0;
}

/* Gauge block */
.arzfg-now {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin-bottom: 6px;
}

.arzfg-gauge-cmc {
    display: block;
    width: 100%;
    max-width: 190px;
    height: auto;
    margin: 0 auto;
}

.arzfg-gauge-bg {
    stroke: var(--arzfg-border);
}

.arzfg-gauge-needle {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.2));
}

.arzfg-gauge-hub {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.15));
}

.arzfg-now-score {
    margin: 4px 0 0;
    padding: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--arzfg-text);
    letter-spacing: -0.02em;
    text-align: center;
}

.arzfg-now-verdict {
    margin: 3px 0 0;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.arzfg-extreme_fear { color: var(--arzfg-fear); }
.arzfg-fear { color: var(--arzfg-fear-mid); }
.arzfg-neutral { color: var(--arzfg-neutral); }
.arzfg-greed { color: var(--arzfg-greed-mid); }
.arzfg-extreme_greed { color: var(--arzfg-greed); }

/* Summary */
.arzfg-summary {
    margin: 0 0 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--arzfg-surface);
    border: 1px solid var(--arzfg-border);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--arzfg-muted);
}

/* Sections — 8px between blocks, 6px title-to-list */
.arzfg-section {
    padding: 0;
    border-bottom: 1px solid var(--arzfg-border);
    margin-bottom: 8px;
}

.arzfg-section:last-of-type {
    margin-bottom: 0;
}

.arzfg-section-title {
    margin: 0 0 6px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--arzfg-text);
    line-height: 1.35;
}

.arzfg-section:not(:first-of-type) .arzfg-section-title {
    padding-top: 6px;
}

.arzfg-section-hint {
    font-size: 10px;
    font-weight: 400;
    color: var(--arzfg-muted);
}

/* Stat rows — equal height per list, no extra space on last child */
.arzfg-stat-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.arzfg-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 3px 0;
    min-height: 30px;
    border-bottom: 1px solid var(--arzfg-border);
}

.arzfg-stat-row dt,
.arzfg-stat-row dd {
    margin: 0;
}

.arzfg-stat-row:has(.arzfg-stat-date) {
    min-height: 38px;
}

.arzfg-stat-row:last-child {
    border-bottom: none;
}

.arzfg-stat-label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--arzfg-muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 0;
    line-height: 1.35;
}

.arzfg-stat-date {
    font-size: 11px;
    font-weight: 400;
    color: var(--arzfg-muted);
    opacity: 0.9;
    line-height: 1.3;
    margin-top: 1px;
}

.arzfg-stat-value {
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.arzfg-na {
    font-size: 13px;
    font-weight: 500;
    color: var(--arzfg-muted);
}

/* Pills */
.arzfg-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    border: 1px solid transparent;
}

.arzfg-pill-sep {
    opacity: 0.55;
    font-weight: 400;
}

.arzfg-pill--extreme_fear {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.arzfg-pill--fear {
    color: #c2410c;
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.35);
}

.arzfg-pill--neutral {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.arzfg-pill--greed {
    color: #4d7c0f;
    background: rgba(132, 204, 22, 0.14);
    border-color: rgba(132, 204, 22, 0.35);
}

.arzfg-pill--extreme_greed {
    color: #15803d;
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
}

/* Footer */
.arzfg-footer {
    margin-top: 0;
    padding-top: 8px;
    border-top: none;
    font-size: 10px;
    font-weight: 400;
    color: var(--arzfg-muted);
    text-align: center;
    line-height: 1.45;
}

/* Dark theme */
[data-theme="dark"] .aspv2-tools__fear-greed,
[data-theme="dark"] .arzfg-widget {
    --arzfg-surface: rgba(255, 255, 255, 0.04);
    --arzfg-border: rgba(255, 255, 255, 0.12);
    --arzfg-text: #c4c8da;
    --arzfg-muted: #5a5f75;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .aspv2-tools__fear-greed,
    :root:not([data-theme="light"]) .arzfg-widget {
        --arzfg-surface: rgba(255, 255, 255, 0.04);
        --arzfg-border: rgba(255, 255, 255, 0.12);
        --arzfg-text: #c4c8da;
        --arzfg-muted: #5a5f75;
    }
}

[data-theme="dark"] .arzfg-gauge-hub {
    stroke: #1a1d27;
}

[data-theme="dark"] .arzfg-pill--extreme_fear {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .arzfg-pill--fear {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.12);
}

[data-theme="dark"] .arzfg-pill--neutral {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .arzfg-pill--greed {
    color: #bef264;
    background: rgba(132, 204, 22, 0.12);
}

[data-theme="dark"] .arzfg-pill--extreme_greed {
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

[data-theme="dark"] .arzfg-error {
    border-color: #5c1a1a;
    background: #2e0d0d;
    color: #fca5a5;
}

@media (max-width: 400px) {
    .arzfg-now-score {
        font-size: 27px;
        margin-top: 2px;
    }

    .arzfg-gauge-cmc {
        max-width: 170px;
    }
}
