/* ═══════════════════════════════════════════
   INDICATOR CARDS — Glassmorphism Purple
   ═══════════════════════════════════════════ */

.indicator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.indicator-group-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    padding: 14px 2px 4px;
    letter-spacing: 0.5px;
    font-family: var(--font-display);
}

.indicator-group-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.25), transparent);
}

.indicator-group-title:first-child {
    padding-top: 2px;
}

.indicator-item {
    background: rgba(255, 255, 255, 0.3);
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.25s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.indicator-item:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.08);
    transform: translateY(-1px);
}

.indicator-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.indicator-value {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
    color: var(--text-primary);
}

.etf-indicator .indicator-value {
    font-size: 15px;
}

.etf-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
    margin-top: 4px;
}

.etf-tag {
    font-size: 10px;
    color: var(--text-dim);
    flex-shrink: 0;
}

.etf-val {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.indicator-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
    font-family: var(--font-mono);
}

.card:has(> .indicator-grid.scrollable) {
    display: flex;
    flex-direction: column;
}

.indicator-grid.scrollable {
    flex: 1 1 auto;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.2) transparent;
}

.indicator-grid.scrollable::-webkit-scrollbar {
    width: 6px;
}

.indicator-grid.scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.indicator-grid.scrollable::-webkit-scrollbar-thumb {
    background-color: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
}

.indicator-grid.scrollable::-webkit-scrollbar-thumb:hover {
    background-color: rgba(139, 92, 246, 0.35);
}

/* ═══════════════════════════════════════════
   CHARTS
   ═══════════════════════════════════════════ */

.kline-toolbar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kline-tabs {
    display: inline-flex;
    gap: 4px;
    background: rgba(139, 92, 246, 0.05);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.kline-tab {
    appearance: none;
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    letter-spacing: 0.5px;
}

.kline-tab:hover {
    color: var(--text-primary);
}

.kline-tab.active {
    background: rgba(255, 255, 255, 0.6);
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.1);
}

.kline-wrap {
    position: relative;
}

.kline-legend {
    position: absolute;
    top: 8px;
    left: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    pointer-events: none;
}

.kline-legend-title {
    font-weight: 700;
    color: var(--text-primary);
}

.kline-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.kline-legend-item span:not(.kline-dot) {
    color: var(--text-primary);
    font-weight: 600;
}

.kline-dot {
    display: inline-block;
    width: 10px;
    height: 2px;
    border-radius: 1px;
}

#chart-container {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-bottom: none;
}

.macd-wrap {
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-top: 1px dashed rgba(139, 92, 246, 0.12);
    border-bottom: none;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

#macd-container {
    width: 100%;
}

.vol-wrap {
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-top: 1px dashed rgba(139, 92, 246, 0.12);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

.vol-wrap.no-bottom-radius {
    border-radius: 0;
    border-bottom: none;
}

#vol-container {
    width: 100%;
}

.exchange-flow-wrap {
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-top: 1px dashed rgba(139, 92, 246, 0.12);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

.exchange-flow-wrap.no-bottom-radius {
    border-radius: 0;
    border-bottom: none;
}

#exchange-flow-container {
    width: 100%;
}

.etf-wrap {
    position: relative;
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-top: 1px dashed rgba(139, 92, 246, 0.12);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
}

#etf-container {
    width: 100%;
}

.macd-legend {
    position: absolute;
    top: 14px;
    left: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    pointer-events: none;
}

.macd-legend-title {
    font-weight: 700;
    color: var(--text-primary);
}

.macd-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.macd-legend-item .green { color: var(--green); }
.macd-legend-item .red { color: var(--red); }

.macd-dot {
    display: inline-block;
    width: 10px;
    height: 2px;
    border-radius: 1px;
}

#equity-chart-container {
    height: 200px;
    margin: 0 -4px 8px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.equity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 10px;
}

.equity-range {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 500;
}

.equity-return {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

/* ═══════════════════════════════════════════
   NEWS PANEL
   ═══════════════════════════════════════════ */

.news-panel {
    padding: 12px 16px;
}

.news-score-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.news-sentiment {
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.news-sentiment.bullish { color: var(--green); }
.news-sentiment.bearish { color: var(--red); }
.news-sentiment.neutral { color: var(--text-secondary); }

.news-score {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-mono);
}

.news-score.positive { color: var(--green); }
.news-score.negative { color: var(--red); }
.news-score.zero { color: var(--text-secondary); }

.news-factors {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.news-factors-col {
    flex: 1;
    min-width: 0;
}

.news-factors-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.news-factors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-factors-list li {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-factors-list li a {
    color: var(--text-secondary);
    text-decoration: none;
}

.news-factors-list li a:hover {
    text-decoration: underline;
    color: var(--accent);
}

.news-reasoning {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 8px;
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════
   WHITE THEME OVERRIDES
   ═══════════════════════════════════════════ */

body.theme-white .indicator-group-title::after {
    background: linear-gradient(to right, var(--border), transparent);
}

body.theme-white .indicator-item {
    background: var(--bg-inset);
    border-color: var(--border);
}

body.theme-white .indicator-item:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-sm);
}

body.theme-white .indicator-grid.scrollable {
    scrollbar-color: rgba(99, 102, 241, 0.2) transparent;
}

body.theme-white .indicator-grid.scrollable::-webkit-scrollbar-thumb {
    background-color: rgba(99, 102, 241, 0.2);
}

body.theme-white .indicator-grid.scrollable::-webkit-scrollbar-thumb:hover {
    background-color: rgba(99, 102, 241, 0.35);
}

body.theme-white .kline-tabs {
    background: var(--bg-inset);
    border-color: var(--border);
}

body.theme-white .kline-tab.active {
    background: #FFFFFF;
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

body.theme-white #chart-container,
body.theme-white .macd-wrap,
body.theme-white .vol-wrap,
body.theme-white .exchange-flow-wrap,
body.theme-white .etf-wrap,
body.theme-white #equity-chart-container {
    border-color: var(--border);
}

body.theme-white .macd-wrap,
body.theme-white .vol-wrap,
body.theme-white .exchange-flow-wrap,
body.theme-white .etf-wrap {
    background: var(--bg-inset);
    border-top-color: var(--border);
}
