/* ingestion.css — Source control, asset grid, pipeline wizard, flow timeline, mosaic, janitor btn */

/* ── INGESTION — Source Control Panel ───────────────────────────── */
.ing-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.ing-panel-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -0.01em;
}
.ing-live-dot {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--primary);
}
.ing-live-dot::before {
  content: ''; display: block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* Source row */
.src-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: 8px;
  background: #0c0e17;
  transition: background var(--transition);
  gap: 12px;
}
.src-row + .src-row { margin-top: 8px; }
.src-row:hover { background: var(--surface); }
.src-row-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.src-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px;
  background: var(--surface-hi); display: flex; align-items: center;
  justify-content: center;
}
.src-icon .material-symbols-outlined { font-size: 20px; color: var(--primary); }
.src-name {
  font-family: var(--font-head); font-size: 13px; font-weight: 700;
  color: var(--text); letter-spacing: -0.01em;
}
.src-meta {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}
.src-row-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.src-throughput { text-align: right; }
.src-throughput .val {
  font-size: 12px; font-weight: 700; color: var(--primary);
  font-family: var(--font-head);
}
.src-throughput .lbl {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.08em;
}
.src-launch-btn {
  padding: 7px 14px; border-radius: 6px;
  border: 1px solid var(--primary); background: var(--primary-dim);
  color: var(--primary); font-family: var(--font-head);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
  display: flex; align-items: center; gap: 4px;
}
.src-launch-btn:hover { background: rgba(0,228,117,0.22); }
.src-launch-btn:disabled {
  opacity: 0.45; cursor: not-allowed;
  border-color: var(--border); color: var(--muted); background: transparent;
}

/* ── INGESTION — Asset Grid (glassmorphism cards) ──────────────── */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .asset-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.asset-card {
  position: relative; border-radius: 10px; overflow: hidden;
  aspect-ratio: 3 / 4; background: var(--surface-low);
  border: 1px solid var(--border);
  cursor: default;
  transition: transform var(--transition), border-color var(--transition);
}
.asset-card:hover { transform: translateY(-2px); border-color: rgba(0,228,117,0.3); }
.asset-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s;
}
.asset-card:hover img { transform: scale(1.04); }
/* Bottom gradient overlay */
.asset-card .asset-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12,14,23,0.9) 0%, rgba(12,14,23,0.3) 50%, transparent 100%);
}
/* Title glass chip at bottom */
.asset-card .asset-title-chip {
  position: absolute; bottom: 10px; left: 10px; right: 10px;
  padding: 8px 10px; border-radius: 6px;
  background: rgba(50,52,62,0.55); backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-head); font-size: 11px; font-weight: 600;
  color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Status badge top-right */
.asset-card .asset-badge {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.asset-badge.processing {
  background: rgba(0,228,117,0.18); border: 1px solid rgba(0,228,117,0.35);
  color: var(--primary);
}
.asset-badge.archived {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  color: #c5c6ca;
}
.asset-badge.failed {
  background: rgba(215,59,0,0.18); border: 1px solid rgba(215,59,0,0.35);
  color: #ffb5a0;
}
.asset-badge.new {
  background: rgba(0,228,117,0.9); color: #003918;
}

/* Ingestion 2-col layout on desktop: sources left, grid right */
@media (min-width: 1024px) {
  .ing-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
  }
}

/* ── INGESTION FLOW — Pipeline Wizard ───────────────────────────── */

/* Flow blocks */
.flow-block {
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 0;
}
.flow-block-red   { border-color: rgba(215,59,0,0.35);  background: rgba(215,59,0,0.04); }
.flow-block-green { border-color: rgba(0,228,117,0.2);  background: rgba(0,228,117,0.03); }

.flow-block-header {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
}
.flow-snum {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-hi); border: 2px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 11px; font-weight: 900;
  color: var(--primary);
}
.flow-snum.red   { border-color: #ff4444; color: #ff4444; }
.flow-snum.green { border-color: var(--primary); color: var(--primary); }

.flow-block-title { font-family: var(--font-head); font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.flow-block-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Source picker */
.source-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.source-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 22px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-hi);
  cursor: pointer; font-family: var(--font-head); font-size: 11px;
  font-weight: 700; color: var(--muted); letter-spacing: 0.05em;
  transition: all 0.2s; position: relative;
}
.source-card .material-symbols-outlined { font-size: 24px; }
.source-card:hover { border-color: rgba(0,228,117,0.4); color: var(--text); }
.source-card.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(0,228,117,0.09);
  box-shadow: 0 0 18px rgba(0,228,117,0.14);
}
.source-card .src-soon {
  position: absolute; top: 5px; right: 7px;
  font-size: 8px; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--muted); letter-spacing: 0.08em;
}
.source-launch-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.src-count-wrap {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); font-family: var(--font-head);
}
.src-count-input {
  width: 62px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-hi); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-head); font-size: 14px;
  font-weight: 800; text-align: center;
}
.btn-launch-main {
  display: flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 10px;
  border: 1px solid var(--primary); background: rgba(0,228,117,0.1);
  color: var(--primary); font-family: var(--font-head); font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em; cursor: pointer; transition: all 0.2s;
}
.btn-launch-main:hover { background: rgba(0,228,117,0.2); box-shadow: 0 0 22px rgba(0,228,117,0.2); }
.btn-launch-main:disabled { opacity: 0.4; cursor: not-allowed; }

/* Connector arrows */
.flow-arrow-down {
  display: flex; flex-direction: column; align-items: center; padding: 6px 0; gap: 0;
}
.flow-arrow-down .fad-line {
  width: 2px; height: 22px;
  background: linear-gradient(to bottom, var(--border), transparent);
}
.flow-arrow-down .fad-head {
  font-size: 10px; color: var(--muted); line-height: 1;
}
.flow-arrow-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-family: var(--font-head); margin: 4px 0;
}
.flow-split-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 600px) { .flow-split-row { grid-template-columns: 1fr; } }

.flow-split-arrows {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.flow-split-arrows .flow-arrow-down { flex: 1; }

/* Mosaic grid */
.mosaic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 5px;
  min-height: 72px;
}
.mosaic-cell {
  aspect-ratio: 1; border-radius: 7px; overflow: hidden;
  background: var(--surface-hi); position: relative;
  cursor: default; transition: transform 0.18s;
}
.mosaic-cell:hover { transform: scale(1.07); z-index: 2; }
.mosaic-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic-cell .mc-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.mc-red   { outline: 2px solid rgba(255,68,68,0.5); }
.mc-green { outline: 2px solid rgba(0,228,117,0.4); }
.mosaic-empty {
  grid-column: 1 / -1; text-align: center; padding: 28px 0;
  color: var(--muted); font-size: 12px; font-style: italic;
}

/* Enrichissement */
.enrich-steps { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.enrich-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  background: rgba(0,228,117,0.04); border: 1px solid rgba(0,228,117,0.1);
}
.enr-icon { font-size: 16px; color: var(--primary); }
.enr-label { font-size: 12px; color: var(--muted); flex: 1; font-family: var(--font-head); }
.enr-val   { font-family: var(--font-head); font-size: 14px; font-weight: 800; color: var(--primary); }
.btn-goto-approval {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  border: 1px solid var(--primary); background: rgba(0,228,117,0.08);
  color: var(--primary); font-family: var(--font-head);
  font-size: 13px; font-weight: 800; letter-spacing: 0.04em;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
}
.btn-goto-approval:hover { background: rgba(0,228,117,0.2); box-shadow: 0 0 22px rgba(0,228,117,0.2); }
.goto-badge {
  background: var(--primary); color: #003918;
  font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 20px;
  min-width: 22px; text-align: center;
}

/* Janitor */
.janitor-stat {
  text-align: center; padding: 20px 0 16px;
}
.janitor-big { font-size: 32px; font-weight: 900; color: #ff6b6b; font-family: var(--font-head); display: block; line-height: 1; }
.janitor-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.btn-janitor {
  margin-top: 14px; padding: 8px 18px; border-radius: 8px;
  border: 1px solid rgba(255,68,68,0.4); background: rgba(215,59,0,0.08);
  color: #ff8080; font-family: var(--font-head); font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.btn-janitor:hover { background: rgba(215,59,0,0.2); }

/* ── INGESTION TIMELINE — Orbital Command ───────────────────────── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes tl-glow-pulse {
  0%,100% { box-shadow: 0 0 8px 2px rgba(0,228,117,0.25); }
  50%      { box-shadow: 0 0 20px 5px rgba(0,228,117,0.55); }
}
@keyframes tl-step-in {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tl-container {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 16px 16px;
}

/* Central vertical flow-line */
.tl-flow-line {
  display: none;
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom,
    var(--primary) 0%,
    rgba(0,228,117,0.3) 60%,
    transparent 100%);
  z-index: 0;
}
@media (min-width: 720px) {
  .tl-flow-line { display: block; }
}

/* Step wrapper — odd = left, even = right */
.tl-step {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding-right: calc(50% + 36px);
  margin-bottom: 40px;
  z-index: 1;
  animation: tl-step-in 0.4s ease both;
}
.tl-step:nth-child(even) {
  justify-content: flex-start;
  padding-right: 0;
  padding-left: calc(50% + 36px);
}

/* Mobile: full-width single column */
@media (max-width: 719px) {
  .tl-step,
  .tl-step:nth-child(even) {
    justify-content: stretch;
    padding-right: 0;
    padding-left: 0;
  }
  .tl-node { display: none; }
}

/* Node dot on the central line */
.tl-node {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-hi);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  z-index: 2;
  transition: border-color 0.3s, color 0.3s;
}
.tl-node.ok {
  border-color: var(--primary);
  color: var(--primary);
  animation: tl-glow-pulse 2.8s ease-in-out infinite;
}

/* Glass card */
.glass-pane {
  width: 100%;
  max-width: 380px;
  background: rgba(17,19,28,0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.3s, transform 0.2s;
}
@media (max-width: 719px) { .glass-pane { max-width: 100%; } }
.glass-pane:hover { border-color: rgba(0,228,117,0.25); transform: translateY(-2px); }
.glass-pane.step-ok { border-color: rgba(0,228,117,0.18); }

.tl-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.tl-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(0,228,117,0.08);
  border: 1px solid rgba(0,228,117,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}
.tl-icon.ok { background: rgba(0,228,117,0.15); border-color: rgba(0,228,117,0.4); }
.tl-icon .material-symbols-outlined { font-size: 20px; color: var(--primary); }

.tl-card-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.tl-step-num {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.tl-stat {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
  margin-top: 4px;
}
.tl-ok-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 8px;
}
.tl-ok-badge.active {
  background: rgba(0,228,117,0.12);
  border: 1px solid rgba(0,228,117,0.3);
  color: var(--primary);
}
.tl-ok-badge.idle {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}

/* Pipeline Control Center (bottom of ingestion tab) */
.pipeline-control {
  margin-top: 40px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-low);
  padding: 20px 24px;
}
.pipeline-control-title {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pipeline-control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 640px) {
  .pipeline-control-grid { grid-template-columns: repeat(3, 1fr); }
}

