/**
 * Mapping Status Panel Styles
 * Right-side panel showing field mapping status and UAR readiness
 * Version: 1.0.1 - Fixed positioning to flow naturally with grid
 */

/* Main panel container */
.mapping-status-panel {
  background: #ffffff;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  /* Normal block element that flows with the grid */
  height: fit-content;
  min-height: 200px;
}


/* Status sections */
.status-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F3F4F6;
}

.status-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.status-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Field list */
.field-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.field-item.mapped {
  background: #F0FDF4;
  border-left: 3px solid #10B981;
}

.field-item.unmapped {
  background: #FEF3C7;
  border-left: 3px solid #F59E0B;
}

.field-item.unmapped.required-section .field-item {
  background: #FEE2E2;
  border-left: 3px solid #EF4444;
}

.field-icon {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
}

.field-name {
  flex: 1;
  color: #374151;
  font-weight: 500;
}

.confidence-badge {
  background: #10B981;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.unmapped-badge {
  background: #F59E0B;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Status alerts */
.status-alert {
  margin-top: 12px;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

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

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

.status-alert.info {
  background: #DBEAFE;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

/* UAR Readiness section */
.readiness-item {
  margin-bottom: 16px;
}

.readiness-item:last-child {
  margin-bottom: 0;
}

.readiness-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.readiness-icon {
  font-size: 18px;
  min-width: 24px;
}

.readiness-header strong {
  flex: 1;
  font-size: 14px;
  color: #374151;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.success {
  background: #D1FAE5;
  color: #065F46;
}

.status-badge.warning {
  background: #FEF3C7;
  color: #92400E;
}

.status-badge.error {
  background: #FEE2E2;
  color: #991B1B;
}

.readiness-detail {
  padding-left: 32px;
  font-size: 13px;
  color: #6B7280;
  line-height: 1.5;
}

.readiness-detail.success {
  color: #065F46;
}

.readiness-detail.error {
  color: #991B1B;
}

/* Mapping summary */
.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.summary-stat {
  background: #F9FAFB;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #E5E7EB;
}

.summary-stat.success {
  background: #F0FDF4;
  border-color: #86EFAC;
}

.summary-stat.warning {
  background: #FEF3C7;
  border-color: #FDE68A;
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tips section */
.tip-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-item.error {
  background: #FEE2E2;
  border-left: 3px solid #EF4444;
}

.tip-item.warning {
  background: #FEF3C7;
  border-left: 3px solid #F59E0B;
}

.tip-item.info {
  background: #DBEAFE;
  border-left: 3px solid #3B82F6;
}

.tip-item.success {
  background: #D1FAE5;
  border-left: 3px solid #10B981;
}

.tip-icon {
  font-size: 16px;
  min-width: 20px;
}

.tip-text {
  flex: 1;
  color: #374151;
}

/**
 * Step 2 Mapping Layout - Two Column Grid
 * Main content (left) + Fixed sidebar (right)
 */

.step2-container {
  display: grid !important;
  grid-template-columns: 1fr 380px !important;
  gap: 24px !important;
  align-items: start !important;
}

.mapping-main-content {
  /* Takes remaining space, flows naturally */
  min-width: 0; /* Prevent grid blowout */
}

.mapping-sidebar {
  /* Grid column width is controlled by grid-template-columns: 1fr 380px */
  /* No explicit width needed - grid handles it */
  position: sticky;
  top: 24px; /* Stick 24px from top when scrolling */
  align-self: start; /* Align to top of grid row */
}

@media (max-width: 1200px) {
  .step2-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .mapping-sidebar {
    position: static; /* No sticky on mobile */
    width: 100%;
  }
}
