/* A-Terminal Dashboard Custom Styles */

:root {
    --at-positive: #22c55e;
    --at-negative: #ef4444;
    --at-neutral: #f59e0b;
    --at-heat-low: #6366f1;
    --at-heat-high: #ef4444;
    --at-bg-card: var(--pico-card-background-color);
}

/* Stats cards grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    text-align: center;
    padding: 1rem;
    border-radius: var(--pico-border-radius);
    background: var(--at-bg-card);
    border: 1px solid var(--pico-muted-border-color);
}
.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.stat-card .label {
    font-size: 0.85rem;
    color: var(--pico-muted-color);
    margin-top: 0.25rem;
}

/* Sentiment colors */
.positive { color: var(--at-positive); }
.negative { color: var(--at-negative); }
.neutral { color: var(--at-neutral); }

/* Heat bar */
.heat-bar {
    display: inline-block;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--at-heat-low), var(--at-heat-high));
    min-width: 4px;
    max-width: 120px;
    vertical-align: middle;
}

/* Phase badges */
.phase {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}
.phase-emerging { background: #dbeafe; color: #1e40af; }
.phase-growth { background: #dcfce7; color: #166534; }
.phase-mature { background: #f3f4f6; color: #374151; }
.phase-peak { background: #fef3c7; color: #92400e; }
.phase-decline { background: #fee2e2; color: #991b1b; }

/* Edge score badge */
.edge-score {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
}
.edge-high { background: #fee2e2; color: #991b1b; }
.edge-mid { background: #fef3c7; color: #92400e; }
.edge-low { background: #f3f4f6; color: #374151; }

/* Clickable table rows */
tr[onclick] { cursor: pointer; }
tr[onclick]:hover { background: var(--pico-muted-border-color); }

/* Consensus bar */
.consensus-bar {
    display: flex;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}
.consensus-bar .bullish {
    background: var(--at-positive);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.75rem; font-weight: 700;
}
.consensus-bar .bearish {
    background: var(--at-negative);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 0.75rem; font-weight: 700;
}
.consensus-bar .neutral-bar {
    background: var(--pico-muted-border-color);
    flex: 1;
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

/* Signal type badge */
.signal-type {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}
.signal-contrarian { background: #fef3c7; color: #92400e; }
.signal-high_edge { background: #dbeafe; color: #1e40af; }

/* Responsive table */
@media (max-width: 768px) {
    table { font-size: 0.85rem; }
    .hide-mobile { display: none; }
}

/* Nav active state */
nav a[aria-current="page"] {
    font-weight: 700;
    text-decoration: underline;
}

/* Source icon */
.source-icon { margin-right: 0.25rem; }

/* Docs page */
.stat-card .small-text {
    font-size: 0.8rem;
    color: var(--pico-muted-color);
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Smooth transitions for HTMX */
.htmx-settling { opacity: 0.8; }
.htmx-swapping { opacity: 0.5; transition: opacity 0.2s; }
