:root {
  --bg-main: #090a10;
  --bg-card: rgba(18, 20, 32, 0.75);
  --bg-card-hover: rgba(25, 28, 45, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent: #00f2fe;
  --accent-glow: rgba(0, 242, 254, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

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

/* Background Ambient Glows */
.glow-bg {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.15;
}
.glow-bg.top-left {
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, #6366f1, #00f2fe);
}
.glow-bg.bottom-right {
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  margin-bottom: 24px;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #00f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}
.logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge-pro {
  font-size: 0.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #34d399;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.status-dot.pulsing {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 10px;
}
.btn-ghost:hover {
  color: var(--text-main);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  transition: all 0.2s;
}
.metric-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.metric-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.metric-value {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.metric-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.text-success { color: var(--success); }
.text-accent { color: var(--accent); }
.text-purple { color: #c084fc; }

/* Workspace Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}
.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
.sub-header-count {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text-muted);
}

/* Campaigns List */
.campaigns-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.campaign-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}
.campaign-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}
.campaign-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.camp-info h3 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.camp-url {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
}
.camp-status {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.camp-status.running {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.camp-status.paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.camp-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.camp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #00f2fe);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.camp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.camp-stats-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.camp-actions {
  display: flex;
  gap: 8px;
}
.btn-action {
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Live Console */
.console-card {
  min-height: 480px;
}
.console-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.console-body {
  flex: 1;
  background: #06070a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  overflow-y: auto;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-line {
  word-break: break-all;
}
.log-line.sys { color: #64748b; }
.log-line.session-start { color: #38bdf8; }
.log-line.nav { color: #facc15; }
.log-line.engaged { color: #c084fc; }
.log-line.success { color: #4ade80; }
.log-line.error { color: #f87171; }
.log-line.hop { color: #ec4899; }

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: #10121d;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}
.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-row {
  display: flex;
  gap: 14px;
}
.form-group.half {
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}
.hidden {
  display: none !important;
}

/* Keywords and Source Badges */
.camp-keywords-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 12px 0;
  font-size: 0.76rem;
}
.kw-label {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 2px;
}
.kw-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-family: " JetBrains Mono\, monospace;
 white-space: nowrap;
}
.kw-chip.dynamic {
 background: rgba(0, 242, 254, 0.1);
 border-color: rgba(0, 242, 254, 0.3);
 color: #38bdf8;
}
.kw-more {
 color: var(--text-muted);
 font-size: 0.72rem;
 font-style: italic;
}
.source-badge {
 display: inline-flex;
 align-items: center;
 gap: 4px;
 padding: 3px 8px;
 border-radius: 6px;
 font-size: 0.75rem;
 font-weight: 600;
}
.source-badge.ai-badge {
 background: rgba(168, 85, 247, 0.15);
 border: 1px solid rgba(168, 85, 247, 0.35);
 color: #c084fc;
}
.source-badge.search-badge {
 background: rgba(59, 130, 246, 0.15);
 border: 1px solid rgba(59, 130, 246, 0.35);
 color: #60a5fa;
}
.source-badge.dev-badge {
 background: rgba(16, 185, 129, 0.15);
 border: 1px solid rgba(16, 185, 129, 0.35);
 color: #34d399;
}
.source-badge.video-badge {
 background: rgba(239, 68, 68, 0.15);
 border: 1px solid rgba(239, 68, 68, 0.35);
 color: #f87171;
}
.source-badge.direct-badge {
 background: rgba(148, 163, 184, 0.15);
 border: 1px solid rgba(148, 163, 184, 0.35);
 color: #cbd5e1;
}
.source-badge.multi-badge {
 background: rgba(234, 179, 8, 0.15);
 border: 1px solid rgba(234, 179, 8, 0.35);
 color: #facc15;
}

