.hidden { display: none; }

/* Tab navigation */
.tab-bar {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 1rem 1.5rem;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.tab-panel { padding: 2rem; max-width: 1200px; margin: 0 auto; }
.tab-panel.hidden { display: none; }

/* Stats bar */
.stats-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.stats-bar .stat { text-align: center; min-width: 120px; }
.stats-bar .stat-value { font-size: 2rem; font-weight: 700; color: var(--accent-gold); display: block; }
.stats-bar .stat-label { color: var(--text-secondary); font-size: 0.85rem; text-transform: uppercase; }

/* Positioning grid */
.positioning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.pos-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}
.pos-card-name { font-weight: 600; margin-bottom: 0.5rem; font-size: 1rem; }
.pos-card-stance { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.pos-card-conf { font-size: 0.8rem; color: var(--text-secondary); }
.pos-card-meta { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.pos-card-accuracy { font-size: 0.8rem; color: var(--text-secondary); }
.pos-card-clickable {
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s;
}
.pos-card-clickable:hover {
    border-color: var(--accent, #6c8ebf);
    transform: translateY(-2px);
}
.pos-card-clickable:focus {
    outline: 2px solid var(--accent, #6c8ebf);
    outline-offset: 2px;
}

/* Score badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-bullish { background: rgba(34,197,94,0.15); color: var(--accent-bullish); }
.badge-bearish { background: rgba(239,68,68,0.15); color: var(--accent-bearish); }
.badge-neutral { background: rgba(107,114,128,0.15); color: var(--accent-neutral); }
.badge-correct { background: rgba(34,197,94,0.15); color: var(--accent-bullish); }
.badge-wrong   { background: rgba(239,68,68,0.15); color: var(--accent-bearish); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--accent-gold); }
.badge-open    { background: rgba(99,102,241,0.15); color: #818cf8; }
.badge-unknown { background: rgba(107,114,128,0.15); color: var(--accent-neutral); }

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 0.75rem; }
.recent-item {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.recent-item-title { font-weight: 500; }
.recent-item-meta { color: var(--text-secondary); font-size: 0.85rem; white-space: nowrap; }

/* Filter bar */
.filter-bar {
    background: var(--bg-dark);
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    position: sticky;
    top: 53px;
    z-index: 90;
}
.chip-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0.3rem 0.8rem;
    transition: all 0.15s;
}
.chip:hover, .chip.active {
    background: rgba(245,158,11,0.15);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}
.filter-bar input[type=search], .filter-bar input[type=text] {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    min-width: 200px;
}
.filter-bar input:focus { outline: 1px solid var(--accent-gold); }

/* Prediction table */
.pred-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.pred-table th {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.75rem 1rem;
    text-align: left;
    user-select: none;
}
.pred-table th:hover { color: var(--text-primary); }
.pred-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    vertical-align: top;
}
.pred-row-clickable:hover td { background: rgba(255,255,255,0.04); cursor: pointer; }
.pred-row-clickable:focus td { outline: 2px solid var(--accent, #6c8ebf); outline-offset: -2px; }
.thesis-truncated { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 280px; }
.empty-state {
    color: var(--text-secondary);
    padding: 3rem;
    text-align: center;
}

/* Entity view */
.entity-search-wrap { margin-bottom: 1.5rem; }
.entity-search-wrap input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 0.6rem 1rem;
    width: 100%;
    max-width: 400px;
}
.entity-search-wrap input:focus { outline: 1px solid var(--accent-gold); }
.entity-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
}
.entity-card-stat { text-align: center; }
.entity-card-stat .stat-value { color: var(--accent-gold); display: block; font-size: 1.5rem; font-weight: 700; }
.entity-card-stat .stat-label { color: var(--text-secondary); font-size: 0.8rem; }
.entity-chart-wrap { margin-bottom: 1.5rem; }
.entity-timeline { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.timeline-item {
    background: var(--bg-card);
    border-radius: 8px;
    border-left: 3px solid var(--border);
    padding: 0.75rem 1rem;
}
.timeline-item.bullish { border-left-color: var(--accent-bullish); }
.timeline-item.bearish { border-left-color: var(--accent-bearish); }
.timeline-meta { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.25rem; }
.timeline-context { font-size: 0.9rem; font-style: italic; color: var(--text-secondary); }
.flips-section h3 { margin-bottom: 1rem; }

/* Analyzed videos grid */
.analyzed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}
.analyzed-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}
.analyzed-card:hover { border-color: var(--accent-gold); transform: translateY(-3px); }
.analyzed-thumb { width: 100%; height: 180px; object-fit: cover; background: #1a1a2e; }
.analyzed-body { padding: 1rem; }
.analyzed-title { font-weight: 600; margin-bottom: 0.5rem; font-size: 0.95rem; }
.analyzed-meta { color: var(--text-secondary); font-size: 0.82rem; margin-bottom: 0.75rem; }
.analyzed-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Transcript modal */
.modal {
    background: rgba(0,0,0,0.75);
    bottom: 0;
    left: 0;
    overflow-y: auto;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    margin: 2rem auto;
    max-width: 800px;
    padding: 2rem;
    position: relative;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
}
.modal-close:hover { color: var(--text-primary); }
#modal-title { margin-bottom: 1.5rem; }
.transcript-content { font-size: 0.9rem; line-height: 1.8; white-space: pre-wrap; }
mark.entity-bullish { background: rgba(34,197,94,0.2); border-radius: 3px; color: var(--accent-bullish); }
mark.entity-bearish { background: rgba(239,68,68,0.2); border-radius: 3px; color: var(--accent-bearish); }
mark.entity-neutral  { background: rgba(107,114,128,0.15); border-radius: 3px; }

/* Recent mentions empty state for Entity View */
.recent-mentions-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.recent-video-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
}
.recent-video-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.recent-video-date { color: var(--text-secondary); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.recent-video-title { font-weight: 500; }
.recent-entity-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.recent-entity-chip {
    align-items: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem 0.25rem 0.5rem;
    transition: border-color 0.15s, transform 0.15s;
}
.recent-entity-chip:hover { border-color: var(--accent, #6c8ebf); transform: translateY(-1px); }
.recent-entity-name { font-weight: 500; }
.recent-entity-conf { color: var(--text-secondary); font-size: 0.8rem; }

/* Clickable timeline items */
.timeline-item-clickable { cursor: pointer; transition: background 0.15s; }
.timeline-item-clickable:hover { background: rgba(255,255,255,0.04); }
.timeline-item-clickable:focus { outline: 2px solid var(--accent, #6c8ebf); outline-offset: -2px; }
.timeline-video-title { color: var(--text-secondary); font-size: 0.85rem; }

/* Mention modal */
.modal-meta {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.modal-entity-name { color: var(--text-primary); font-weight: 500; }
.modal-quote {
    background: rgba(255,255,255,0.03);
    border-left: 3px solid var(--accent, #6c8ebf);
    border-radius: 4px;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 1rem 0;
    padding: 1rem 1.25rem;
}
.modal-section-title {
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem;
}
.modal-predictions { display: flex; flex-direction: column; gap: 0.75rem; }
.modal-prediction {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.modal-prediction-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.modal-prediction-timeframe {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.modal-prediction-thesis { font-size: 0.9rem; line-height: 1.5; }
.modal-yt-link {
    background: var(--accent, #6c8ebf);
    border-radius: 8px;
    color: #fff;
    display: inline-block;
    font-weight: 500;
    margin-top: 1.25rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
}
.modal-yt-link:hover { opacity: 0.9; }

/* Video summary card */
.summary-meta { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.summary-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 1rem;
}
.summary-stat {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.25rem;
    min-width: 0;
}
.summary-stat .stat-value { font-size: 1.4rem; font-weight: 600; }
.summary-stat .stat-label { color: var(--text-secondary); font-size: 0.8rem; }
.summary-conviction, .summary-shifts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.summary-conviction-row, .summary-shift-row {
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
}
.summary-conviction-name, .summary-shift-name { font-weight: 500; }
.summary-conviction-type { color: var(--text-secondary); font-size: 0.8rem; }
.summary-conviction-conf { color: var(--text-secondary); font-size: 0.85rem; margin-left: auto; }
.summary-shift-arrow { color: var(--text-secondary); }
.summary-shift-prior { color: var(--text-secondary); font-size: 0.8rem; margin-left: auto; }
.summary-pred-entity { font-weight: 500; }
.summary-preds-details { margin-bottom: 1rem; }
.summary-preds-details summary {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.9rem;
    user-select: none;
}
.summary-preds-details summary:hover { background: rgba(255,255,255,0.07); }
.summary-preds-details[open] summary { margin-bottom: 0.75rem; }
.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.summary-actions .modal-yt-link { margin-top: 0; }
.summary-transcript-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 1rem;
}
.summary-transcript-btn:hover { background: rgba(255,255,255,0.05); }
