/* ── Lead-Gen Demo: Scoped Styles ────────────────────────────────────────
   All rules wrapped under .lg-demo — no global style leakage.
   Prefixed CSS vars (--lgd-*) avoid conflicts with website tokens.
────────────────────────────────────────────────────────────────────────── */

.lg-demo {
  --lgd-green:        #22c55e;
  --lgd-green-hover:  #16a34a;
  --lgd-green-tint:   #dcfce7;
  --lgd-green-border: rgba(34, 197, 94, 0.25);
  --lgd-text:         #111111;
  --lgd-text-sec:     #6b7280;
  --lgd-text-ter:     #9ca3af;
  --lgd-bg:           #fafafa;
  --lgd-bg-white:     #ffffff;
  --lgd-border:       #e5e7eb;
  --lgd-border-str:   #d1d5db;
  --lgd-r-sm:         0.375rem;
  --lgd-r-md:         0.5rem;
  --lgd-r-lg:         0.75rem;
  --lgd-r-xl:         1rem;
  --lgd-font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  font-family: var(--lgd-font);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--lgd-text);
  -webkit-font-smoothing: antialiased;
  /* no overflow:hidden here — shadow of .app-shell must be visible */
}

.lg-demo *, .lg-demo *::before, .lg-demo *::after { box-sizing: border-box; }
.lg-demo button { border: none; background: none; font-family: inherit; }
.lg-demo ul { list-style: none; margin: 0; padding: 0; }
.lg-demo p { margin: 0; }

/* ── App Shell ─────────────────────────────────────────────────────────── */
.lg-demo .app-shell {
  margin: 0;
  max-width: none;
  background: var(--lgd-bg-white);
  border: 1.5px solid #b8bfc9;
  border-radius: var(--lgd-r-xl);
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.13), 0 2px 8px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

/* ── Tab Bar ───────────────────────────────────────────────────────────── */
.lg-demo .lg-tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--lgd-border);
  background: var(--lgd-bg-white);
  flex-shrink: 0;
}
.lg-demo .lg-tab {
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--lgd-text-sec);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  background: none;
  font-family: var(--lgd-font);
  transition: color 0.15s;
  white-space: nowrap;
}
.lg-demo .lg-tab:hover { color: var(--lgd-text); }
.lg-demo .lg-tab.active {
  color: var(--lgd-text);
  font-weight: 600;
  border-bottom-color: var(--lgd-green);
}

/* ── View toggle ───────────────────────────────────────────────────────── */
.lg-demo .lg-view { display: none; flex: 1; min-height: 0; }
.lg-demo .lg-view.active { display: flex; }

/* ── App Body (used inside each view) ─────────────────────────────────── */
.lg-demo .app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ══ UC1 — Lead Qualifikation ════════════════════════════════════════════ */
.lg-demo .uc1-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative; /* anchor for the click cursor */
}

/* Simulated click cursor */
.lg-demo .lgd-cursor-ptr {
  position: absolute;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: top 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.85s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.35));
}
.lg-demo .lgd-cursor-ptr.visible { opacity: 1; }
@keyframes lgd-click-anim {
  0%   { transform: scale(1); }
  45%  { transform: scale(0.78); }
  100% { transform: scale(1); }
}
.lg-demo .lgd-cursor-ptr.clicking {
  animation: lgd-click-anim 0.2s ease forwards;
}

/* Inbox panel */
.lg-demo .inbox-panel {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--lgd-border);
  display: flex;
  flex-direction: column;
}
.lg-demo .panel-header {
  padding: 14px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lgd-text-ter);
  border-bottom: 1px solid var(--lgd-border);
  flex-shrink: 0;
}
.lg-demo .inbox-list {
  overflow-y: hidden;
  flex: 1;
}
.lg-demo .inbox-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--lgd-border);
  cursor: default;
  border-left: 2px solid transparent;
  transition: background 0.2s, border-left-color 0.2s;
}
.lg-demo .inbox-card.active {
  background: #f0fdf4;
  border-left-color: var(--lgd-green);
}
.lg-demo .inbox-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}
.lg-demo .inbox-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lgd-text);
}
.lg-demo .channel-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
}
.lg-demo .channel-badge.email    { background: #fef9c3; color: #92400e; }
.lg-demo .channel-badge.form     { background: #dbeafe; color: #1e40af; }
.lg-demo .channel-badge.linkedin { background: #ede9fe; color: #5b21b6; }
.lg-demo .inbox-company {
  font-size: 11.5px;
  color: var(--lgd-text-sec);
  margin-bottom: 4px;
}
.lg-demo .inbox-snippet {
  font-size: 11px;
  color: var(--lgd-text-ter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Analysis panel */
.lg-demo .analysis-panel {
  flex: 1;
  padding: 20px 24px;
  overflow-y: hidden;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.lg-demo .analysis-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.lg-demo .analysis-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--lgd-text);
}
.lg-demo .score-badge-large {
  font-size: 20px;
  font-weight: 800;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lg-demo .score-badge-large.a { background: #dcfce7; color: #15803d; }
.lg-demo .score-badge-large.b { background: #fef9c3; color: #92400e; }
.lg-demo .score-badge-large.c { background: #f3f4f6; color: #6b7280; }
.lg-demo .score-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.lg-demo .score-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--lgd-text-sec);
  width: 56px;
  flex-shrink: 0;
}
.lg-demo .score-bar-track {
  flex: 1;
  height: 6px;
  background: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}
.lg-demo .score-bar-fill {
  height: 100%;
  border-radius: 9999px;
}
.lg-demo .score-bar-fill.green  { background: #22c55e; }
.lg-demo .score-bar-fill.yellow { background: #eab308; }
.lg-demo .score-bar-fill.gray   { background: #9ca3af; }
.lg-demo .score-pct {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--lgd-text-sec);
  width: 32px;
  text-align: right;
}
.lg-demo .reasoning-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3px solid var(--lgd-green);
  border-radius: var(--lgd-r-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  min-height: 48px;
}
.lg-demo .reasoning-text {
  font-size: 12px;
  color: #166534;
  line-height: 1.55;
}
.lg-demo .details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 18px;
}
.lg-demo .detail-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--lgd-text-ter);
  margin-bottom: 2px;
}
.lg-demo .detail-value {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--lgd-text);
}
.lg-demo .action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lg-demo .action-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: default;
}
.lg-demo .action-pill.hubspot { background: #dcfce7; color: #15803d; }
.lg-demo .action-pill.slack   { background: #dbeafe; color: #1e40af; }
.lg-demo .report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #111;
  border: 1.5px solid #111;
  border-radius: var(--lgd-r-sm);
  padding: 7px 14px;
  cursor: default !important;
  pointer-events: none;
  opacity: 1;
  font-family: var(--lgd-font);
}
.lg-demo .report-btn:disabled {
  cursor: default !important;
  pointer-events: none;
  opacity: 1;
}

/* ══ UC2 — Lead Generierung ══════════════════════════════════════════════ */
.lg-demo .uc2-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}
.lg-demo .params-panel {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--lgd-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lg-demo .params-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lgd-text-ter);
  margin-bottom: 6px;
}
.lg-demo .chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.lg-demo .chip {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid var(--lgd-green-border);
  background: var(--lgd-green-tint);
  color: #15803d;
  cursor: default;
}
.lg-demo .research-btn {
  width: 100%;
  padding: 9px 14px;
  background: var(--lgd-green);
  color: white;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--lgd-r-md);
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--lgd-font);
  transition: opacity 0.2s, transform 0.1s;
}
.lg-demo .research-btn.loading {
  opacity: 0.6;
}
.lg-demo .search-status {
  font-size: 11.5px;
  color: var(--lgd-text-ter);
  min-height: 16px;
}
.lg-demo .results-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow-y: hidden;
}
.lg-demo .results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.lg-demo .results-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lgd-text-ter);
}
.lg-demo .export-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border: 1px solid var(--lgd-border-str);
  border-radius: var(--lgd-r-sm);
  background: var(--lgd-bg-white);
  color: var(--lgd-text-sec);
  cursor: default !important;
  pointer-events: none;
  opacity: 0.45;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--lgd-font);
}
.lg-demo .empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--lgd-text-ter);
  font-size: 13px;
}
.lg-demo .empty-icon { font-size: 28px; opacity: 0.4; }

/* Loading steps */
.lg-demo .loading-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.lg-demo .loading-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--lgd-text-sec);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s;
}
.lg-demo .loading-step.visible { opacity: 1; transform: translateY(0); }
.lg-demo .step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lgd-border-str);
  flex-shrink: 0;
  transition: background 0.2s;
}
.lg-demo .loading-step.done .step-dot    { background: var(--lgd-green); }
.lg-demo .loading-step.running .step-dot { background: var(--lgd-green); animation: lgd-pulse 1s ease-in-out infinite; }

/* Result cards */
.lg-demo .result-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.lg-demo .result-card {
  border: 1px solid var(--lgd-border);
  border-radius: var(--lgd-r-md);
  padding: 12px 14px;
  background: var(--lgd-bg-white);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.lg-demo .result-card.visible { opacity: 1; transform: translateY(0); }
.lg-demo .result-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.lg-demo .result-company { font-size: 13px; font-weight: 600; color: var(--lgd-text); }
.lg-demo .result-industry {
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 9999px;
  background: #f3f4f6;
  color: var(--lgd-text-sec);
}
.lg-demo .result-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.lg-demo .score-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}
.lg-demo .score-pill.a { background: #dcfce7; color: #15803d; }
.lg-demo .score-pill.b { background: #fef9c3; color: #92400e; }
.lg-demo .score-pill.c { background: #f3f4f6; color: #6b7280; }
.lg-demo .result-bar-track {
  flex: 1;
  height: 5px;
  background: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}
.lg-demo .result-bar-fill { height: 100%; border-radius: 9999px; }
.lg-demo .result-pct {
  font-size: 11px;
  font-weight: 700;
  color: var(--lgd-text-sec);
  width: 32px;
  text-align: right;
}
.lg-demo .result-recommendation {
  font-size: 11.5px;
  font-weight: 500;
}
.lg-demo .rec-green  { color: #16a34a; }
.lg-demo .rec-yellow { color: #ca8a04; }
.lg-demo .rec-blue   { color: #2563eb; }
.lg-demo .rec-gray   { color: #6b7280; }

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes lgd-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* Typewriter cursor */
.lg-demo .lgd-cursor {
  display: inline-block;
  width: 1.5px;
  height: 0.85em;
  background: currentColor;
  margin-left: 1px;
  vertical-align: middle;
  animation: lgd-blink 0.9s step-end infinite;
}
@keyframes lgd-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
