/**
 * UAR Upload Wizard - Step 2 Enrichment Styles
 * Version: 3.0.0
 * New 3-section layout with source selection
 */

/* ================================
   MAIN CONTAINER
   ================================ */

.step2-enrichment-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 20px 0;
}

/* ================================
   ENRICHMENT SECTIONS
   ================================ */

.enrichment-section {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.enrichment-section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #F3F4F6;
}

.section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-icon.required-icon {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: white;
}

.section-icon.optional-icon {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
}

.section-icon.reviewer-icon {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
}

.section-title h3 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.section-subtitle {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
}

/* ================================
   INFO BANNER
   ================================ */

.enrichment-info-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 8px;
  margin-bottom: 20px;
}

.enrichment-info-banner i {
  color: #3B82F6;
  flex-shrink: 0;
}

.banner-content {
  font-size: 14px;
  color: #1E40AF;
  line-height: 1.5;
}

.banner-content strong {
  font-weight: 600;
}

/* ================================
   ENRICHMENT FIELDS
   ================================ */

.enrichment-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.enrichment-field-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  transition: all 0.2s;
}

.enrichment-field-row:hover {
  background: #F3F4F6;
  border-color: #D1D5DB;
}

/* Required fields - different layout */
.enrichment-field-row.required-field {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 16px;
}

.enrichment-field-row.optional-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 6px;
}

.required-indicator {
  color: #EF4444;
  font-size: 16px;
  font-weight: bold;
}

.field-help {
  color: #9CA3AF;
  cursor: help;
  display: inline-flex;
  align-items: center;
}

.field-help i {
  width: 16px;
  height: 16px;
}

/* ================================
   FIELD MAPPING (Required Fields)
   ================================ */

.field-mapping {
  display: flex;
  align-items: center;
}

.column-selector {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.column-selector:hover {
  border-color: #3B82F6;
}

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

/* ================================
   SOURCE SELECTION (Optional Fields)
   ================================ */

.field-source-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.source-label {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  min-width: 100px;
}

.source-selector {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
}

.source-selector:hover {
  border-color: #3B82F6;
}

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

.field-column-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ================================
   STATUS BADGES
   ================================ */

.field-status {
  display: flex;
  align-items: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
}

.status-badge i {
  width: 14px;
  height: 14px;
}

.status-badge.status-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.status-badge.status-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.status-badge.status-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

/* ================================
   COVERAGE DISPLAY
   ================================ */

.field-coverage {
  margin-top: 8px;
}

.coverage-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6B7280;
  font-style: italic;
}

.coverage-loading i {
  width: 16px;
  height: 16px;
  animation: spin 1s linear infinite;
}

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

.coverage-breakdown {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.coverage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #E5E7EB;
}

.coverage-item.db {
  border-color: #BFDBFE;
  background: #EFF6FF;
}

.coverage-item.file {
  border-color: #C7D2FE;
  background: #EEF2FF;
}

.coverage-item.missing {
  border-color: #FCA5A5;
  background: #FEE2E2;
}

.coverage-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.coverage-item.db .coverage-icon {
  color: #3B82F6;
}

.coverage-item.file .coverage-icon {
  color: #6366F1;
}

.coverage-item.missing .coverage-icon {
  color: #EF4444;
}

.coverage-icon i {
  width: 16px;
  height: 16px;
}

.coverage-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coverage-count {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.coverage-label {
  font-size: 12px;
  color: #6B7280;
}

/* ================================
   REVIEWER ASSIGNMENT SECTION
   ================================ */

.reviewer-method-selector {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 20px;
}

.reviewer-method-label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  min-width: 150px;
}

.reviewer-method-dropdown {
  flex: 1;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #D1D5DB;
  border-radius: 6px;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s;
  max-width: 400px;
}

.reviewer-method-dropdown:hover {
  border-color: #3B82F6;
}

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

/* ================================
   WORKFLOW CONFIG
   ================================ */

.reviewer-config {
  padding: 20px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.workflow-not-selected {
  text-align: center;
  padding: 40px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: #F59E0B;
}

.empty-state-icon i {
  width: 64px;
  height: 64px;
}

.empty-state-message h4 {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 8px 0;
}

.empty-state-message p {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
}

.workflow-info-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.workflow-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.info-icon i {
  width: 20px;
  height: 20px;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

/* ================================
   COVERAGE PANEL
   ================================ */

.coverage-panel {
  padding: 20px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.coverage-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}

.coverage-header i {
  width: 18px;
  height: 18px;
  color: #3B82F6;
}

.coverage-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.coverage-stat {
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.coverage-stat.success {
  background: #D1FAE5;
  border: 1px solid #6EE7B7;
}

.coverage-stat.warning {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #6B7280;
}

.coverage-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
}

.coverage-note.warning-note {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FCD34D;
}

.coverage-note.success-note {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.coverage-note i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ================================
   SELF ASSESSMENT CONFIG
   ================================ */

.self-assessment-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.self-assessment-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon i {
  width: 24px;
  height: 24px;
}

.header-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.header-content p {
  font-size: 14px;
  color: #6B7280;
  margin: 0;
}

.self-assessment-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #F9FAFB;
  border-radius: 6px;
}

.info-row .info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  min-width: 120px;
}

.info-row .info-label i {
  width: 16px;
  height: 16px;
}

.info-row .info-value {
  font-size: 14px;
  color: #111827;
  font-weight: 500;
}

.user-email {
  font-size: 13px;
  color: #6B7280;
  font-weight: 400;
}

.self-assessment-benefits {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #065F46;
}

.benefit-item i {
  width: 16px;
  height: 16px;
  color: #10B981;
  flex-shrink: 0;
}

.self-assessment-note {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
}

.self-assessment-note i {
  width: 20px;
  height: 20px;
  color: #3B82F6;
  flex-shrink: 0;
  margin-top: 2px;
}

.note-content {
  font-size: 13px;
  color: #1E40AF;
  line-height: 1.6;
}

.note-content strong {
  font-weight: 600;
}

/* ================================
   ACTION BUTTONS
   ================================ */

.enrichment-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 24px;
  border-top: 1px solid #F3F4F6;
  margin-top: 8px;
}

.preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  color: #374151;
  transition: all 0.2s ease;
}

.preview-btn:hover {
  background: #E5E7EB;
  border-color: #D1D5DB;
  color: #1F2937;
}

.preview-btn i {
  width: 18px;
  height: 18px;
}

/* ================================
   PREVIEW MODAL
   ================================ */

.enrichment-preview-modal {
  max-width: 1200px;
  width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.enrichment-preview-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.preview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  width: 20px;
  height: 20px;
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-content .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.stat-content .stat-label {
  font-size: 13px;
  color: #6B7280;
}

/* ================================
   PREVIEW LEGEND
   ================================ */

.preview-legend {
  padding: 16px;
  background: #F3F4F6;
  border-radius: 8px;
  margin-bottom: 24px;
}

.legend-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

.legend-items {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6B7280;
}

.legend-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.legend-badge.db-badge {
  background: #EFF6FF;
  color: #1E40AF;
  border: 1px solid #BFDBFE;
}

.legend-badge.file-badge {
  background: #EEF2FF;
  color: #3730A3;
  border: 1px solid #C7D2FE;
}

.legend-badge.missing-badge {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

/* ================================
   PREVIEW TABLE
   ================================ */

.preview-table-container {
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
}

.preview-table-header {
  padding: 16px;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}

.preview-table-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table thead {
  background: #F3F4F6;
}

.preview-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #E5E7EB;
  white-space: nowrap;
}

.preview-table tbody tr {
  border-bottom: 1px solid #E5E7EB;
  transition: background 0.15s;
}

.preview-table tbody tr:hover {
  background: #F9FAFB;
}

.preview-table tbody tr:last-child {
  border-bottom: none;
}

.preview-table td {
  padding: 12px 16px;
  color: #374151;
  vertical-align: middle;
}

.source-badge {
  display: inline-block;
  padding: 3px 6px;
  margin-left: 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 1024px) {
  .enrichment-field-row {
    grid-template-columns: 1fr;
  }
  
  .enrichment-field-row.optional-field {
    flex-direction: column;
  }
  
  .workflow-info-panel {
    grid-template-columns: 1fr;
  }
  
  .coverage-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .step2-enrichment-container {
    gap: 16px;
  }
  
  .enrichment-section {
    padding: 16px;
  }
  
  .preview-summary {
    grid-template-columns: 1fr;
  }
  
  .preview-table {
    font-size: 12px;
  }
  
  .preview-table th,
  .preview-table td {
    padding: 8px 12px;
  }
}
