/* v2.css — Card-native frontend styles */

/* ── Nav bar ─────────────────────────────────────────── */
.v2-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-1, #0a1628);
    border-bottom: 1px solid var(--panel-border, rgba(255,255,255,0.055));
}

.v2-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
    height: 52px;
}

.v2-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-strong, #f1ebdc);
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.v2-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent, #c8a96b);
    box-shadow: 0 0 8px var(--accent-glow, rgba(200,169,107,0.4));
}

.v2-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.v2-nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
}

.v2-nav-link:hover {
    color: var(--text-primary, #e2e8f0);
    background: rgba(255,255,255,0.04);
}

.v2-nav-link.is-active {
    color: var(--accent, #c8a96b);
    background: rgba(200,169,107,0.08);
}

.v2-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-nav-theme-btn {
    padding: 6px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: color 0.15s;
}

.v2-nav-theme-btn:hover {
    color: var(--text-primary);
}

/* ── Page layout ─────────────────────────────────────── */
.v2-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.v2-page-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

/* ── Section kicker (gold divider) ───────────────────── */
.v2-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(200,169,107,0.85);
    margin: 24px 0 12px;
}

.v2-kicker::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(200,169,107,0.2), transparent);
}

/* ── Card tiles ──────────────────────────────────────── */
.v2-card-tile {
    display: block;
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: var(--panel, rgba(255,255,255,0.025));
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.v2-card-tile:hover {
    border-color: rgba(200,169,107,0.35);
    background: rgba(200,169,107,0.04);
}

.v2-card-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.v2-card-tile-name {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-strong);
}

.v2-card-tile-type {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255,255,255,0.04);
}

.v2-card-tile-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Signal cards (in feeds) ─────────────────────────── */
.v2-signal-card {
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: var(--panel);
    transition: border-color 0.2s;
}

.v2-signal-card:hover {
    border-color: rgba(200,169,107,0.25);
}

.v2-signal-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.v2-signal-card-reasoning {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.v2-signal-card-citations {
    margin: 8px 0;
    padding-left: 12px;
    border-left: 2px solid rgba(200,169,107,0.2);
}

.v2-signal-card-citation {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding: 2px 0;
}

.v2-signal-card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── Badges ──────────────────────────────────────────── */
.v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.v2-badge-bullish {
    color: #f87171;
    border-color: rgba(248,113,113,0.3);
    background: rgba(248,113,113,0.08);
}

.v2-badge-bearish {
    color: #34d399;
    border-color: rgba(52,211,153,0.3);
    background: rgba(52,211,153,0.08);
}

.v2-badge-neutral {
    color: #60a5fa;
    border-color: rgba(96,165,250,0.3);
    background: rgba(96,165,250,0.08);
}

.v2-badge-type {
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Impact bar ──────────────────────────────────────── */
.v2-impact-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.v2-impact-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}

/* ── Confidence meter ────────────────────────────────── */
.v2-confidence {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.v2-confidence-bar {
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}

.v2-confidence-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

/* ── Card detail page ────────────────────────────────── */
.v2-detail-hero {
    padding: 24px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background:
        radial-gradient(ellipse at top right, rgba(200,169,107,0.06), transparent 50%),
        var(--panel);
    margin-bottom: 24px;
}

.v2-detail-metrics {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.v2-detail-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.v2-detail-metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.v2-detail-metric-value {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
}

/* ── Forward expectations ────────────────────────────── */
.v2-fwd-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.v2-fwd-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.v2-fwd-glyph {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-weight: 700;
}

/* ── Empty state ─────────────────────────────────────── */
.v2-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.v2-empty-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ── Loading spinner ─────────────────────────────────── */
.v2-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.v2-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(200,169,107,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: v2-spin 0.8s linear infinite;
}

@keyframes v2-spin {
    to { transform: rotate(360deg); }
}

/* ── Overview header ─────────────────────────────────── */
.v2-overview-header {
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    border-radius: 12px;
}

.v2-regime-line {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text-strong);
    margin-bottom: 12px;
}

.v2-regime-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    margin-right: 8px;
}

.v2-regime-risk-on {
    background: rgba(239,68,68,0.15);
    color: #f87171;
    border: 1px solid rgba(239,68,68,0.3);
}

.v2-regime-risk-off {
    background: rgba(16,185,129,0.15);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.3);
}

.v2-regime-mixed {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}

/* Heatmap — rows by card type, cells = individual cards */
.v2-heatmap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.v2-heatmap-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    align-items: center;
    gap: 8px;
}

.v2-heatmap-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-align: right;
}

.v2-heatmap-cells {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.v2-heatmap-cell {
    display: inline-block;
    min-width: 12px;
    height: 16px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.1s, outline 0.1s;
    outline: 1px solid transparent;
}

.v2-heatmap-cell:hover {
    transform: scale(1.15);
    outline-color: var(--accent);
    z-index: 2;
    position: relative;
}

.v2-heatmap-cell-bullish { background: rgba(239,68,68,0.75); }
.v2-heatmap-cell-bearish { background: rgba(16,185,129,0.75); }
.v2-heatmap-cell-neutral { background: rgba(59,130,246,0.55); }

/* Quote strip */
.v2-quote-strip {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px dashed var(--panel-border);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.v2-quote-strip-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-family: var(--font-sans);
}

/* ── Timeline page ───────────────────────────────────── */
.v2-timeline-row {
    display: grid;
    grid-template-columns: 180px 1fr 80px;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    border-radius: 8px;
    margin-bottom: 6px;
}

.v2-timeline-row:hover {
    border-color: rgba(200,169,107,0.4);
}

.v2-timeline-label {
    font-size: 0.85rem;
    color: var(--text-strong);
    font-family: var(--font-serif);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v2-timeline-track {
    position: relative;
    height: 18px;
    background: rgba(255,255,255,0.02);
    border-radius: 9px;
    overflow: visible;
}

.v2-timeline-dot {
    position: absolute;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translateX(-4px);
    cursor: pointer;
    transition: transform 0.1s;
}

.v2-timeline-dot:hover {
    transform: translateX(-4px) scale(1.6);
    z-index: 2;
}

.v2-timeline-dot-bullish { background: rgba(239,68,68,0.85); }
.v2-timeline-dot-bearish { background: rgba(16,185,129,0.85); }
.v2-timeline-dot-neutral { background: rgba(59,130,246,0.7); }

.v2-timeline-count {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

.v2-timeline-axis {
    display: grid;
    grid-template-columns: 180px 1fr 80px;
    gap: 12px;
    padding: 0 12px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.v2-timeline-axis-labels {
    display: flex;
    justify-content: space-between;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .v2-nav-inner { padding: 0 12px; gap: 12px; }
    .v2-nav-brand-text { display: none; }
    .v2-nav-link { padding: 6px 10px; font-size: 0.8rem; }
    .v2-page, .v2-page-narrow { padding: 16px; }
    .v2-detail-metrics { gap: 16px; }
}

/* ── Light theme overrides ───────────────────────────── */
[data-theme="light"] .v2-nav {
    background: #faf8f5;
    border-bottom-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .v2-card-tile,
[data-theme="light"] .v2-signal-card,
[data-theme="light"] .v2-detail-hero {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .v2-card-tile:hover {
    border-color: rgba(200,169,107,0.5);
    background: rgba(200,169,107,0.04);
}
