/**
 * EmilyAI Web UI — production additions on top of the shared emilyai.css
 * (which is carried over from the demo platform for pixel parity).
 *
 * © EmilyAI Ltd. All rights reserved.
 */

/* ---- Flash messages (post-redirect notices) --------------------------- */
.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent, #3b82f6);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-primary);
}
.flash-warn     { border-left-color: #f59e0b; }
.flash-critical { border-left-color: #ef4444; }

/* ---- "Awaiting published API" stub panel ------------------------------ */
.stub-panel {
    border-left: 3px solid var(--accent, #3b82f6);
    margin-bottom: 18px;
}
.stub-panel h3 { margin-top: 0; }
.stub-panel .muted { color: var(--text-muted); font-size: 12px; }
.stub-panel ul { margin: 10px 0; }

/* ---- Chat extras ------------------------------------------------------ */
.chat-mode-select {
    background: var(--bg-hover, rgba(127,127,127,0.12));
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    padding: 6px 8px;
}
.chat-citations {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

/* ---- Generic key/value + raw JSON rendering (reports, health) --------- */
.kv-grid {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 6px 16px;
    font-size: 13px;
}
.kv-grid .k { color: var(--text-muted); }
.kv-grid .v { color: var(--text-primary); word-break: break-word; }
.json-pre {
    background: var(--bg-hover, rgba(127,127,127,0.08));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 480px;
    overflow-y: auto;
}

/* ---- Long-text report body -------------------------------------------- */
.report-body {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
}
.report-body h1, .report-body h2, .report-body h3 { margin: 16px 0 8px; }
.report-body ul, .report-body ol { padding-left: 22px; margin: 8px 0; }
.report-body code {
    background: var(--bg-hover, rgba(127,127,127,0.12));
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
}

/* ---- Event stream live badge ------------------------------------------ */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 6px;
    animation: emily-pulse 1.6s ease-in-out infinite;
}
.live-dot.paused { background: #f59e0b; animation: none; }
@keyframes emily-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* ---- Report list rows -------------------------------------------------- */
.report-row { cursor: pointer; }
.report-row.selected { outline: 2px solid var(--accent, #3b82f6); outline-offset: -2px; }

/* ---- Detail page: raw alert JSON toggle -------------------------------- */
details.raw-json > summary {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

/* ---- Small screens ----------------------------------------------------- */
@media (max-width: 700px) {
    .kv-grid { grid-template-columns: 1fr; }
}
