/* enhanced-leads.css - Enhanced Lead Management Styling */

/* Lead Scoring Overview */
.scoring-overview {
  margin-bottom: 24px;
}

.scoring-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.scoring-card .uba-card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  margin: 0;
  padding: 20px;
}

.scoring-card .uba-card-title {
  color: white;
  margin: 0;
}

.scoring-card .uba-card-sub {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.scoring-actions {
  display: flex;
  gap: 12px;
}

.scoring-actions .uba-btn {
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.scoring-actions .uba-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.scoring-actions .uba-btn-primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Scoring Metrics */
.scoring-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  padding: 24px;
  background: white;
}

.score-metric {
  text-align: center;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1;
  margin-bottom: 8px;
}

.score-label {
  font-size: 0.875rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Score Configuration Modal */
.score-config-modal .score-config-dialog {
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
}

.scoring-categories {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.category-config {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
}

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

.category-title {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.category-weight {
  font-size: 14px;
  color: #64748b;
  background: #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.criteria-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.criteria-label {
  font-size: 14px;
  color: #374151;
  text-transform: capitalize;
}

.criteria-score {
  font-weight: 600;
  color: #1e293b;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

/* Scoring Preview */
.scoring-preview {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.preview-lead-score {
  font-size: 4rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
}

.preview-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.breakdown-item {
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

.breakdown-category {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.breakdown-score {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

/* Contact Log Section */
.contact-log-section {
  margin-top: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

/* Contact Log Tabs */
.contact-log-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.log-tab {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.log-tab:hover {
  background: #e2e8f0;
  color: #374151;
}

.log-tab.active {
  background: white;
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* Contact Log Content */
.contact-log-content {
  background: white;
}

.log-tab-content {
  display: none;
  padding: 20px;
}

.log-tab-content.active {
  display: block;
}

/* Timeline, Conversations, Notes, Activities Headers */
.timeline-header,
.conversations-header,
.notes-header,
.activities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.timeline-header h4,
.conversations-header h4,
.notes-header h4,
.activities-header h4 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
}

/* Timeline */
.contact-timeline {
  position: relative;
}

.timeline-entry {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 40px;
  bottom: -20px;
  width: 2px;
  background: #e2e8f0;
}

.timeline-entry:last-child::before {
  display: none;
}

.timeline-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.timeline-entry.conversation .timeline-marker {
  background: #10b981;
}

.timeline-entry.note .timeline-marker {
  background: #f59e0b;
}

.timeline-entry.activity .timeline-marker {
  background: #8b5cf6;
}

.timeline-content {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: none;
}

.timeline-header strong {
  color: #1e293b;
  font-size: 14px;
}

.timeline-time {
  font-size: 12px;
  color: #64748b;
}

.timeline-details {
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
}

/* Advanced Filters */
.leads-filters {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* Enhanced Dropdown */
.enhanced-dropdown {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 32px;
}

.enhanced-dropdown:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Bulk Actions */
.bulk-actions-bar {
  background: #3b82f6;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.bulk-actions-bar.hidden {
  display: none;
}

.bulk-actions-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.selected-count {
  font-weight: 600;
}

.bulk-action-buttons {
  display: flex;
  gap: 8px;
}

.bulk-action-buttons .uba-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.bulk-action-buttons .uba-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.bulk-action-buttons .uba-btn-primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.close-bulk-actions {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.close-bulk-actions:hover {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Score Badges */
.score-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-width: 40px;
}

.score-badge.score-high {
  background: #dcfce7;
  color: #166534;
}

.score-badge.score-medium {
  background: #fef3c7;
  color: #92400e;
}

.score-badge.score-low {
  background: #fee2e2;
  color: #991b1b;
}

/* Project Conversion Section */
.project-conversion-section {
  margin-top: 24px;
}

.conversion-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
}

.conversion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.conversion-header h4 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
}

.lead-score-display {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conversion-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #166534;
}

.status-icon {
  font-size: 20px;
}

.conversion-description {
  margin: 0 0 16px 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.conversion-preview {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.preview-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.preview-item:last-child {
  border-bottom: none;
}

.preview-item strong {
  color: #374151;
}

.conversion-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* Table Enhancements */
.leads-table-wrapper {
  position: relative;
  overflow-x: auto;
}

.enhanced-leads-table {
  width: 100%;
  border-collapse: collapse;
}

.enhanced-leads-table th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.enhanced-leads-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.enhanced-leads-table tr:hover {
  background: #f8fafc;
}

.lead-row-checkbox {
  width: 16px;
  height: 16px;
  margin: 0;
}

.lead-name-cell {
  font-weight: 600;
  color: #1e293b;
}

.lead-company-cell {
  color: #64748b;
  font-size: 14px;
}

.lead-status-cell {
  text-align: center;
}

.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.status-new {
  background: #e0e7ff;
  color: #3730a3;
}

.status-badge.status-contacted {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.status-qualified {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.status-converted {
  background: #dcfce7;
  color: #166534;
}

.lead-actions-cell {
  text-align: right;
}

.action-buttons {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  background: white;
  border-radius: 6px;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
}

.action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-1px);
}

.action-btn.convert {
  color: #059669;
  border-color: #d1fae5;
}

.action-btn.convert:hover {
  background: #d1fae5;
  border-color: #059669;
}

/* Responsive Design */
@media (max-width: 768px) {
  .scoring-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
  }
  
  .score-metric {
    padding: 12px;
  }
  
  .score-value {
    font-size: 2rem;
  }
  
  .filters-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .filter-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  
  .filter-actions .uba-btn {
    flex: 1;
  }
  
  .contact-log-tabs {
    flex-direction: column;
  }
  
  .bulk-actions-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .bulk-action-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .conversion-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .leads-table-wrapper {
    font-size: 14px;
  }
  
  .enhanced-leads-table th,
  .enhanced-leads-table td {
    padding: 8px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 480px) {
  .scoring-metrics {
    grid-template-columns: 1fr;
  }
  
  .score-config-modal .score-config-dialog {
    width: 95%;
    margin: 10px;
  }
  
  .contact-log-content {
    padding: 16px;
  }
  
  .timeline-entry {
    gap: 12px;
  }
  
  .timeline-marker {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .enhanced-leads-table {
    font-size: 12px;
  }
}

/* Animation Enhancements */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.scoring-overview,
.project-conversion-section,
.contact-log-section {
  animation: slideInDown 0.3s ease;
}

.timeline-entry {
  animation: slideInDown 0.2s ease;
}

.bulk-actions-bar {
  animation: slideInDown 0.3s ease;
}

/* Loading States */
.scoring-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: #64748b;
  font-size: 14px;
}

.scoring-loading::before {
  content: '⏳';
  font-size: 24px;
  margin-right: 8px;
}

/* Enhanced Visual Polish */
.conversion-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.timeline-entry:hover .timeline-content {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border-color: #cbd5e1;
}

.score-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

/* Focus States */
.log-tab:focus,
.action-btn:focus,
.uba-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.enhanced-dropdown:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}