/* DataEI — components.css
 * Panels, buttons, status dots, gauges, feed items, log lines, pills, bar indicators
 */

/* ===== Panel (LCARS-Inspired) ===== */
.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    box-shadow: var(--glow-inset);
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.panel:hover { border-color: var(--border-default); }
.panel__title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}
.panel__title-bar::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent-yellow);
}
.panel__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    padding-left: 0.5rem;
}
.panel__body { padding: 1.25rem; }
.panel__footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Status Dot ===== */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot--yellow { background: var(--accent-yellow); }
.status-dot--cyan { background: var(--accent-cyan); }
.status-dot--amber { background: var(--accent-amber); }
.status-dot--green { background: var(--accent-green); }
.status-dot--red { background: var(--accent-red); }
.status-dot--purple { background: var(--accent-purple); }
.status-dot--pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ===== Data Callout ===== */
.data-callout {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.data-callout__number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-yellow);
    line-height: 1;
}
.data-callout__label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Bar Indicator ===== */
.bar-indicator {
    width: 100%;
    height: 6px;
    background: var(--bg-surface-alt);
    border-radius: 3px;
    overflow: hidden;
}
.bar-indicator__fill {
    height: 100%;
    background: var(--accent-cyan);
    border-radius: 3px;
    transition: width 0.8s ease-out;
    width: 0;
}

/* ===== Pill Tag ===== */
.pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.pill-tag--yellow { color: var(--accent-yellow); border-color: var(--accent-yellow); }
.pill-tag--cyan { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.pill-tag--amber { color: var(--accent-amber); border-color: var(--accent-amber); }
.pill-tag--green { color: var(--accent-green); border-color: var(--accent-green); }
.pill-tag--purple { color: var(--accent-purple); border-color: var(--accent-purple); }

/* ===== CTA Button ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 200ms ease-out;
    cursor: pointer;
    border: 2px solid transparent;
}
.btn--primary {
    background: var(--accent-yellow);
    color: var(--bg-base);
}
.btn--primary:hover { box-shadow: 0 0 20px var(--accent-yellow-glow); }
.btn--secondary {
    background: transparent;
    color: var(--accent-yellow);
    border-color: var(--accent-yellow);
}
.btn--secondary:hover { background: var(--bg-surface-alt); }
.btn--ghost {
    background: transparent;
    color: var(--accent-yellow);
    border: none;
    padding: 0.5rem 1rem;
}
.btn--ghost:hover { color: var(--accent-cyan); }
.btn--brief {
    animation: brief-pulse 2.5s ease-in-out infinite;
}
@keyframes brief-pulse {
    0%, 100% { box-shadow: 0 0 0 var(--accent-yellow-glow); }
    50% { box-shadow: 0 0 15px var(--accent-yellow-glow); }
}

/* ===== Feed Item ===== */
.feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-subtle);
    animation: feed-slide 500ms ease-out;
}
.feed-item:last-child { border-bottom: none; }
.feed-item__time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}
.feed-item__text {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
}
@keyframes feed-slide {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Log Line (MCP / Agent) ===== */
.log-line {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    animation: log-fade 300ms ease-out;
    line-height: 1.5;
}
.log-line__time { color: var(--text-muted); }
.log-line__source--agent { color: var(--accent-purple); }
.log-line__source--mcp { color: var(--accent-cyan); }
.log-line__msg { color: var(--text-primary); }
@keyframes log-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Gauge (Leverage Index) ===== */
.gauge {
    position: relative;
    width: 220px;
    height: 120px;
    margin: 0 auto;
}
.gauge__svg { width: 100%; height: 100%; }
.gauge__track { fill: none; stroke: var(--bg-surface-alt); stroke-width: 12; }
.gauge__zone--red { stroke: var(--accent-red); }
.gauge__zone--amber { stroke: var(--accent-amber); }
.gauge__zone--green { stroke: var(--accent-green); }
.gauge__needle {
    stroke: var(--accent-yellow);
    stroke-width: 3;
    stroke-linecap: round;
    transform-origin: 110px 110px;
    transition: transform 1s ease-out;
}
.gauge__score {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-yellow);
    margin-top: 0.5rem;
}
.gauge__label {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ===== Command Input ===== */
.command-input {
    width: 100%;
    background: var(--bg-surface-alt);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 200ms;
    resize: vertical;
}
.command-input:focus { border-color: var(--accent-yellow); outline: none; }
.command-input::placeholder { color: var(--text-muted); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-overlay--open { display: flex; }
.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-active);
    border-radius: var(--radius);
    max-width: 560px;
    width: 100%;
    box-shadow: 0 0 40px var(--accent-yellow-glow);
}
.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}
.modal__header::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--accent-yellow);
}
.modal__title { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; padding-left: 0.5rem; }
.modal__close { font-size: 1.5rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal__body { padding: 1.5rem; }
.modal__footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border-subtle); }

/* ===== Status Bar (bottom) ===== */
.status-bar {
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    padding: 0.5rem 0;
    z-index: 100;
}
.status-bar__items {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.status-bar__item { display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 700px) {
    .status-bar__items { gap: 1rem; font-size: 0.7rem; }
}