/* -------------------------------------------------------------
   CaptureWorks - Core Design System & Styles
   ------------------------------------------------------------- */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* Color Variables & Root Definitions */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #131825;
  --bg-tertiary: #1b2234;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.15);
  --accent-indigo-border: rgba(99, 102, 241, 0.3);
  
  --accent-violet: #8b5cf6;
  --accent-violet-glow: rgba(139, 92, 246, 0.25);
  
  --accent-teal: #06b6d4;
  --accent-teal-glow: rgba(6, 182, 212, 0.15);
  --accent-teal-border: rgba(6, 182, 212, 0.3);

  --accent-rose: #f43f5e;
  --accent-rose-glow: rgba(244, 63, 94, 0.15);
  
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-bg: rgba(19, 24, 37, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

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

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

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

/* Page Header & Layout */
.app-container {
  display: grid;
  grid-template-rows: 70px 1fr;
  height: 100vh;
  width: 100vw;
}

.top-navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-indigo-glow);
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  border-left: 1px solid var(--bg-tertiary);
  padding-left: 12px;
  margin-left: 12px;
  font-weight: 500;
}

/* Workflow Stage Tabs */
.workflow-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.tab-btn.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  box-shadow: 0 4px 12px var(--accent-indigo-glow);
}

.tab-btn .badge {
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Dashboard Workspace Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: 100%;
  overflow: hidden;
}

/* Sidebar Styling (Control Panel) */
.sidebar-panel {
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.section-icon {
  color: var(--accent-indigo);
  font-size: 1.2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Inputs & Form Styling */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.form-input, .form-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-indigo);
  outline: none;
  box-shadow: 0 0 10px var(--accent-indigo-glow);
}

/* Buttons */
.btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn:hover {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  box-shadow: 0 4px 15px var(--accent-indigo-glow);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  border: none;
}

.btn-primary:hover {
  opacity: 0.95;
  box-shadow: 0 4px 20px var(--accent-violet-glow);
}

.btn-teal {
  background: linear-gradient(135deg, var(--accent-teal), #0891b2);
  border: none;
}

.btn-teal:hover {
  box-shadow: 0 4px 15px var(--accent-teal-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-rose), #e11d48);
  border: none;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px var(--accent-rose-glow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: none !important;
}

/* Main Display Panels */
.display-workspace {
  background-color: var(--bg-primary);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
  height: 100%;
  position: relative;
}

/* Setup / Overview View */
.concept-blueprint-view {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  gap: 24px;
}

.welcome-banner {
  background: linear-gradient(135deg, var(--accent-indigo-glow), var(--accent-teal-glow));
  border: 1px solid var(--accent-indigo-border);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
}

.welcome-text h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
}

.welcome-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 600px;
}

/* Workflow Stage Blocks Diagram */
.workflow-stages-diagram {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stage-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: var(--transition-smooth);
}

.stage-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-indigo-border);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.stage-badge {
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-indigo);
  border: 1px solid var(--accent-indigo-border);
}

.stage-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.stage-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-grow: 1;
}

.stage-tech {
  background: var(--bg-tertiary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--accent-teal);
  font-family: var(--font-mono);
  border: 1px solid rgba(6, 182, 212, 0.1);
}

/* Mock Web Browser Component */
.mock-browser {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 450px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  position: relative;
}

.browser-header {
  background: var(--bg-tertiary);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--glass-border);
}

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

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #10b981; }

.browser-address-bar {
  flex-grow: 1;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.browser-address-bar i {
  color: var(--accent-teal);
}

.browser-viewport {
  flex-grow: 1;
  overflow-y: scroll;
  padding: 24px;
  background: #0f131d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: relative;
  scroll-behavior: smooth;
}

/* Simulated Facebook UI styling */
.mock-facebook-feed {
  width: 100%;
  max-width: 550px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.facebook-post {
  background: #181f30;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

/* Neon glow highlighter for scanning */
.facebook-post.scanning {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 20px var(--accent-indigo-glow);
  transform: scale(1.01);
}

.facebook-post.captured {
  border-color: var(--accent-teal);
  box-shadow: 0 0 15px var(--accent-teal-glow);
}

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

.post-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.post-meta-details {
  display: flex;
  flex-direction: column;
}

.post-author-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.post-group-name {
  font-size: 0.75rem;
  color: var(--accent-teal);
  font-weight: 500;
}

.post-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.post-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  word-wrap: break-word;
}

/* Mock Post Images */
.post-attachment {
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 12px;
  overflow: hidden;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.post-attachment::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0) 60%, rgba(0,0,0,0.6));
  z-index: 1;
}

.attachment-label {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  z-index: 2;
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

/* SVG Mock Graph drawings */
.mock-graph-svg {
  width: 100%;
  height: 100%;
  padding: 10px;
}

.post-footer-actions {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-footer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

/* Hologram Scanning Overlay */
.scanning-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, transparent, var(--accent-indigo), transparent);
  box-shadow: 0 0 10px var(--accent-indigo);
  animation: scanLoop 2.5s linear infinite;
  pointer-events: none;
  z-index: 10;
  display: none;
}

@keyframes scanLoop {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

/* Capturing overlay overlay cards */
.capture-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.capture-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.capture-flash-card {
  background: var(--bg-secondary);
  border: 1px solid var(--accent-indigo-border);
  padding: 24px;
  border-radius: var(--radius-lg);
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.capture-overlay.active .capture-flash-card {
  transform: scale(1);
}

.capture-card-glow {
  width: 50px;
  height: 50px;
  background: var(--accent-indigo-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-indigo);
  font-size: 1.5rem;
  margin-bottom: 16px;
  border: 1px solid var(--accent-indigo-border);
  animation: pulseIndigo 2s infinite;
}

@keyframes pulseIndigo {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Real-time terminal log viewer */
.terminal-console {
  background: #060911;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a7f3d0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 120px;
  overflow-y: auto;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
}

.terminal-line {
  line-height: 1.4;
}

.terminal-line .timestamp {
  color: var(--text-muted);
  margin-right: 8px;
}

.terminal-line.info { color: #38bdf8; }
.terminal-line.success { color: #34d399; }
.terminal-line.warning { color: #fbbf24; }

/* REDACTION LAB STYLING */
.redaction-lab-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  height: 100%;
  overflow: hidden;
}

.canvas-workspace {
  background: #0f131d;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: auto;
  padding: 20px;
}

.canvas-container {
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  background: #181f30;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}

#redaction-canvas {
  cursor: crosshair;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.canvas-dropzone {
  position: absolute;
  inset: 20px;
  border: 2px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  background: rgba(19, 24, 37, 0.4);
  backdrop-filter: blur(4px);
  transition: var(--transition-smooth);
}

.canvas-dropzone:hover {
  border-color: var(--accent-indigo);
  background: rgba(19, 24, 37, 0.7);
}

.dropzone-icon {
  font-size: 2.5rem;
  color: var(--accent-indigo);
  margin-bottom: 12px;
}

.canvas-toolbar {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  overflow-y: auto;
}

.toolbar-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 16px;
}

.toolbar-group:last-child {
  border-bottom: none;
}

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

.tool-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

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

.tool-btn.active {
  background: var(--accent-indigo-glow);
  color: var(--text-primary);
  border-color: var(--accent-indigo);
  box-shadow: 0 0 10px var(--accent-indigo-glow);
}

.brush-size-preview {
  height: 6px;
  background: var(--accent-indigo);
  border-radius: 3px;
  margin-top: 10px;
  transition: width 0.1s ease;
}

.json-metadata-editor {
  background: #060911;
  color: #34d399;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  width: 100%;
  height: 160px;
  resize: none;
  outline: none;
}

.json-metadata-editor:focus {
  border-color: var(--accent-teal);
}

/* CAPTURED QUEUE PANEL (Under Mock Browser) */
.queue-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
}

.queue-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  min-height: 90px;
}

.queue-item {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--bg-tertiary);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.queue-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent-indigo);
}

.queue-item-meta {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  background: rgba(0,0,0,0.8);
  font-size: 0.6rem;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: var(--text-secondary);
}

.queue-item-thumbnail {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  color: var(--accent-indigo);
  font-size: 1.2rem;
}

.queue-item-thumbnail span {
  font-size: 0.5rem;
  color: var(--text-muted);
}

/* Hide content helper */
.hidden-section {
  display: none !important;
}

/* Custom Responsive Styles */
@media(max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  .sidebar-panel {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    height: auto;
  }
}
