/* =============================================
   SIGNL — Dashboard Styles (app.css)
   ============================================= */

/* ── Market Regime Bar ── */
.regime-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.regime-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    z-index: 0;
}

.regime-bar.risk-on::before {
    background: linear-gradient(135deg, var(--green), transparent);
}

.regime-bar.risk-off::before {
    background: linear-gradient(135deg, var(--red), transparent);
}

.regime-bar.neutral::before {
    background: linear-gradient(135deg, var(--yellow), transparent);
}

.regime-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.regime-left,
.regime-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: relative;
    z-index: 1;
}

.regime-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.regime-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.88rem;
}

.regime-score-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.regime-score-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 600ms ease;
}

.regime-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.regime-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    border: 1px solid;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.regime-pts {
    font-weight: 700;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* ── Manual Analysis ── */
.manual-analysis-section {
    margin-bottom: var(--space-xl);
}

.manual-analysis-form {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.ticker-input {
    width: 120px;
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    outline: none;
    transition: border-color var(--transition-fast);
}

.ticker-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.ticker-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    text-transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

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

.analyze-result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    animation: slide-up 300ms ease;
}

.analyze-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.analyze-result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.analyze-result-item {
    text-align: center;
}

.analyze-result-item .label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.analyze-result-item .value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
}

.analyze-summary {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* ── Section Headers ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.section-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-header .count {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* ── Source Legend & Icons ── */
.source-legend {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: 6px 0 var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.source-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.src-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    flex-shrink: 0;
}

.badge-muted {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.signl-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* R:R badge */
.rr-badge {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* Sector tag */
.meta-sector {
    font-style: italic;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ── Signal Row Expanded ── */
.signal-expand {
    display: none;
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    animation: slide-down 200ms ease;
    overflow: visible;
}

.signal-expand.open {
    display: block;
}

.signal-expand p,
.signal-expand .signal-detail-section p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

.signal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
}

.signal-detail-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.signal-detail-section p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Entry note callout */
.signal-callout {
    background: rgba(108, 92, 231, 0.08);
    border: 1px solid rgba(108, 92, 231, 0.15);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.callout-icon {
    margin-right: 6px;
}

/* Metadata row */
.signal-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-md);
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.signal-meta-row strong {
    color: var(--text-secondary);
}

/* Timeframe scores */
.timeframe-scores {
    margin-bottom: var(--space-md);
}

.timeframe-scores h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.tf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.tf-label {
    width: 55px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
}

.tf-bar-wrap {
    width: 150px;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.tf-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 400ms ease;
}

.tf-score {
    width: 30px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: right;
}

.tf-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Fine print / disclaimer */
.signal-fine-print {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.6;
    line-height: 1.4;
}

.signal-trade-plan {
    grid-column: 1 / -1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-top: var(--space-sm);
}

.signal-trade-plan h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.signal-trade-plan p {
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ── Row Click Hint ── */
.signals-table tbody tr {
    cursor: pointer;
}

.signals-table tbody tr td:first-child {
    position: relative;
}

.row-expand-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.7rem;
    margin-right: 6px;
    transition: transform var(--transition-fast);
}

tr.expanded .row-expand-icon {
    transform: rotate(90deg);
    color: var(--accent);
}

/* ── Flow Radar ── */
.flow-section {
    margin-top: var(--space-2xl);
}

.flow-section .section-header {
    cursor: pointer;
    user-select: none;
}

.flow-toggle-icon {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    font-size: 0.8rem;
}

.flow-section.collapsed .flow-toggle-icon {
    transform: rotate(-90deg);
}

.flow-section.collapsed .flow-content {
    display: none;
}

.flow-net-positive {
    color: var(--green);
}

.flow-net-negative {
    color: var(--red);
}

/* ── Source Badges ── */
.source-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.source-discord {
    background: rgba(88, 101, 242, 0.15);
    color: #7289da;
    border: 1px solid rgba(88, 101, 242, 0.2);
}

.source-finviz {
    background: rgba(0, 210, 255, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.source-convergence {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.2);
}

/* ── Upgrade Banner ── */
.upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--accent-glow);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
}

.upgrade-banner p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Dashboard Grid ── */
.dashboard-signals {
    margin-bottom: var(--space-lg);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .regime-bar {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: flex-start;
    }

    .signal-detail-grid {
        grid-template-columns: 1fr;
    }

    .upgrade-banner {
        flex-direction: column;
        text-align: center;
    }
}