/* Claude Code Terminal Style — .cc-* class system */

/* ── Animations ─────────────────────────────────────── */

@keyframes cc-checkpop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes cc-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes cc-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0; }
}

/* ── Panel Container ────────────────────────────────── */

.cc-panel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* ── Timeline ───────────────────────────────────────── */

.cc-timeline {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 40px; /* space for statusbar */
}

/* ── Action Row ─────────────────────────────────────── */

.cc-action {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--text-primary, #e2e8f0);
}

/* ── Spinner ────────────────────────────────────────── */

.cc-spinner {
    width: 16px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.cc-action.running .cc-spinner {
    color: #a78bfa;
}

.cc-action.completed .cc-spinner {
    color: #22c55e;
    animation: cc-checkpop 0.2s ease;
}

.cc-action.failed .cc-spinner {
    color: #ef4444;
}

/* ── Label ──────────────────────────────────────────── */

.cc-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Duration ───────────────────────────────────────── */

.cc-duration {
    color: #64748b;
    font-size: 0.8em;
    flex-shrink: 0;
    animation: cc-fadein 0.3s ease;
}

/* ── Inline Progress (within action row) ───────────── */

.cc-inline-progress {
    color: #a78bfa;
    font-size: 0.75em;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    margin-left: auto;
}

/* ── Text Block ─────────────────────────────────────── */

.cc-text {
    padding: 8px 4px;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary, #e2e8f0);
}

.cc-text.cc-streaming::after {
    content: '\2588'; /* █ */
    color: #a78bfa;
    animation: cc-blink 0.6s step-end infinite;
}

/* ── Result Container ───────────────────────────────── */

.cc-result {
    margin: 12px 0;
}

.cc-result h3 {
    font-size: 0.9em;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

/* Stock table (inside .cc-result) */
.analyst-stock-table-wrap {
    overflow-x: auto;
    margin-bottom: 12px;
}

.cc-result table,
.analyst-stock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82em;
}

.cc-result table th,
.analyst-stock-table th {
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    white-space: nowrap;
}

.cc-result table td,
.analyst-stock-table td {
    padding: 5px 10px;
    color: var(--text-primary, #e2e8f0);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.cc-result table tr:hover td,
.analyst-stock-table tr:hover td {
    background: var(--bg-secondary, rgba(255, 255, 255, 0.04));
}

/* ── Markdown (inside .cc-result) ───────────────────── */

.cc-result .cc-markdown {
    color: var(--text-primary, #e2e8f0);
    line-height: 1.6;
    font-size: 0.9em;
}

.cc-result .cc-markdown h2 {
    font-size: 1.1em;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--text-primary, #e2e8f0);
}

.cc-result .cc-markdown h3 {
    font-size: 1em;
    margin-top: 12px;
    margin-bottom: 6px;
}

.cc-result .cc-markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 0.9em;
}

.cc-result .cc-markdown th,
.cc-result .cc-markdown td {
    padding: 5px 8px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    text-align: left;
}

.cc-result .cc-markdown th {
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    font-weight: 600;
}

.cc-result .cc-markdown ul,
.cc-result .cc-markdown ol {
    padding-left: 20px;
    margin: 6px 0;
}

.cc-result .cc-markdown p {
    margin: 6px 0;
}

.cc-result .cc-markdown strong {
    color: #f59e0b;
}

/* ── Statusbar ──────────────────────────────────────── */

.cc-statusbar {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.78em;
    color: var(--text-secondary, #94a3b8);
    background: rgba(255, 255, 255, 0.06);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cc-stage {
    flex-shrink: 0;
}

.cc-progress {
    letter-spacing: 0.5px;
}

.cc-elapsed {
    flex-shrink: 0;
}

/* ── Error ──────────────────────────────────────────── */

.cc-error {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #fca5a5;
    font-size: 0.9em;
}
