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

.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 60px;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

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

.nav-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-glow);
  border: 1px solid rgba(74, 222, 128, 0.2);
  padding: 3px 10px;
  border-radius: 100px;
}

/* ========== LAYOUT ========== */
.app-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: calc(100vh - 60px);
}

/* ========== SIDEBAR ========== */
.app-sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 32px 24px;
  overflow-y: auto;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.sidebar-sub {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
}

/* ========== ICP FORM ========== */
.icp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.form-field input,
.form-field select {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-field input::placeholder { color: rgba(138, 138, 154, 0.5); }

.form-field input:focus,
.form-field select:focus {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(255,255,255,0.04);
}

.form-field select option {
  background: #1a1a24;
  color: var(--fg);
}

.btn-search {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}

.btn-search:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.btn-search:active:not(:disabled) { transform: translateY(0); }
.btn-search:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-icon { font-size: 16px; }

/* ========== SEARCH HISTORY ========== */
.search-history { border-top: 1px solid var(--border); padding-top: 24px; }

.history-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
  text-align: left;
}

.history-item:hover { border-color: rgba(74, 222, 128, 0.25); }

.history-label {
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.history-count {
  font-size: 12px;
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 600;
  white-space: nowrap;
}

/* ========== MAIN CONTENT AREA ========== */
.app-main {
  padding: 40px 40px;
  overflow-y: auto;
}

/* ========== EMPTY STATE ========== */
.empty-state {
  max-width: 480px;
  margin: 80px auto 0;
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.empty-tips {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}

.empty-tips li {
  font-size: 14px;
  color: var(--fg-muted);
}

/* ========== LOADING STATE ========== */
.loading-state {
  max-width: 480px;
  margin: 80px auto 0;
  text-align: center;
}

.loading-animation {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.loading-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

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

.loading-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.loading-state p {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 28px;
}

.loading-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.loading-step {
  font-size: 14px;
  color: rgba(138, 138, 154, 0.4);
  transition: color 0.3s;
}

.loading-step.active { color: var(--fg); }

/* ========== RESULTS ========== */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.results-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.results-sub {
  font-size: 14px;
  color: var(--fg-muted);
}

.btn-export {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s;
}

.btn-export:hover { border-color: rgba(74, 222, 128, 0.35); color: var(--accent); }

.prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* ========== PROSPECT CARD ========== */
.prospect-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prospect-card:hover {
  border-color: rgba(74, 222, 128, 0.2);
  transform: translateY(-1px);
}

.prospect-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.prospect-company {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.prospect-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 14px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.prospect-link:hover { color: var(--accent); }

.score-badge {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}

.score-high {
  background: rgba(74, 222, 128, 0.12);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.score-mid {
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.score-low {
  background: rgba(148, 163, 184, 0.08);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}

.prospect-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 12px;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 2px 8px;
}

.prospect-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--fg-muted);
}

.contact-icon { font-size: 14px; }

.prospect-summary {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--fg-muted);
  font-size: 15px;
}

/* ========== ERROR STATE ========== */
.error-state {
  max-width: 400px;
  margin: 80px auto 0;
  text-align: center;
}

.error-state h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.error-state p {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

.btn-retry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-retry:hover { border-color: rgba(74, 222, 128, 0.35); }

/* ========== UTILITY ========== */
.hidden { display: none !important; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .app-main {
    padding: 24px 20px;
  }

  .prospect-grid {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
