/* ==========================================================================
   Hero Demo Card — Live Trading Signal & Chart Component
   Crypto Sphere Design System
   ========================================================================== */

:root {
    --demo-card-radius: var(--radius-lg, 16px);
    --demo-chart-aspect: 540 / 240;
    --demo-chart-pad-x: 18px;
    --demo-chart-pad-top: 16px;
    --demo-chart-pad-bottom: 8px;
}

.hero-demo-card,
.hero-visual-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--demo-card-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    display: flex;
    flex-direction: column;
}

/* Header Row */
.hero-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
    min-height: 54px;
    gap: 8px;
}

.hero-panel-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    min-width: 0;
}

.pair-symbol {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    height: 20px;
    line-height: 20px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.pair-type-tag {
    font-size: 0.64rem;
    font-weight: 600;
    padding: 1px 6px;
    height: 18px;
    line-height: 16px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    background: var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.demo-tag {
    background: rgba(249, 115, 22, 0.14);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.hero-panel-price-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hero-live-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    height: 24px;
    line-height: 24px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.market-stat-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 6px;
    height: 20px;
    line-height: 16px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    white-space: nowrap;
}

.badge-bull {
    background: var(--accent-green-subtle);
    color: var(--accent-green);
    border: 1px solid var(--accent-green-border);
}

.badge-bear {
    background: var(--accent-red-subtle);
    color: var(--accent-red);
    border: 1px solid var(--accent-red-border);
}

/* Stats Row */
.demo-stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 14px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
    min-height: 58px;
}

.demo-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    overflow: hidden;
}

.demo-stat-lbl {
    font-size: clamp(0.52rem, 1.3vw, 0.65rem);
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 14px;
    line-height: 14px;
    display: block;
}

.demo-stat-val {
    font-size: clamp(0.85rem, 2.2vw, 1.05rem);
    font-weight: 700;
    color: var(--text-primary);
    height: 22px;
    line-height: 22px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.demo-pos {
    color: var(--accent-green);
}

.demo-neg {
    color: var(--accent-red);
}

/* Signal Row */
.demo-signal-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    box-sizing: border-box;
    min-height: 42px;
}

.demo-side-badge {
    font-size: clamp(0.58rem, 1.4vw, 0.68rem);
    font-weight: 700;
    padding: 0 7px;
    height: 22px;
    line-height: 20px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    border-radius: 5px;
    font-family: var(--font-mono);
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.demo-side-badge.is-long {
    background: rgba(22, 199, 132, 0.14);
    color: var(--accent-green);
    border: 1px solid rgba(22, 199, 132, 0.4);
}

.demo-side-badge.is-short {
    background: rgba(239, 68, 68, 0.14);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.demo-tp-pill {
    font-size: clamp(0.54rem, 1.3vw, 0.64rem);
    font-weight: 600;
    padding: 0 7px;
    height: 22px;
    line-height: 20px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

.demo-tp-pill.tp-hit {
    background: rgba(22, 199, 132, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(22, 199, 132, 0.35);
}

.demo-tp-pill.tp-pending {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px dashed var(--border-color);
}

html[data-theme=light] .demo-tp-pill.tp-pending {
    background: rgba(19, 19, 19, 0.04);
}

/* Chart Canvas Section */
.demo-chart-wrap {
    padding: var(--demo-chart-pad-top) var(--demo-chart-pad-x) var(--demo-chart-pad-bottom);
    background: var(--bg-base-alt);
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.demo-chart-svg {
    display: block;
    width: 100%;
    aspect-ratio: var(--demo-chart-aspect);
    height: auto;
    min-height: 140px;
    max-height: 240px;
    pointer-events: none;
    user-select: none;
    box-sizing: border-box;
}

/* In-Chart Typography Overlay (Unskewed native font rendering) */
.demo-chart-labels-layer {
    position: absolute;
    top: var(--demo-chart-pad-top);
    left: var(--demo-chart-pad-x);
    right: var(--demo-chart-pad-x);
    bottom: var(--demo-chart-pad-bottom);
    pointer-events: none;
    user-select: none;
    overflow: hidden;
}

.demo-chart-label {
    position: absolute;
    left: 14px;
    transform: translateY(calc(-100% - 3px));
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 var(--bg-base-alt),
         1px -1px 0 var(--bg-base-alt),
        -1px  1px 0 var(--bg-base-alt),
         1px  1px 0 var(--bg-base-alt),
        -2px  0   0 var(--bg-base-alt),
         2px  0   0 var(--bg-base-alt),
         0   -2px 0 var(--bg-base-alt),
         0    2px 0 var(--bg-base-alt);
    user-select: none;
    pointer-events: none;
}

.demo-disclaimer {
    padding: 8px 16px 12px;
    font-size: clamp(0.56rem, 1.9vw, 0.64rem);
    line-height: 1.45;
    color: var(--text-muted);
    text-align: center;
    background: var(--bg-surface-secondary);
    border-top: 1px solid var(--border-subtle);
    box-sizing: border-box;
    min-height: 48px;
}

/* Mobile Adjustments for Demo Card */
@media (max-width: 680px) {
    :root {
        --demo-chart-pad-x: 12px;
        --demo-chart-pad-top: 10px;
        --demo-chart-pad-bottom: 4px;
    }
    .hero-panel-head {
        padding: 10px 14px;
        min-height: 48px;
    }
    .demo-stats-row {
        gap: 6px;
        padding: 8px 12px;
        min-height: 52px;
    }
    .demo-signal-row {
        gap: 5px;
        padding: 6px 12px;
        min-height: 38px;
    }
    .demo-disclaimer {
        padding: 7px 14px 11px;
    }
}
