/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --bg-color: #070913;
  --panel-bg: rgba(13, 17, 35, 0.65);
  --panel-border: rgba(0, 242, 254, 0.15);
  --panel-border-active: rgba(0, 242, 254, 0.4);
  
  /* Neon Palette */
  --neon-blue: #00f2fe;
  --neon-purple: #9d4edd;
  --neon-magenta: #ff007f;
  --neon-orange: #ff9f1c;
  --neon-green: #39ff14;
  --neon-red: #ff3333;
  
  /* Text colors */
  --text-primary: #f0f3ff;
  --text-secondary: #a0aec0;
  --text-muted: #4a5568;
  
  /* Fonts */
  --font-display: 'Orbitron', sans-serif;
  --font-sans: 'Space Grotesk', sans-serif;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --glass-blur: blur(12px);
  --cyber-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Canvas Background */
#synapse-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -3;
  pointer-events: auto;
}

/* Tech Grid Pattern overlay */
.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: center;
  z-index: -2;
  pointer-events: none;
}

/* CRT Scanlines and flicker simulation */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg, 
    rgba(255, 0, 0, 0.06), 
    rgba(0, 255, 0, 0.02), 
    rgba(0, 0, 255, 0.06)
  );
  background-size: 100% 4px, 3px 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.4;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-left: 1px solid var(--panel-border);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue);
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  z-index: 1;
  position: relative;
}

/* Header styling */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  box-shadow: var(--cyber-shadow);
  margin-bottom: 20px;
}

.logo-section {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.5), 0 0 20px rgba(0, 242, 254, 0.2);
  position: relative;
}

/* Glitch text effect */
.glitch-wrapper {
  position: relative;
}

.logo-text::before,
.logo-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.logo-text::before {
  left: 2px;
  text-shadow: -1px 0 var(--neon-magenta);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.logo-text::after {
  left: -2px;
  text-shadow: -1px 0 var(--neon-blue);
  clip: rect(85px, 450px, 140px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

.system-status {
  font-size: 0.75rem;
  font-family: var(--font-display);
  color: var(--neon-blue);
  letter-spacing: 1px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--neon-blue);
  box-shadow: 0 0 8px var(--neon-blue);
  animation: pulse-glow 1.5s infinite;
}

/* HUD Profile Details */
.hud-profile {
  display: flex;
  gap: 20px;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-family: var(--font-display);
  letter-spacing: 1px;
}

.hud-value {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 1rem;
}

.neon-orange {
  color: var(--neon-orange);
  text-shadow: 0 0 8px rgba(255, 159, 28, 0.4);
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.nav-tab {
  flex: 1;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 15px;
  cursor: pointer;
  border-radius: 8px;
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-normal);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.nav-tab .feather {
  width: 18px;
  height: 18px;
}

.nav-tab:hover {
  color: #fff;
  border-color: var(--panel-border-active);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
  transform: translateY(-2px);
}

.nav-tab.active {
  color: var(--neon-blue);
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
  background: rgba(0, 242, 254, 0.05);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--neon-blue);
  box-shadow: 0 0 10px var(--neon-blue);
}

.badge {
  background: var(--neon-magenta);
  color: white;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 0 8px var(--neon-magenta);
}

/* ==========================================================================
   CONTENT AREA PANES
   ========================================================================== */
.main-content {
  flex: 1;
  min-height: 480px;
  margin-bottom: 20px;
  position: relative;
}

.tab-pane {
  display: none;
  animation: tab-fade-in 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   TAB 1: MARKETPLACE LAYOUT
   ========================================================================== */
.market-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
}

/* Sidebar Filters */
.market-sidebar {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--cyber-shadow);
  display: flex;
  flex-direction: column;
  gap: 25px;
  height: fit-content;
}

.filter-group h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--neon-blue);
  margin-bottom: 12px;
  border-left: 3px solid var(--neon-blue);
  padding-left: 8px;
}

.filter-list {
  list-style: none;
}

.filter-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 8px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: 4px;
  border-left: 2px solid transparent;
}

.filter-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.02);
  padding-left: 14px;
}

.filter-btn.active {
  color: white;
  border-left-color: var(--neon-magenta);
  background: rgba(255, 0, 127, 0.05);
  font-weight: 600;
  padding-left: 14px;
}

/* Custom Checkbox CSS */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  user-select: none;
  transition: color var(--transition-fast);
}

.custom-checkbox:hover {
  color: white;
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 5px;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  transition: all var(--transition-fast);
}

.custom-checkbox:hover input ~ .checkmark {
  border-color: var(--text-secondary);
}

/* Color thematic checkmarks */
.chk-safe { --chk-color: var(--neon-green); }
.chk-experimental { --chk-color: var(--neon-orange); }
.chk-restricted { --chk-color: var(--neon-magenta); }

.custom-checkbox input:checked ~ .checkmark {
  background-color: rgba(0, 242, 254, 0.1);
  border-color: var(--chk-color, var(--neon-blue));
  box-shadow: 0 0 8px var(--chk-color, var(--neon-blue));
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.custom-checkbox .checkmark:after {
  left: 6px;
  top: 2px;
  width: 4px;
  height: 9px;
  border: solid var(--chk-color, var(--neon-blue));
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Search input */
.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: white;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Mini HUD */
.terminal-mini-hud {
  border: 1px solid rgba(0, 242, 254, 0.1);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-display);
  font-size: 0.65rem;
}

.mini-hud-title {
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.mini-hud-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-magenta));
  box-shadow: 0 0 8px var(--neon-blue);
}

.mini-hud-stats {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

/* Market items list */
.market-grid-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.market-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}

.market-grid-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.items-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

/* Cognitive Card Styling */
.cog-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.cog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--card-glow-color, var(--neon-blue)), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cog-card:hover {
  transform: translateY(-5px);
  border-color: var(--card-glow-color, var(--neon-blue));
  box-shadow: 0 5px 20px rgba(var(--card-glow-rgb, 0, 242, 254), 0.15);
}

.cog-card:hover::before {
  opacity: 1;
}

.card-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.card-badge {
  font-size: 0.65rem;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
}

.badge-safe {
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.05);
}

.badge-experimental {
  color: var(--neon-orange);
  background: rgba(255, 159, 28, 0.05);
}

.badge-restricted {
  color: var(--neon-magenta);
  background: rgba(255, 0, 127, 0.05);
}

.intensity-dot {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.intensity-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--card-glow-color, var(--neon-blue));
  box-shadow: 0 0 6px var(--card-glow-color, var(--neon-blue));
}

.card-body {
  padding: 0 20px 15px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-type-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 54px; /* fixed height for alignment */
}

.card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.75rem;
  margin-bottom: 15px;
}

.spec-item {
  display: flex;
  flex-direction: column;
}

.spec-lbl {
  color: var(--text-muted);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-val {
  font-weight: 600;
  color: var(--text-primary);
}

.card-footer {
  padding: 0 20px 20px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 15px;
}

.price-container {
  display: flex;
  flex-direction: column;
}

.price-lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.price-val {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
}

/* Button Custom Styles */
.cyber-btn {
  background: transparent;
  border: 1px solid var(--neon-blue);
  color: var(--neon-blue);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  outline: none;
}

.cyber-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.3);
  text-shadow: 0 0 5px white;
}

.cyber-btn.btn-primary {
  background: var(--neon-blue);
  color: var(--bg-color);
  border-color: var(--neon-blue);
}

.cyber-btn.btn-primary:hover {
  background: white;
  border-color: white;
  color: var(--bg-color);
  box-shadow: 0 0 15px white;
  text-shadow: none;
}

.cyber-btn.btn-primary:disabled {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: var(--text-secondary);
  cursor: not-allowed;
  box-shadow: none;
}

.cyber-btn.btn-secondary {
  border-color: var(--neon-magenta);
  color: var(--neon-magenta);
}

.cyber-btn.btn-secondary:hover {
  background: rgba(255, 0, 127, 0.08);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.3);
}

.cyber-btn.btn-block {
  width: 100%;
  padding: 12px 20px;
}

/* ==========================================================================
   TAB 2: EXTRACTION LAB
   ========================================================================== */
.lab-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  align-items: flex-start;
}

.lab-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lab-info h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.lab-info p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.lab-visualizer {
  height: 250px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pulse-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.15) 0%, transparent 70%);
  border: 2px solid var(--neon-blue);
  box-shadow: 0 0 20px var(--neon-blue);
  animation: pulsing 3s infinite ease-in-out;
  position: relative;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to bottom, transparent, var(--neon-blue), transparent);
  box-shadow: 0 0 10px var(--neon-blue);
  animation: scanning 4s infinite linear;
}

/* Form Styles */
.glass-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: var(--glass-blur);
  padding: 25px;
  box-shadow: var(--cyber-shadow);
}

.glass-card h3 {
  font-family: var(--font-display);
  color: white;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  flex: 1;
}

.form-group-row {
  display: flex;
  gap: 15px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: white;
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
  background: rgba(0, 0, 0, 0.6);
}

/* Custom Range Input */
.custom-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neon-blue);
  cursor: pointer;
  box-shadow: 0 0 8px var(--neon-blue);
  transition: transform 0.1s;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.quote-box {
  background: rgba(255, 159, 28, 0.04);
  border: 1px dashed rgba(255, 159, 28, 0.3);
  padding: 15px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.quote-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.quote-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--neon-orange);
  text-shadow: 0 0 10px rgba(255, 159, 28, 0.3);
}

/* Extraction progress overlay styles */
.extraction-process-overlay,
.sync-process-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 19, 0.95);
  backdrop-filter: blur(15px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}

.overlay-content {
  width: 100%;
  max-width: 600px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  text-align: center;
}

.glitch-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--neon-blue);
  text-shadow: 0 0 15px var(--neon-blue);
  animation: glitch-flicker 2s infinite;
}

.extractor-machine {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.core-brain {
  font-size: 4rem;
  z-index: 2;
  animation: brain-float 3s infinite ease-in-out;
}

.laser-beam {
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--neon-magenta), transparent);
  box-shadow: 0 0 12px var(--neon-magenta);
  z-index: 1;
  animation: laser-sweep 2s infinite linear;
}

.extraction-log,
.sync-console {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 15px;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--neon-green);
  text-align: left;
  overflow-y: auto;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
}

.progress-container {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-magenta));
  box-shadow: 0 0 10px var(--neon-blue);
  transition: width 0.1s linear;
}

.progress-pct,
.sync-percentage {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
}

/* ==========================================================================
   TAB 3: SYNC HUB (CART)
   ========================================================================== */
.sync-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 30px;
  align-items: flex-start;
}

.sync-queue-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 20px;
  color: white;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.queue-empty-msg {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

/* Queue Card */
.queue-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  padding: 15px 20px;
  border-radius: 8px;
  backdrop-filter: var(--glass-blur);
  transition: all var(--transition-fast);
}

.queue-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--panel-border-active);
}

.queue-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.queue-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.queue-price {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--neon-orange);
  font-size: 1.1rem;
}

.btn-remove-queue {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: 5px;
}

.btn-remove-queue:hover {
  color: var(--neon-red);
  filter: drop-shadow(0 0 5px var(--neon-red));
}

.btn-remove-queue svg {
  width: 18px;
  height: 18px;
}

/* Sync Summary panel specs */
.sync-detail-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sync-detail-row.total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
  margin-top: 15px;
  font-weight: 700;
  font-size: 1.15rem;
  color: white;
}

.warning-box {
  background: rgba(255, 51, 51, 0.05);
  border: 1px solid var(--neon-red);
  padding: 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--neon-red);
  font-size: 0.8rem;
  margin-bottom: 15px;
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.1);
}

.warning-box svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.hidden {
  display: none !important;
}

/* Sync Wave Visualizer */
.wave-visualizer-container {
  width: 100%;
  height: 150px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

#sync-audio-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.neon-pulse-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--neon-magenta);
  text-shadow: 0 0 12px var(--neon-magenta);
  animation: pulse-glow 2s infinite;
}

.warning-text {
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--neon-red);
  letter-spacing: 1px;
  animation: glitch-flicker 1.5s infinite;
}

/* ==========================================================================
   INTERACTIVE BOTTOM TERMINAL LOGS
   ========================================================================== */
.system-footer {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  backdrop-filter: var(--glass-blur);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--cyber-shadow);
  display: flex;
  flex-direction: column;
  height: 160px;
}

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

.terminal-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--neon-blue);
  font-weight: 700;
}

.terminal-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

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

.terminal-body {
  flex: 1;
  padding: 12px 16px;
  font-family: monospace;
  font-size: 0.8rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.log-line {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

.text-muted { color: var(--text-muted); }
.text-info { color: var(--neon-blue); }
.text-success { color: var(--neon-green); }
.text-warning { color: var(--neon-orange); }
.text-danger { color: var(--neon-red); }

/* ==========================================================================
   MODAL DIALOG
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 90%;
  max-width: 800px;
  position: relative;
  padding: 30px;
  animation: modal-slide-up 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  color: white;
}

.modal-header {
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 15px;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
}

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

.modal-body-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
}

/* Visual Panel */
.modal-visual-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.brain-scan-wrapper {
  height: 220px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#preview-wave-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(0, 242, 254, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 242, 254, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  z-index: 2;
  pointer-events: none;
}

.scan-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--text-secondary);
  z-index: 3;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Details Panel */
.modal-details-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.spec-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 10px 14px;
}

.spec-card .spec-lbl {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.spec-card .spec-val {
  font-size: 0.95rem;
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 3px;
  display: block;
}

.modal-desc-box h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--neon-blue);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.modal-desc-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-slide-up {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse-glow {
  0% { opacity: 0.3; }
  50% { opacity: 1; }
  100% { opacity: 0.3; }
}

@keyframes pulsing {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    border-color: rgba(0, 242, 254, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.7);
    border-color: var(--neon-blue);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
    border-color: rgba(0, 242, 254, 0.4);
  }
}

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

@keyframes brain-float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes laser-sweep {
  0% { left: 0%; }
  50% { left: 100%; }
  100% { left: 0%; }
}

@keyframes glitch-flicker {
  0% { opacity: 0.98; }
  10% { opacity: 1; }
  10.1% { opacity: 0.6; }
  11% { opacity: 0.6; }
  11.1% { opacity: 1; }
  45% { opacity: 1; }
  45.1% { opacity: 0.2; }
  46% { opacity: 0.2; }
  46.1% { opacity: 1; }
  90% { opacity: 1; }
  90.1% { opacity: 0.7; }
  91% { opacity: 0.7; }
  91.1% { opacity: 1; }
  100% { opacity: 0.98; }
}

@keyframes glitch-anim {
  0% { clip: rect(31px, 9999px, 94px, 0); }
  10% { clip: rect(112px, 9999px, 76px, 0); }
  20% { clip: rect(85px, 9999px, 5px, 0); }
  30% { clip: rect(27px, 9999px, 115px, 0); }
  40% { clip: rect(76px, 9999px, 20px, 0); }
  50% { clip: rect(98px, 9999px, 52px, 0); }
  60% { clip: rect(10px, 9999px, 105px, 0); }
  70% { clip: rect(115px, 9999px, 13px, 0); }
  80% { clip: rect(54px, 9999px, 85px, 0); }
  90% { clip: rect(30px, 9999px, 120px, 0); }
  100% { clip: rect(74px, 9999px, 45px, 0); }
}

@keyframes glitch-anim2 {
  0% { clip: rect(76px, 9999px, 116px, 0); }
  11% { clip: rect(24px, 9999px, 5px, 0); }
  22% { clip: rect(98px, 9999px, 54px, 0); }
  33% { clip: rect(12px, 9999px, 85px, 0); }
  44% { clip: rect(115px, 9999px, 10px, 0); }
  55% { clip: rect(43px, 9999px, 120px, 0); }
  66% { clip: rect(74px, 9999px, 30px, 0); }
  77% { clip: rect(54px, 9999px, 85px, 0); }
  88% { clip: rect(105px, 9999px, 74px, 0); }
  100% { clip: rect(98px, 9999px, 12px, 0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1024px) {
  .market-layout {
    grid-template-columns: 1fr;
  }
  .lab-container,
  .sync-container {
    grid-template-columns: 1fr;
  }
  .modal-body-layout {
    grid-template-columns: 1fr;
  }
  .hud-profile {
    display: none; /* Hide profile HUD on small tables/phones for space, or simplify */
  }
}

@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  .logo-section {
    align-items: center;
  }
  .nav-tabs {
    flex-wrap: wrap;
  }
  .nav-tab {
    padding: 10px;
    font-size: 0.85rem;
  }
  .system-footer {
    height: 120px;
  }
}
