:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121c;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(22, 33, 62, 0.85);
  --bg-glass: rgba(13, 18, 30, 0.65);
  
  --border-subtle: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.4);
  --border-neon: #00f2fe;

  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #9d4edd;
  --accent-pink: #f72585;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-cyan: #38bdf8;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.18);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border-subtle);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Cyber Background Grid & Animated Orbs */
.cyber-bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #00f2fe 0%, #4facfe 50%, transparent 80%);
  top: -100px;
  right: -50px;
}

.orb-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #9d4edd 0%, #f72585 50%, transparent 80%);
  bottom: -150px;
  left: -100px;
  animation-duration: 22s;
  animation-delay: -5s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(0.95); }
}

.font-mono {
  font-family: var(--font-mono);
}

.text-cyan {
  color: var(--accent-cyan) !important;
}

.text-right {
  text-align: right;
}

/* App Shell Layout */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  position: relative;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00f2fe, #9d4edd);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.logo-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 2px solid var(--accent-cyan);
  animation: logoPulse 2.5s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes logoPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.brand-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.brand-text h1 span {
  background: linear-gradient(90deg, #00f2fe, #4facfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-tech {
  font-size: 0.65rem;
  padding: 2px 7px;
  background: rgba(157, 78, 221, 0.25);
  border: 1px solid rgba(157, 78, 221, 0.6);
  border-radius: 6px;
  color: #e0aaff;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.telemetry-bar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.telemetry-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.telemetry-chip:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.chip-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.chip-value {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

/* Main Grid Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

@media (max-width: 1180px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Cyber Cards */
.cyber-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.4;
}

.cyber-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-title i {
  color: var(--accent-cyan);
  font-size: 1.25rem;
}

.card-title h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.pulse-ring {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Ingestion Column */
.ingestion-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  background: rgba(8, 14, 26, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.15);
  transform: translateY(-2px);
}

.file-input-hidden {
  display: none;
}

.drop-icon-wrapper {
  position: relative;
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.25);
  overflow: hidden;
}

.main-drop-icon {
  font-size: 2rem;
  color: var(--accent-cyan);
}

.scan-beam {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(0, 242, 254, 0.6), transparent);
  animation: scanBeam 3s ease-in-out infinite;
}

@keyframes scanBeam {
  0% { top: -100%; }
  100% { top: 200%; }
}

.dropzone h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.btn-browse {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.file-specs-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Processing Options */
.processing-options {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.opt-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.pill-selectors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-pill {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.pipeline-pill:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.pipeline-pill.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Pipeline Execution Card */
.progress-percent {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.cyber-progress-container {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.cyber-progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #4facfe, #9d4edd);
  border-radius: 10px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.7);
}

/* 4 Stages Grid */
.pipeline-stages-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 850px) {
  .pipeline-stages-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stage-card {
  background: rgba(8, 14, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.3s ease;
  position: relative;
}

.stage-card.running {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
  animation: pulseCard 1.5s infinite alternate;
}

.stage-card.completed {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
}

@keyframes pulseCard {
  0% { box-shadow: 0 0 8px rgba(0, 242, 254, 0.2); }
  100% { box-shadow: 0 0 20px rgba(0, 242, 254, 0.45); }
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stage-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
}

.stage-icon i {
  font-size: 1.1rem;
  color: var(--accent-cyan);
}

.stage-card.completed .stage-icon i {
  color: var(--accent-green);
}

.stage-state-icon i {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stage-card.running .stage-state-icon i {
  color: var(--accent-cyan);
  animation: spin 1s linear infinite;
}

.stage-card.completed .stage-state-icon i {
  color: var(--accent-green);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stage-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.stage-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stage-metric {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Terminal Ingestion Log */
.terminal-container {
  background: #05070a;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0a0e17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-clear {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.terminal-clear:hover {
  color: var(--text-primary);
}

.terminal-logs {
  padding: 12px 14px;
  height: 140px;
  overflow-y: auto;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.terminal-logs::-webkit-scrollbar {
  width: 5px;
}

.terminal-logs::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.2);
  border-radius: 4px;
}

.log-entry {
  color: #cbd5e1;
  word-break: break-all;
}

.log-time {
  color: var(--text-muted);
  margin-right: 6px;
}

.log-system { color: #38bdf8; }
.log-info { color: #a78bfa; }
.log-ready { color: #34d399; }
.log-success { color: #4ade80; font-weight: 600; }
.log-stage { color: #38bdf8; }
.log-error { color: #f87171; font-weight: 600; }

/* Repository Column */
.repository-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.btn-refresh {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-refresh:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
}

.repo-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 14, 26, 0.6);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}

.search-box i {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-box input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.85rem;
  width: 100%;
  outline: none;
  font-family: inherit;
}

.count-badge {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* S3 Objects Table */
.files-table-wrapper {
  overflow-x: auto;
  max-height: 380px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
}

.files-table th {
  background: #090d16;
  color: var(--text-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.files-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.files-table tbody tr {
  transition: background 0.2s ease;
}

.files-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.05);
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 500;
}

.file-name-cell i {
  color: var(--accent-cyan);
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.btn-action {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.btn-action.download:hover {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
}

.btn-action.delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.empty-state {
  text-align: center;
  padding: 40px 10px;
}

.empty-state-content i {
  font-size: 2.2rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-content p {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 4px;
}

.empty-state-content span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Telemetry Summary Card */
.badge-status-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.telemetry-grid-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-box {
  background: rgba(8, 14, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #0d121c;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #080d17;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title i {
  color: var(--accent-cyan);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-section-title {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 14px;
  margin-bottom: 8px;
}

.detail-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}

.detail-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-table td:first-child {
  color: var(--text-muted);
  width: 35%;
  font-weight: 600;
}

.detail-table td:last-child {
  color: var(--text-primary);
  font-family: var(--font-mono);
}
