﻿/* ==========================================================================
   PhantomPatch â€” High-Performance Futuristic Glassmorphism UI
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-core: #07090e;
  --bg-secondary: #0c1017;
  --bg-tertiary: #131924;
  --bg-glass: rgba(15, 23, 42, 0.72);
  --bg-glass-hover: rgba(30, 41, 59, 0.85);
  
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-bright: rgba(0, 242, 254, 0.3);
  --border-focus: #00f2fe;

  --neon-cyan: #00f2fe;
  --neon-cyan-glow: rgba(0, 242, 254, 0.35);
  --neon-purple: #9d4edd;
  --neon-purple-glow: rgba(157, 78, 221, 0.4);
  --neon-blue: #3b82f6;
  --neon-emerald: #10b981;
  --neon-emerald-glow: rgba(16, 185, 129, 0.35);
  --neon-amber: #f59e0b;
  --neon-ruby: #ef4444;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.2);

  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-core);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Ambient Background Glows & Grid Pattern
   -------------------------------------------------------------------------- */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}
.glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: -150px;
  left: -100px;
}
.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #9d4edd 0%, transparent 70%);
  bottom: -100px;
  right: -50px;
  animation-delay: -4s;
}
.glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
  top: 40%;
  left: 45%;
  opacity: 0.18;
  animation-delay: -8s;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.25; }
  50% { transform: scale(1.1) translate(20px, 30px); opacity: 0.38; }
  100% { transform: scale(0.95) translate(-20px, -20px); opacity: 0.25; }
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Glassmorphism Reusable Card
   -------------------------------------------------------------------------- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* --------------------------------------------------------------------------
   Top Navigation Bar
   -------------------------------------------------------------------------- */
.navbar {
  margin: 12px 16px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #9d4edd 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.3rem;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

.pulse-icon {
  animation: pulseLogo 2s infinite ease-in-out;
}
@keyframes pulseLogo {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

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

.brand-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
  margin-top: 1px;
}

/* Nav Pipeline Breadcrumb */
.nav-pipeline-tracker {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.pipeline-step.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--neon-cyan);
  color: var(--text-primary);
  box-shadow: 0 0 14px var(--neon-cyan-glow);
}

.pipeline-step.completed {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--neon-emerald);
  color: var(--neon-emerald);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}
.pipeline-step.active .step-num {
  background: var(--neon-cyan);
  color: #000;
}
.pipeline-step.completed .step-num {
  background: var(--neon-emerald);
  color: #000;
}

.pipeline-line {
  width: 24px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: var(--transition-smooth);
}
.pipeline-line.active {
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan-glow);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.system-status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--neon-emerald);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-emerald);
  box-shadow: 0 0 8px var(--neon-emerald);
  animation: blink 2s infinite ease-in-out;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --------------------------------------------------------------------------
   Main App Grid Layout (Responsive)
   -------------------------------------------------------------------------- */
.app-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 16px;
  padding: 0 16px 16px 16px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   LEFT SIDEBAR: File Explorer & History
   -------------------------------------------------------------------------- */
.sidebar {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 100px);
  position: sticky;
  top: 16px;
}

.sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.side-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.side-tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.badge-count {
  background: var(--neon-purple);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
}

/* Drop Upload Zone */
.explorer-upload-zone {
  border: 2px dashed rgba(0, 242, 254, 0.3);
  background: rgba(0, 242, 254, 0.02);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.explorer-upload-zone:hover, .explorer-upload-zone.drag-over {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
}

.drop-icon {
  font-size: 1.8rem;
  color: var(--neon-cyan);
  margin-bottom: 6px;
}

.explorer-upload-zone p {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.explorer-upload-zone .subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.browse-buttons-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.mini-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}

.mini-btn:hover {
  background: rgba(0, 242, 254, 0.2);
  border-color: var(--neon-cyan);
}

.hidden-input {
  display: none;
}

/* Tree list */
.explorer-file-tree {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.tree-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.text-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}
.text-btn:hover {
  color: var(--neon-ruby);
}

.tree-list, .checkpoint-card-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: 200px;
}

.tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.tree-item:hover, .tree-item.active {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.25);
  color: #fff;
}

.tree-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state-item {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-dim);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Checkpoint Card */
.checkpoint-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition-fast);
}
.checkpoint-card:hover {
  border-color: var(--neon-purple);
  background: rgba(157, 78, 221, 0.08);
}
.chk-time {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--neon-purple);
  font-weight: 700;
}
.chk-snippet-preview {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}
.chk-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.chk-load-btn {
  background: var(--neon-purple);
  border: none;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.chk-load-btn:hover {
  background: #7b2cbf;
}

/* Telemetry Box */
.telemetry-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 6px;
}

.live-pill {
  background: rgba(16, 185, 129, 0.2);
  color: var(--neon-emerald);
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
}

.metric-val {
  font-family: var(--font-mono);
  font-weight: 600;
}
.text-cyan { color: var(--neon-cyan); }
.text-emerald { color: var(--neon-emerald); }
.text-amber { color: var(--neon-amber); }
.text-ruby { color: var(--neon-ruby); }
.text-white { color: #fff; }

/* --------------------------------------------------------------------------
   CENTER WORKSPACE
   -------------------------------------------------------------------------- */
.main-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Workspace Header & Mode Selector */
.workspace-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.source-mode-selector {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 30px;
}

.mode-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.mode-pill.active {
  background: linear-gradient(135deg, var(--neon-cyan), #3b82f6);
  color: #07090e;
  font-weight: 700;
  box-shadow: 0 0 12px var(--neon-cyan-glow);
}

.quick-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  background: rgba(157, 78, 221, 0.2);
  border-color: var(--neon-purple);
  color: #fff;
  transform: translateY(-1px);
}

/* Code Editor Container */
.editor-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-header {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mac-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }

.file-name-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #fff;
  font-weight: 600;
  margin-left: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.editor-controls {
  display: flex;
  gap: 8px;
}

.icon-tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition-fast);
}
.icon-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.code-editor-wrapper {
  display: flex;
  background: #090d14;
  min-height: 220px;
  max-height: 380px;
}

.line-numbers {
  padding: 14px 10px 14px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-dim);
  text-align: right;
  user-select: none;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 44px;
}

.code-editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #e2e8f0;
  resize: vertical;
  min-height: 220px;
  outline: none;
  white-space: pre;
  tab-size: 4;
}
.code-editor-textarea::selection {
  background: rgba(0, 242, 254, 0.25);
}

/* GitHub Hub Component */
.github-hub {
  padding: 18px 20px;
}

.github-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.hub-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hub-title i {
  font-size: 1.8rem;
}
.hub-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.hub-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.repo-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.repo-badge.valid {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--neon-emerald);
  color: var(--neon-emerald);
}
.repo-badge.invalid {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--neon-ruby);
  color: var(--neon-ruby);
}

.github-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.url-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.url-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.url-input-wrap input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  padding: 12px 120px 12px 38px;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.url-input-wrap input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px var(--neon-cyan-glow);
}

.verify-url-btn {
  position: absolute;
  right: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.verify-url-btn:hover {
  background: var(--neon-cyan);
  color: #000;
}

.git-target-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.target-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.target-chip strong {
  color: #fff;
}
.target-rule-chip {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.2);
  color: var(--neon-cyan);
}

/* --------------------------------------------------------------------------
   3 MASTER ACTION BUTTONS DOCK (VIBRANT & GLOWING)
   -------------------------------------------------------------------------- */
.action-dock {
  padding: 14px;
}

.dock-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.action-btn {
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.action-btn .btn-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: var(--transition-smooth);
}

.action-btn .btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.action-btn .btn-icon {
  font-size: 1.6rem;
}

.action-btn .btn-text {
  display: flex;
  flex-direction: column;
}

.action-btn .primary-text {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.action-btn .secondary-text {
  font-size: 0.72rem;
  opacity: 0.8;
  font-weight: 500;
}

/* Button 1: Validate Code (Cyan to Blue) */
.btn-validate {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.35);
}
.btn-validate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.55);
}

/* Button 2: Push to GitHub (Emerald to Teal) */
.btn-push {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
}
.btn-push:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.55);
}

/* Button 3: Validate -> Show -> Push (Purple to Pink) */
.btn-show-push {
  background: linear-gradient(135deg, #9333ea, #db2777);
  color: #fff;
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.35);
}
.btn-show-push:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(219, 39, 119, 0.55);
}

.action-btn:active {
  transform: translateY(1px);
}

/* --------------------------------------------------------------------------
   INTERACTIVE REVIEW & DIFF STAGE (DRAWER/POPUP)
   -------------------------------------------------------------------------- */
.stage-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.15);
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

.stage-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.stage-title i {
  font-size: 1.5rem;
}
.stage-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.stage-title p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-pill {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--neon-emerald);
  color: var(--neon-emerald);
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 20px;
}

.close-stage-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.close-stage-btn:hover {
  background: var(--neon-ruby);
  color: #fff;
}

/* Diagnostic Grid */
.diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.diag-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.diag-icon {
  font-size: 1.3rem;
}
.card-errors .diag-icon { color: var(--neon-ruby); }
.card-fixes .diag-icon { color: var(--neon-cyan); }
.card-security .diag-icon { color: var(--neon-emerald); }
.card-git .diag-icon { color: var(--neon-purple); }

.diag-info {
  display: flex;
  flex-direction: column;
}
.diag-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}
.diag-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Diff Viewer */
.diff-viewer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diff-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.diff-tags {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.diff-tag {
  padding: 2px 8px;
  border-radius: 4px;
}
.tag-removed {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.tag-added {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.diff-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.diff-pane {
  background: #090d14;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pane-header {
  padding: 8px 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 6px;
}
.diff-pane-orig .pane-header { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.diff-pane-fixed .pane-header { background: rgba(16, 185, 129, 0.1); color: #34d399; }

.diff-code {
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #cbd5e1;
  overflow-x: auto;
  max-height: 240px;
  white-space: pre-wrap;
}

.stage-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 6px;
}

.download-patch-btn {
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.15);
  transition: var(--transition-smooth);
}
.download-patch-btn:hover {
  background: var(--neon-cyan);
  color: #07090e;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 242, 254, 0.4);
}

.confirm-push-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: var(--transition-smooth);
}
.confirm-push-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

/* --------------------------------------------------------------------------
   RIGHT CONSOLE: Live Stream Drawer
   -------------------------------------------------------------------------- */
.console-drawer {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 100px);
  position: sticky;
  top: 16px;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 8px;
}

.console-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.console-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}
.terminal-btn:hover {
  color: #fff;
}

.live-blink {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: blink 1.2s infinite;
}

.terminal-body {
  flex: 1;
  background: #06090e;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 250px;
}

.term-line {
  word-break: break-all;
  white-space: pre-wrap;
}
.term-sys { color: var(--text-muted); }
.term-info { color: #38bdf8; }
.term-fix { color: #a78bfa; }
.term-git { color: #34d399; }
.term-warn { color: #fbbf24; }
.term-err { color: #f87171; }

.console-footer {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  border-top: 1px solid var(--border-glass);
  padding-top: 8px;
}

.git-status-summary {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   App Footer
   -------------------------------------------------------------------------- */
.app-footer {
  margin: 0 16px 16px 16px;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--neon-cyan);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideToast 0.3s ease-out;
  pointer-events: auto;
}
@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left-color: var(--neon-emerald); }
.toast.toast-error { border-left-color: var(--neon-ruby); }
.toast.toast-warn { border-left-color: var(--neon-amber); }

/* --------------------------------------------------------------------------
   Utility / Helpers
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* --------------------------------------------------------------------------
   RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .app-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .console-drawer {
    grid-column: 1 / -1;
    max-height: 250px;
    position: relative;
    top: 0;
  }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    max-height: none;
    position: relative;
    top: 0;
  }
  .dock-row {
    grid-template-columns: 1fr;
  }
  .diff-grid {
    grid-template-columns: 1fr;
  }
  .diagnostic-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-pipeline-tracker {
    display: none;
  }
}

