/* 
 * EveryMailFinder - SaaS-Ready Design System
 * Inspired by Linear.app and Vercel aesthetic
 */

:root {
  /* Modern Color Palette - Linear/Vercel inspired */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #1f1f1f;
  --bg-hover: #262626;
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-inverse: #0a0a0a;
  
  --accent-primary: #5e6ad2;
  --accent-primary-hover: #4c56b8;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;
  --accent-info: #3b82f6;
  
  --border-primary: #27272a;
  --border-secondary: #3f3f46;
  --border-focus: #5e6ad2;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode support (optional) */
@media (prefers-color-scheme: light) {
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-elevated: #ffffff;
    --bg-hover: #f9fafb;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --text-inverse: #ffffff;
    
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
  }
}

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

html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Progress Bar - Live Updates */
.progress-container {
  position: relative;
  width: 100%;
  margin: 16px 0;
}

.progress-bg-enhanced {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-primary);
}

.progress-fill-enhanced {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-md);
  transition: width var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(94, 106, 210, 0.3);
}

/* Animated shimmer effect */
.progress-fill-enhanced::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.progress-text-enhanced {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.progress-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.progress-stat-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

/* Email Results Display with Copy Functionality */
.email-results-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  max-height: 400px;
  overflow-y: auto;
}

.email-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-primary);
}

.email-results-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.email-results-actions {
  display: flex;
  gap: 8px;
}

.email-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.email-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-secondary);
  transform: translateX(2px);
}

.email-address {
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
}

.email-source {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.btn-copy-email {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-email:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-copy-email.copied {
  background: var(--accent-success);
  border-color: var(--accent-success);
  color: var(--text-inverse);
}

.btn-copy-all {
  padding: 8px 16px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-all:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Enhanced Error Display */
.error-container {
  margin-top: 16px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--accent-error);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-error);
}

.error-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-error);
  margin-bottom: 8px;
  font-size: 14px;
}

.error-message {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.error-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  color: var(--text-tertiary);
  max-height: 100px;
  overflow-y: auto;
}

/* Enhanced Buttons */
.btn-enhanced {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--accent-primary);
  color: var(--text-inverse);
}

.btn-enhanced:hover:not(:disabled) {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-enhanced:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-enhanced.outline {
  background: transparent;
  border-color: var(--border-secondary);
  color: var(--text-primary);
}

.btn-enhanced.outline:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Enhanced Panels */
.panel-enhanced {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.panel-enhanced:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-secondary);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .email-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .email-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }
  
  .email-source {
    max-width: 100%;
    width: 100%;
  }
  
  .progress-stats {
    flex-direction: column;
    gap: 4px;
  }
  
  .email-results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .email-results-actions {
    width: 100%;
    flex-direction: column;
  }
  
  .btn-copy-all {
    width: 100%;
    justify-content: center;
  }
}

/* Copy Toast Notification */
.copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-base);
}

.copy-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.copy-toast.success {
  border-left: 4px solid var(--accent-success);
}

.copy-toast-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-success);
}

