/**
 * Enhanced overview widgets — circuit, returns, volume, RSI, pivot, beta, growth, financials.
 * Ported from ksealert_app/www/css/style.css (Stock Detail widgets block).
 */

/* ---- Circuit Limits ---- */
.so-circuit-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-circuit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.so-circuit-alert {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}
.so-circuit-alert.danger { background: #fee2e2; color: #991b1b; }
.so-circuit-bar {
    position: relative;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #10b981 60%, #f59e0b 80%, #ef4444 100%);
    margin-bottom: 6px;
}
.so-circuit-dot {
    position: absolute;
    top: -4px;
    width: 16px;
    height: 16px;
    background: #1f2937;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.so-circuit-marks {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 8px;
}
.so-circuit-lc, .so-circuit-uc { text-align: left; }
.so-circuit-uc { text-align: right; }
.so-circuit-curr { text-align: center; flex: 1; }
.so-circuit-mark-label {
    font-size: 9px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.so-circuit-mark-val { font-size: 12px; font-weight: 700; color: #374151; }
.so-circuit-curr-price { font-size: 13px; font-weight: 800; color: #111827; }
.so-circuit-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    border-top: 1px solid #f3f4f6;
    padding-top: 6px;
}
.so-circuit-meta-item { font-size: 10px; color: #6b7280; font-weight: 600; }

/* ---- Price Returns ---- */
.so-ret-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-ret-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.so-ret-label {
    flex: 0 0 32px;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-align: right;
}
.so-ret-bar-wrap {
    flex: 1;
    position: relative;
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: visible;
}
.so-ret-mid {
    position: absolute;
    left: 50%;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: #d1d5db;
    transform: translateX(-50%);
}
.so-ret-fill {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 999px;
}
.so-ret-fill.so-ret-pos { background: #10b981; }
.so-ret-fill.so-ret-neg { background: #ef4444; }
.so-ret-val {
    flex: 0 0 58px;
    font-size: 13px;
    font-weight: 700;
    text-align: right;
}
.so-ret-val.so-ret-pos { color: #047857; }
.so-ret-val.so-ret-neg { color: #b91c1c; }
.so-ret-val.so-ret-neutral { color: #6b7280; }

/* ---- Volume Comparison ---- */
.so-vol-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-vol-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 90px;
    padding-top: 8px;
}
.so-vol-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}
.so-vol-track {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    background: #f9fafb;
    border-radius: 4px 4px 0 0;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}
.so-vol-fill {
    width: 100%;
    border-radius: 3px 3px 0 0;
    transition: height 0.3s ease;
}
.so-vol-bar-today { background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%); }
.so-vol-bar-avg { background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%); }
.so-vol-val {
    font-size: 9px;
    font-weight: 700;
    color: #374151;
    margin-top: 3px;
    white-space: nowrap;
}
.so-vol-lbl {
    font-size: 8px;
    color: #9ca3af;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* ---- RSI Arc Gauge ---- */
.so-rsi-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-rsi-gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 0;
}
.so-rsi-gauge-wrap svg { display: block; }
.so-rsi-center { text-align: center; margin-top: -4px; }
.so-rsi-value {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}
.so-rsi-zone-badge {
    display: inline-block;
    margin-top: 4px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.so-rsi-zone-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    margin-top: 2px;
}
.so-rsi-zone-lbl {
    font-size: 9px;
    color: #9ca3af;
    font-weight: 600;
}

/* ---- Pivot Point Ladder ---- */
.so-pivot-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-pivot-ladder { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.so-pivot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    padding: 5px 8px;
}
.so-pivot-row.so-pivot-r { background: #fff1f2; border-left: 3px solid #f87171; }
.so-pivot-row.so-pivot-pp { background: #fefce8; border-left: 3px solid #f59e0b; }
.so-pivot-row.so-pivot-s { background: #f0fdf4; border-left: 3px solid #4ade80; }
.so-pivot-row.so-pivot-curr {
    background: #eff6ff;
    border: 1.5px solid #3b82f6;
    font-weight: 800;
}
.so-pivot-tag {
    flex: 0 0 28px;
    font-size: 10px;
    font-weight: 800;
    color: #6b7280;
}
.so-pivot-row.so-pivot-r .so-pivot-tag { color: #dc2626; }
.so-pivot-row.so-pivot-pp .so-pivot-tag { color: #d97706; }
.so-pivot-row.so-pivot-s .so-pivot-tag { color: #16a34a; }
.so-pivot-row.so-pivot-curr .so-pivot-tag { color: #2563eb; }
.so-pivot-val {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}
.so-pivot-dist {
    font-size: 10px;
    color: #9ca3af;
    font-weight: 600;
}
.so-pivot-curr-arrow {
    font-size: 11px;
    color: #2563eb;
    font-weight: 800;
}

/* ---- Beta Grid ---- */
.so-beta-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-beta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 8px;
}
.so-beta-tile {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 4px;
    text-align: center;
}
.so-beta-tile.high-vol { background: #fff7ed; border-color: #fed7aa; }
.so-beta-tile.low-vol  { background: #f0fdf4; border-color: #bbf7d0; }
.so-beta-period {
    font-size: 9px;
    color: #9ca3af;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
}
.so-beta-val {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
}
.so-beta-tile.high-vol .so-beta-val { color: #c2410c; }
.so-beta-tile.low-vol  .so-beta-val { color: #15803d; }
.so-beta-note {
    font-size: 8px;
    color: #9ca3af;
    margin-top: 2px;
}
.so-beta-legend {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: center;
}
.so-beta-legend-item { font-size: 10px; color: #6b7280; display: flex; align-items: center; gap: 3px; }
.so-beta-legend-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}

/* ---- Growth Metrics ---- */
.so-growth-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-growth-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.so-growth-label {
    flex: 0 0 120px;
    font-size: 10px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}
.so-growth-bar-wrap {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
}
.so-growth-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.so-growth-fill.so-growth-pos { background: linear-gradient(90deg, #10b981, #34d399); }
.so-growth-fill.so-growth-neg { background: linear-gradient(90deg, #ef4444, #f87171); }
.so-growth-val {
    flex: 0 0 52px;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}
.so-growth-val.so-growth-pos { color: #047857; }
.so-growth-val.so-growth-neg { color: #b91c1c; }

/* ---- Quick Financials / Fundamentals Snapshot ---- */
.so-fin-card { padding: 12px 14px; margin: 0 8px 12px 8px; }
.so-fin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.so-fin-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 10px;
}
.so-fin-label {
    font-size: 9px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 4px;
    line-height: 1.2;
}
.so-fin-val {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    line-height: 1;
}

/* ---- Ex-date chip variant ---- */
.so-chip-ex {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 800;
}
.so-chip-ex-inline {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-weight: 800;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 999px;
    display: inline-block;
}

/* ---- Sector sub-label in hero ---- */
.so-hero-sector {
    font-size: 9px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}
.so-hero-ex-chip {
    margin-bottom: 6px;
}
