/**
 * Merge Confirmation UI Styles
 * Modern, professional styling for duplicate merge interface
 * Version 1.0.0
 */

/* Overlay */
.merge-confirmation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.merge-confirmation-overlay.closing {
  animation: fadeOut 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Modal */
.merge-modal {
  background: white;
  border-radius: 12px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

/* Header */
.merge-modal-header {
  padding: 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.merge-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 12px;
}

.merge-modal-header h2 i {
  color: #3b82f6;
}

.merge-close-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.merge-close-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Body */
.merge-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* Summary Cards */
.merge-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.merge-summary-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: white;
}

.merge-summary-card.merge-summary-result {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.merge-summary-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.merge-summary-content {
  flex: 1;
}

.merge-summary-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.merge-summary-label {
  font-size: 14px;
  opacity: 0.9;
}

/* Groups Container */
.merge-groups-container {
  background: #f9fafb;
  border-radius: 12px;
  padding: 24px;
}

.merge-groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.merge-groups-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

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

.merge-action-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  background: #3b82f6;
  color: white;
}

.merge-action-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.merge-action-btn.secondary {
  background: white;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.merge-action-btn.secondary:hover {
  background: #f9fafb;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Groups List */
.merge-groups-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Group Item */
.merge-group-item {
  background: white;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  overflow: hidden;
  transition: all 0.2s;
}

.merge-group-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.merge-group-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.merge-group-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.merge-group-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: capitalize;
}

.merge-group-badge i {
  width: 16px;
  height: 16px;
}

.merge-group-match {
  font-size: 14px;
  color: #6b7280;
}

.merge-group-match strong {
  color: #111827;
  font-weight: 600;
}

.merge-group-count {
  font-size: 13px;
  color: #9ca3af;
  padding: 4px 12px;
  background: #f3f4f6;
  border-radius: 6px;
}

.merge-toggle-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.merge-toggle-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.merge-toggle-btn i {
  transition: transform 0.3s ease;
}

/* Group Content */
.merge-group-content {
  padding: 0 20px 20px;
  border-top: 1px solid #f3f4f6;
}

.merge-users-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

/* User Card */
.merge-user-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border: 2px solid #e5e7eb;
}

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

.merge-user-source {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.merge-user-type {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-ad {
  background: #dbeafe;
  color: #1e40af;
}

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

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

.badge-unknown {
  background: #f3f4f6;
  color: #6b7280;
}

.merge-user-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.merge-user-field {
  display: flex;
  gap: 8px;
  font-size: 13px;
  align-items: start;
}

.merge-user-field.has-conflict {
  background: #fef2f2;
  padding: 6px 8px;
  border-radius: 4px;
  margin: 0 -8px;
  border-left: 3px solid #ef4444;
}

.merge-user-field .field-name {
  color: #6b7280;
  min-width: 100px;
  font-weight: 500;
}

.merge-user-field .field-value {
  color: #111827;
  flex: 1;
  word-break: break-word;
}

.merge-user-field .conflict-icon {
  width: 16px;
  height: 16px;
  color: #ef4444;
}

.merge-user-field-more {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
  margin-top: 4px;
}

/* Conflicts Section */
.merge-conflicts-section {
  margin: 20px 0;
  padding: 16px;
  background: #fef2f2;
  border-radius: 8px;
  border-left: 4px solid #ef4444;
}

.merge-conflicts-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: #991b1b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.merge-conflicts-section h4 i {
  width: 18px;
  height: 18px;
}

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

.merge-conflict-item {
  background: white;
  padding: 12px;
  border-radius: 6px;
}

.merge-conflict-field {
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  font-size: 13px;
}

.merge-conflict-values {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.merge-conflict-value {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.conflict-source {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  text-transform: uppercase;
}

.conflict-val {
  font-size: 13px;
  color: #111827;
}

.conflict-arrow {
  width: 16px;
  height: 16px;
  color: #9ca3af;
}

/* Decision Section */
.merge-group-decision {
  margin-top: 20px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.merge-group-decision > label {
  display: block;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  font-size: 14px;
}

.merge-decision-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.merge-radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.merge-radio-option:hover {
  border-color: #3b82f6;
  background: #f0f9ff;
}

.merge-radio-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.merge-radio-option input[type="radio"]:checked + span {
  color: #3b82f6;
  font-weight: 600;
}

.merge-radio-option span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  font-size: 14px;
  transition: all 0.2s;
}

.merge-radio-option span i {
  width: 18px;
  height: 18px;
}

/* Primary Source Selector */
.merge-primary-source {
  margin-top: 12px;
}

.merge-primary-source label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.merge-source-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  color: #111827;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.merge-source-select:hover {
  border-color: #3b82f6;
}

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

/* Footer */
.merge-modal-footer {
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f9fafb;
}

.merge-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

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

.merge-btn.secondary {
  background: white;
  color: #6b7280;
  border: 2px solid #e5e7eb;
}

.merge-btn.secondary:hover {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.merge-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.merge-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .merge-modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .merge-summary {
    grid-template-columns: 1fr;
  }
  
  .merge-users-container {
    grid-template-columns: 1fr;
  }
  
  .merge-groups-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .merge-group-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
