/* Cold Email Campaign Generator - Modern Dark Slate Theme */
:root {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-input: #0f1523;
  --border-color: #26334d;
  --border-focus: #6366f1;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);

  --gmail-red: #ea4335;
  --gmail-red-hover: #d93025;
  --gmail-glow: rgba(234, 67, 53, 0.25);
  
  --imap-green: #10b981;
  --imap-green-hover: #059669;
  --imap-glow: rgba(16, 185, 129, 0.25);

  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 24px 16px;
  min-height: 100vh;
}

.app-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  flex-wrap: wrap;
  gap: 16px;
}

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

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

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

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

/* Main Cards */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

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

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.step-num {
  width: 26px;
  height: 26px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-radius: 50%;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.step-num-success {
  background: var(--success-bg);
  color: var(--success-color);
}

.card-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.title-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.status-badge.muted {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
}

.status-badge.active {
  background: var(--success-bg);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Multi-Accounts Manager */
.add-account-grid {
  align-items: flex-end;
}

.flex-right {
  display: flex;
  justify-content: flex-end;
}

.accounts-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.accounts-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-chip {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.2s ease-out;
}

.account-chip .remove-account-btn {
  background: none;
  border: none;
  color: #f87171;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: var(--transition);
}

.account-chip .remove-account-btn:hover {
  opacity: 1;
  color: #fff;
}

/* Form Controls */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.textarea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metrics-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  transition: var(--transition);
  outline: none;
}

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

.form-textarea.monospace, .form-input.monospace {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.helper-text {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.helper-text code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a5b4fc;
  font-family: var(--font-mono);
}

/* Tag Insertion Bar */
.tags-container {
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tags-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tags-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted);
}

.tags-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 5px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.tag-pill:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.tag-pill:active {
  transform: translateY(0);
}

.tag-pill-special {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  border-color: rgba(139, 92, 246, 0.3);
}

.tag-pill-special:hover {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: #fff;
}

/* Buttons */
.actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.93;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.btn-imap {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: var(--imap-glow);
}

.btn-imap:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 0 25px var(--imap-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn-gmail {
  background: var(--gmail-red);
  color: #ffffff;
  box-shadow: 0 0 15px var(--gmail-glow);
}

.btn-gmail:hover {
  background: var(--gmail-red-hover);
  box-shadow: 0 0 20px var(--gmail-glow);
  transform: translateY(-1px);
}

.file-upload-label {
  margin: 0;
}

.margin-top-md {
  margin-top: 14px;
}

.margin-bottom-md {
  margin-bottom: 14px;
}

.action-bar {
  margin: 8px 0;
}

/* IMAP Draft Breakdown Widget */
.breakdown-card {
  border-color: rgba(16, 185, 129, 0.4);
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.breakdown-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.breakdown-email {
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-main);
}

.breakdown-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--imap-green);
  background: var(--success-bg);
  padding: 2px 8px;
  border-radius: 10px;
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 4px;
  transition: width 0.4s ease-out;
}

/* Account Filter Tabs */
.account-filter-container {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-top: 10px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition);
}

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

.filter-tab.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.filter-tab .badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* Generated Drafts Feed */
.output-card {
  border-color: rgba(99, 102, 241, 0.5);
}

.hidden {
  display: none !important;
}

.drafts-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 16px;
  max-height: 720px;
  overflow-y: auto;
  padding-right: 6px;
}

.drafts-feed::-webkit-scrollbar {
  width: 6px;
}

.drafts-feed::-webkit-scrollbar-track {
  background: var(--bg-input);
  border-radius: 3px;
}

.drafts-feed::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.draft-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: var(--transition);
  animation: fadeIn 0.3s ease-out;
}

.draft-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

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

.draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.contact-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.contact-email {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--text-muted);
}

.draft-account-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(234, 67, 53, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(234, 67, 53, 0.3);
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.draft-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.draft-subject-box {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
}

.draft-subject-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.draft-subject-text {
  font-weight: 600;
  color: #e2e8f0;
}

.draft-body-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #cbd5e1;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--accent-primary);
  border-left: 4px solid var(--accent-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: slideUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-gmail {
  border-color: var(--gmail-red);
  border-left-color: var(--gmail-red);
}

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

/* Footer */
.app-footer {
  text-align: center;
  padding: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
