/* ═══════════════════════════════════════════════════════════════════════
   vision.css — KAAI CEO Panel — Vision Tab
   Designed by: Johnny Black | KAAI v1.0
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Layout ─────────────────────────────────────────────────────────── */
.vision-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: 1fr;
    gap: 16px;
    height: calc(100vh - 140px);
    overflow: hidden;
}

/* ── Left sidebar (controls) ─────────────────────────────────────────── */
.vision-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #333) transparent;
}

.vision-sidebar::-webkit-scrollbar { width: 6px; }
.vision-sidebar::-webkit-scrollbar-thumb { background: var(--border-color, #333); border-radius: 3px; }

/* ── Right — live view + tabs ────────────────────────────────────────── */
.vision-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    min-width: 0;
}

/* ── Camera view ─────────────────────────────────────────────────────── */
.vision-feed-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.vision-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color, #333);
    background: var(--bg-tertiary, #16213e);
    flex-shrink: 0;
}

.vision-feed-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

.vision-feed-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary, #888);
}

.vision-fps-badge {
    background: #1e3a1e;
    color: #4ade80;
    border: 1px solid #4ade80;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.vision-stream-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    position: relative;
    min-height: 0;
    overflow: hidden;
}

.vision-stream-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.vision-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #555;
    text-align: center;
    padding: 24px;
}

.vision-placeholder .vision-ph-icon {
    font-size: 48px;
    opacity: 0.4;
}

.vision-placeholder p {
    font-size: 13px;
    margin: 0;
}

/* ── Snapshot strip ──────────────────────────────────────────────────── */
.vision-snapshot-strip {
    height: 90px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 16px;
    border-top: 1px solid var(--border-color, #333);
    background: var(--bg-tertiary, #16213e);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #333) transparent;
    align-items: center;
}

.vision-snapshot-strip::-webkit-scrollbar { height: 4px; }
.vision-snapshot-strip::-webkit-scrollbar-thumb { background: var(--border-color, #333); border-radius: 2px; }

.vision-snap-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    border: 2px solid var(--border-color, #333);
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.15s;
}

.vision-snap-thumb:hover { border-color: #60a5fa; }

.vision-snap-empty {
    color: #555;
    font-size: 12px;
    font-style: italic;
}

/* ── Cards (sidebar sections) ────────────────────────────────────────── */
.vision-card {
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.vision-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-tertiary, #16213e);
    border-bottom: 1px solid var(--border-color, #333);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    cursor: pointer;
    user-select: none;
}

.vision-card-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Status pill ─────────────────────────────────────────────────────── */
.vision-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.vision-status-pill.stopped   { color: #f87171; border-color: #f87171; background: #1f0d0d; }
.vision-status-pill.running   { color: #4ade80; border-color: #4ade80; background: #0d1f0d; }
.vision-status-pill.starting  { color: #fbbf24; border-color: #fbbf24; background: #1f1700; }
.vision-status-pill.error     { color: #f87171; border-color: #f87171; background: #1f0d0d; }

/* ── Form elements ───────────────────────────────────────────────────── */
.vision-select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f23);
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
}

.vision-btn {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.vision-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.vision-btn-start  { background: #1e3a1e; color: #4ade80; border-color: #4ade80; }
.vision-btn-start:hover:not(:disabled)  { background: #2d5a2d; }
.vision-btn-stop   { background: #3a1e1e; color: #f87171; border-color: #f87171; }
.vision-btn-stop:hover:not(:disabled)   { background: #5a2d2d; }
.vision-btn-snap   { background: #1a2a3e; color: #60a5fa; border-color: #60a5fa; }
.vision-btn-snap:hover:not(:disabled)   { background: #253a55; }
.vision-btn-secondary { background: var(--bg-tertiary, #16213e); color: var(--text-secondary, #888); border-color: var(--border-color, #333); }
.vision-btn-secondary:hover:not(:disabled) { color: var(--text-primary, #e0e0e0); border-color: #60a5fa; }

/* ── Toggle switches ─────────────────────────────────────────────────── */
.vision-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary, #888);
}

.vision-toggle {
    position: relative;
    width: 38px;
    height: 20px;
    flex-shrink: 0;
}

.vision-toggle input { opacity: 0; width: 0; height: 0; }

.vision-toggle-track {
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: #333;
    transition: background 0.2s;
    cursor: pointer;
}

.vision-toggle input:checked + .vision-toggle-track { background: #4ade80; }

.vision-toggle-track::after {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.2s;
}

.vision-toggle input:checked + .vision-toggle-track::after { left: 20px; }

/* ── Slider ──────────────────────────────────────────────────────────── */
.vision-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.vision-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary, #888);
}

.vision-slider {
    width: 100%;
    accent-color: #60a5fa;
    cursor: pointer;
}

/* ── Snapshot label input ────────────────────────────────────────────── */
.vision-input {
    width: 100%;
    padding: 7px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #333);
    background: var(--bg-primary, #0f0f23);
    color: var(--text-primary, #e0e0e0);
    font-size: 13px;
    box-sizing: border-box;
}

.vision-input:focus {
    outline: none;
    border-color: #60a5fa;
}

/* ── Info grid ───────────────────────────────────────────────────────── */
.vision-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.vision-info-cell {
    background: var(--bg-primary, #0f0f23);
    border: 1px solid var(--border-color, #222);
    border-radius: 6px;
    padding: 8px 10px;
}

.vision-info-cell .label {
    font-size: 10px;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.vision-info-cell .value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
}

/* ── Toast / inline status ───────────────────────────────────────────── */
.vision-inline-status {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    text-align: center;
    background: var(--bg-tertiary, #16213e);
    color: var(--text-secondary, #888);
}

/* ── No CV2 banner ───────────────────────────────────────────────────── */
.vision-nocv2-banner {
    background: #2d1700;
    border: 1px solid #f59e0b;
    color: #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

