/* ========================================
   STRIKELEAD APP STYLES
   Design tokens from landing page
   ======================================== */

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

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a26;
  --surface-3: #222233;
  --border: #2a2a3a;
  --accent: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.15);
  --accent-soft: #fb923c;
  --accent-hover: #ea6c10;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --warning: #eab308;
  --warning-bg: rgba(234, 179, 8, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #55556a;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-soft);
}

/* ========================================
   GRAIN OVERLAY
   ======================================== */
.grain {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
}

/* ========================================
   NAV BAR
   ======================================== */
.app-nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--text);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

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

.nav-user-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.nav-btn {
  font-size: 0.8rem;
  padding: 6px 16px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

/* ========================================
   MAIN LAYOUT
   ======================================== */
.app-main {
  padding-top: 80px;
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: 60px;
}

/* ========================================
   AUTH FORMS
   ======================================== */
.auth-container {
  max-width: 400px;
  margin: 80px auto 0;
}

.auth-container h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.auth-container .auth-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-family: 'Space Grotesk', sans-serif;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-dim);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  background: var(--surface);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  font-size: 0.85rem;
}
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover {
  background: var(--danger-bg);
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.2s;
}

.card:hover {
  border-color: var(--surface-3);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
}

/* ========================================
   STATS
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================
   PAGE HEADERS
   ======================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.page-header p {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ========================================
   SEARCH LIST
   ======================================== */
.search-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.search-item:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.search-item-left {
  flex: 1;
}

.search-item-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.search-item-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.search-item-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 100px;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-processing {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.badge-count {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
}

/* ========================================
   PROSPECT CARDS
   ======================================== */
.prospects-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prospect-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: border-color 0.2s;
}

.prospect-card:hover {
  border-color: var(--surface-3);
}

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

.prospect-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.prospect-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prospect-company {
  color: var(--accent-soft);
}

.prospect-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.prospect-meta a,
.prospect-meta span {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.prospect-meta a:hover {
  color: var(--accent);
}

.prospect-reason {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}

/* Email preview */
.email-preview {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.email-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.email-subject {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.email-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.6;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.email-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ========================================
   LOADING STATES
   ======================================== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-overlay .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
  margin-bottom: 16px;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.loading-subtext {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* ========================================
   SEARCH FORM
   ======================================== */
.search-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.search-form-container h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.search-form-container .form-sub {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.9rem;
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.3);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ========================================
   COPY BUTTON
   ======================================== */
.copy-feedback {
  color: var(--success);
  font-size: 0.8rem;
  transition: opacity 0.2s;
}

/* ========================================
   SECTION DIVIDER
   ======================================== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.section-divider span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ========================================
   ALERT
   ======================================== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .app-nav {
    padding: 14px 20px;
  }

  .app-main {
    padding-top: 70px;
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: column;
    gap: 16px;
  }

  .search-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .search-item-right {
    width: 100%;
    justify-content: flex-start;
  }

  .prospect-header {
    flex-direction: column;
    gap: 8px;
  }

  .email-preview-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .email-actions {
    flex-wrap: wrap;
  }

  .auth-container {
    margin-top: 40px;
    padding: 0 4px;
  }
}

@media (max-width: 480px) {
  .app-nav .logo {
    font-size: 1.1rem;
  }

  .nav-user-name {
    display: none;
  }

  .stat-card .stat-value {
    font-size: 1.6rem;
  }

  .prospect-meta {
    flex-direction: column;
    gap: 4px;
  }
}
