/* ============ APP SHELL ============ */
.app-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============ NAV ============ */
.app-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.nav-brand:hover { color: var(--accent); }

.nav-tag {
  font-size: 0.75rem;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.2rem 0.75rem;
  letter-spacing: 0.05em;
}

/* ============ LAYOUT ============ */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.app-sidebar {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar-section {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-heading {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.9rem;
}

.sidebar-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.sidebar-heading-row .sidebar-heading {
  margin-bottom: 0;
}

/* ============ RESEARCH FORM ============ */
.research-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.research-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.research-input::placeholder { color: var(--fg-muted); }
.research-input:focus { border-color: rgba(245, 158, 11, 0.5); }

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-icon { font-size: 1rem; }

.input-hint {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ============ PROSPECT LIST ============ */
.refresh-btn {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.refresh-btn:hover { color: var(--accent); }

.prospect-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.list-empty {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
}

.prospect-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.prospect-item:hover { border-color: rgba(245, 158, 11, 0.3); }
.prospect-item.active { border-color: rgba(245, 158, 11, 0.55); background: rgba(245, 158, 11, 0.05); }

.item-label {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.item-status {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  flex-shrink: 0;
}

.status-done { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-error { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-pending { background: var(--accent-glow); color: var(--accent); }

/* ============ MAIN PANEL ============ */
.app-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1rem;
}

.empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
}

.empty-state p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  max-width: 380px;
  line-height: 1.65;
}

/* ============ RESULT PANEL ============ */
.result-panel {
  padding: 2rem 2.5rem;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.result-company {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.result-url {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}
.result-url:hover { opacity: 1; }

.result-status {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.35rem;
}

.result-status.done { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
.result-status.error { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
.result-status.researching { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(245, 158, 11, 0.25); display: flex; align-items: center; gap: 0.4rem; }

/* ============ RESEARCHING STATE ============ */
@keyframes pulse-opacity {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-opacity 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.researching-steps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.step {
  font-size: 0.9rem;
  color: var(--fg-muted);
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.step.active {
  opacity: 1;
  color: var(--fg);
  border-color: rgba(245, 158, 11, 0.3);
}

/* ============ RESULT SECTIONS ============ */
.result-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.section-body {
  font-size: 0.95rem;
  color: var(--fg);
  line-height: 1.65;
}

.outreach-angle {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.5;
  padding: 1rem 1.25rem;
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 10px;
}

.result-grid {
  display: flex;
  gap: 2rem;
}

.result-meta-item {}

.meta-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}

.meta-val {
  font-size: 0.95rem;
  color: var(--fg);
}

/* ============ TAG LISTS ============ */
.tag-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.signal-tag {
  font-size: 0.875rem;
  color: var(--fg);
  padding: 0.5rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.5;
}

.pain-list li {
  font-size: 0.875rem;
  color: var(--fg-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.55;
}
.pain-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ============ PEOPLE ============ */
.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.person-item {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 130px;
}

.person-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
}

.person-title {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-top: 0.1rem;
}

/* ============ TECH CHIPS ============ */
.tech-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-chip {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--fg);
  padding: 0.25rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* ============ EMAIL SECTION ============ */
.email-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.email-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.copy-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.copy-btn:hover { opacity: 0.8; }

.email-preview {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--fg);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============ ERROR BOX ============ */
.error-box {
  font-size: 0.875rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  line-height: 1.55;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .app-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 260px; }
  .result-panel { padding: 1.25rem 1rem; }
  .result-header { flex-direction: column; align-items: flex-start; }
  .result-grid { flex-direction: column; gap: 1rem; }
}
