/* ========================================================
   CITRINE V2 • DATA PIPELINE INGESTION & INTELLIGENCE STYLES
   Strictly < 500 lines
   ======================================================== */

.pipeline-view-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 10px;
  overflow: hidden;
  height: calc(100vh - 128px);
}

/* 1. TOP CONSOLIDATED TELEMETRY KPI BAR */
.pipeline-kpi-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg, #161617);
  border: 1px solid var(--card-border, #2a2a2d);
  border-radius: 8px;
  padding: 6px 12px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pipe-kpi-segment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border-subtle, #232326);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.pipe-kpi-segment:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.pipe-kpi-num {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 700;
}
.pipe-kpi-title {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-sec, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pipe-kpi-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue, #38bdf8);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
}
.pipe-kpi-action:hover {
  background: rgba(56, 189, 248, 0.12);
}

/* 2. 3-COLUMN WORKSPACE GRID */
.pipeline-columns-grid {
  display: grid;
  grid-template-columns: 290px 1fr 340px;
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Base Card Column */
.pipeline-col-card {
  background: var(--card-bg, #161617);
  border: 1px solid var(--card-border, #2a2a2d);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  min-height: 0;
}

.pipeline-col-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border, #2a2a2d);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.015);
  flex-shrink: 0;
}

.pipeline-col-title {
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pipeline-col-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.pipeline-col-scroll::-webkit-scrollbar {
  width: 4px;
}
.pipeline-col-scroll::-webkit-scrollbar-thumb {
  background: #2a2a2d;
  border-radius: 4px;
}

/* LEFT COLUMN: Ingestion Controls & Field Intel */
.pipe-section-box {
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border-subtle, #232326);
  border-radius: 7px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pipe-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue, #38bdf8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.pipe-field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pipe-field-label {
  font-size: 9.5px;
  color: var(--text-sec, #94a3b8);
  font-weight: 600;
}
.pipe-input,
.pipe-select,
.pipe-textarea {
  width: 100%;
  background: #121213;
  border: 1px solid #2a2a2d;
  border-radius: 5px;
  color: #ffffff;
  font-size: 11px;
  padding: 5px 8px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.pipe-input:focus,
.pipe-select:focus,
.pipe-textarea:focus {
  border-color: var(--accent-blue, #38bdf8);
}
.pipe-textarea {
  resize: vertical;
  min-height: 52px;
  line-height: 1.35;
}

/* Auto-Sync Ingest Bar */
.pipe-sync-row {
  display: flex;
  gap: 6px;
  width: 100%;
}
.btn-pipe-sync {
  flex: 1;
  height: 32px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}
.btn-pipe-sync:hover {
  background: rgba(56, 189, 248, 0.28);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}
.btn-pipe-sync-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(56, 189, 248, 0.2);
  transition: width 0.3s ease;
  z-index: 1;
}

/* Counters Grid (RAW, STALE, SCANNED, ALERTS) */
.pipe-counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.pipe-counter-card {
  background: #111112;
  border: 1px solid #262629;
  border-radius: 5px;
  padding: 5px 4px;
  text-align: center;
}
.pipe-counter-lbl {
  font-size: 8px;
  color: #64748b;
  font-weight: 700;
}
.pipe-counter-val {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

/* Chips & Field Intel Button */
.pipe-chips-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.pipe-chip-tag {
  background: #1e1e20;
  border: 1px solid #2e2e32;
  color: #94a3b8;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pipe-chip-tag:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
.btn-pipe-submit {
  width: 100%;
  padding: 6px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-pipe-submit:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

/* MIDDLE COLUMN: Live Social Media & OSINT Stream */
.pipe-stream-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Stream Loading Skeleton Animation */
.pipe-stream-loading-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.pipe-loading-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(22, 22, 24, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 7px;
  color: var(--accent-blue, #38bdf8);
}
.pipe-spinner-radar {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: pipeSpin 0.75s linear infinite;
  flex-shrink: 0;
}
@keyframes pipeSpin {
  to { transform: rotate(360deg); }
}
.pipe-loading-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.pipe-loading-text span {
  font-size: 11px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.2px;
}
.pipe-loading-text small {
  font-size: 9.5px;
  color: #94a3b8;
}
.pipe-skeleton-item {
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border-subtle, #232326);
  border-radius: 7px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  overflow: hidden;
}
.pipe-skeleton-row {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.pipe-skeleton-chips {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.pipe-skeleton-pill {
  height: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.pipe-skeleton-item::after,
.pipe-skeleton-row::after,
.pipe-skeleton-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.09), transparent);
  animation: pipeShimmer 1.5s infinite;
}
@keyframes pipeShimmer {
  100% { transform: translateX(100%); }
}

.pipe-stream-item {
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border-subtle, #232326);
  border-radius: 7px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.18s ease;
  cursor: pointer;
}
.pipe-stream-item:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: #1f1f22;
  transform: translateY(-1px);
}
.pipe-stream-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pipe-stream-author-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pipe-stream-idx {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.2;
}
.pipe-stream-author {
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pipe-stream-time {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  color: var(--text-sec, #94a3b8);
  white-space: nowrap;
  flex-shrink: 0;
}
.pipe-stream-text {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}
.pipe-stream-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* RIGHT COLUMN: Incident Dispatch Action Queue */
.pipe-dispatch-item {
  background: var(--card-elevated, #1e1e20);
  border: 1px solid var(--card-border-subtle, #232326);
  border-radius: 7px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}
.pipe-dispatch-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--text-sec, #94a3b8);
  font-size: 11.5px;
  line-height: 1.5;
  gap: 8px;
}
.pipe-dispatch-empty svg {
  color: #34d399;
  opacity: 0.7;
}

@media (max-width: 1200px) {
  .pipeline-columns-grid {
    grid-template-columns: 260px 1fr 300px;
  }
}

.pipe-field-hint { margin-left: 6px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--c-faint, #67676f); }
