/* ==========================================================================
   Audivo LeadGen Studio - Design System & Stylesheet
   Modern Glassmorphism · Cyber Dark Theme · Vibrant Accents
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Color Palette */
  --bg-primary: #080c14;
  --bg-secondary: #0e1526;
  --bg-tertiary: #162038;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(26, 36, 58, 0.85);
  --bg-input: rgba(11, 17, 33, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.35);
  --border-focus: #6366f1;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  /* Channel Branding */
  --channel-email: #3b82f6;
  --channel-whatsapp: #22c55e;
  --channel-linkedin: #0a66c2;
  --channel-instagram: #e1306c;

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-glow: #ffffff;

  /* Elevations & Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  --shadow-cyan-glow: 0 0 25px rgba(6, 182, 212, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-normal);
}

/* --------------------------------------------------------------------------
   App Layout & Header
   -------------------------------------------------------------------------- */
.app-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 32px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 16px;
  z-index: 100;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  font-weight: 700;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

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

/* --------------------------------------------------------------------------
   View Sections Transition
   -------------------------------------------------------------------------- */
.view-section {
  display: none;
  animation: fadeIn 0.35s ease-out forwards;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Form / Search View (Input View)
   -------------------------------------------------------------------------- */
.search-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.search-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.search-header {
  margin-bottom: 28px;
}

.search-header h2 {
  font-size: 28px;
  margin-bottom: 8px;
}

.search-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-label span.hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-dim);
}

.prompt-textarea {
  width: 100%;
  min-height: 110px;
  padding: 16px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  transition: all var(--transition-normal);
  line-height: 1.6;
}

.prompt-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), var(--shadow-glow);
  outline: none;
}

.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chip:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  transform: translateY(-1px);
}

.grid-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.select-wrapper {
  position: relative;
}

.select-control {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.select-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
}

.select-arrow {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-dim);
  font-size: 12px;
}

.btn-primary {
  width: 100%;
  padding: 16px 28px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  color: white;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Execution & Progress Monitor View
   -------------------------------------------------------------------------- */
.progress-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 44px;
  box-shadow: var(--shadow-lg);
}

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

.progress-header h3 {
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 10%;
  transition: width 0.4s ease;
}

.step-tracker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.step-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition-normal);
}

.step-item.active {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-glow);
}

.step-item.completed {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.step-num {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.step-item.active .step-num {
  background: var(--accent-primary);
  color: white;
}

.step-item.completed .step-num {
  background: var(--accent-emerald);
  color: white;
}

.step-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.step-item.active .step-title {
  color: var(--text-main);
}

.terminal-log {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  height: 220px;
  overflow-y: auto;
  color: #cbd5e1;
  line-height: 1.6;
}

.log-entry {
  margin-bottom: 4px;
}

.log-entry .log-time {
  color: var(--text-dim);
  margin-right: 8px;
}

/* --------------------------------------------------------------------------
   Results View
   -------------------------------------------------------------------------- */
.results-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.results-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-icon.email { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.stat-icon.whatsapp { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.stat-icon.linkedin { background: rgba(10, 102, 194, 0.15); color: #38bdf8; }
.stat-icon.instagram { background: rgba(225, 48, 108, 0.15); color: #f472b6; }

.stat-val {
  font-size: 24px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
}

.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.controls-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 28px;
}

.channel-tabs {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.search-input-box {
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  width: 220px;
}

.search-input-box:focus {
  border-color: var(--border-focus);
  outline: none;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Master Send All Button (Disabled) */
.btn-send-all {
  padding: 10px 22px;
  background: rgba(99, 102, 241, 0.3);
  border: 1px solid rgba(99, 102, 241, 0.5);
  border-radius: var(--radius-md);
  color: #c7d2fe;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: not-allowed;
  opacity: 0.65;
  position: relative;
}

.btn-send-all:hover::after {
  content: 'Sending logic to be configured';
  position: absolute;
  bottom: -34px;
  right: 0;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  z-index: 50;
}

/* --------------------------------------------------------------------------
   Lead Cards Grid
   -------------------------------------------------------------------------- */
.leads-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lead-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  position: relative;
}

.lead-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.biz-info h3 {
  font-size: 20px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.biz-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.badge-city { background: rgba(255, 255, 255, 0.08); color: var(--text-main); }
.badge-rating { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-ai-high { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-ai-med { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }

/* Individual Card Send Button (Disabled) */
.btn-card-send {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: not-allowed;
  opacity: 0.6;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.btn-card-send:hover::after {
  content: 'Send logic will be connected later';
  position: absolute;
  bottom: -32px;
  right: 0;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  z-index: 50;
}

.channels-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.channel-box {
  background: rgba(11, 17, 33, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-box.email { border-left: 3px solid var(--channel-email); }
.channel-box.whatsapp { border-left: 3px solid var(--channel-whatsapp); }
.channel-box.linkedin { border-left: 3px solid var(--channel-linkedin); }
.channel-box.instagram { border-left: 3px solid var(--channel-instagram); }

.box-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.box-content {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  word-break: break-word;
}

.box-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
}

.btn-copy {
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
}

.btn-copy:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .app-container { padding: 16px; gap: 20px; }
  .navbar { padding: 14px 18px; }
  .search-card { padding: 24px 20px; }
  .step-tracker { grid-template-columns: repeat(2, 1fr); }
  .controls-toolbar { flex-direction: column; align-items: stretch; }
  .channel-tabs { overflow-x: auto; }
}
