/* Duplicates Management Styles */

.duplicates-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.duplicates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.duplicates-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

/* Statistics Cards */
.duplicates-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Box */
.duplicates-search-box {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.duplicates-search-box h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #333;
}

.search-form {
  display: flex;
  gap: 1rem;
}

.search-form .form-input {
  flex: 1;
  padding: 0.625rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Duplicates Table */
.duplicates-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
}

.table-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.table-wrapper {
  overflow-x: auto;
}

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

.duplicates-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.duplicates-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

.duplicates-table tbody tr {
  border-bottom: 1px solid #e5e5e5;
  transition: background-color 0.15s;
}

.duplicates-table tbody tr:hover {
  background-color: #f8f9fa;
}

.duplicates-table td {
  padding: 1rem;
  vertical-align: top;
}

/* Customer Info Styling */
.customer-info,
.duplicate-item {
  margin-bottom: 0.75rem;
}

.customer-name {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.customer-email {
  color: #666;
  font-size: 0.875rem;
  margin-bottom: 0.125rem;
}

.customer-meta {
  color: #999;
  font-size: 0.75rem;
}

.more-duplicates {
  color: #666;
  font-size: 0.875rem;
  font-style: italic;
}

/* Confidence Indicator */
.confidence-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.confidence-value {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 40px;
}

.confidence-bar {
  width: 80px;
  height: 8px;
  background: #e5e5e5;
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.confidence-fill.high {
  background: #27ae60;
}

.confidence-fill.medium {
  background: #f39c12;
}

.confidence-fill.low {
  background: #e74c3c;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.25px;
  margin-right: 0.25rem;
}

.status-badge.status-active {
  background: #d4f4dd;
  color: #27ae60;
}

.status-badge.status-warning {
  background: #fff3cd;
  color: #f39c12;
}

.status-badge.status-danger {
  background: #ffeaa7;
  color: #e74c3c;
}

/* Action Links */
.action-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.link-primary {
  color: #4a90e2;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.link-primary:hover {
  color: #357abd;
  text-decoration: underline;
}

.link-success {
  color: #27ae60;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.link-success:hover {
  color: #1e8449;
  text-decoration: underline;
}

/* Empty State */
.empty-state {
  background: white;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state p {
  color: #666;
  font-size: 1rem;
  margin: 0;
}

/* Pagination */
.pagination-container {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pagination-info {
  color: #666;
  font-size: 0.9rem;
}

.pagination-controls {
  display: flex;
  gap: 0.5rem;
}

.pagination-controls .btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.pagination-controls .disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Bulk Merge Form */
.bulk-merge-section {
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulk-merge-section label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .duplicates-container {
    padding: 1rem;
  }
  
  .duplicates-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .duplicates-stats {
    grid-template-columns: 1fr;
  }
  
  .search-form {
    flex-direction: column;
  }
  
  .duplicates-table {
    font-size: 0.875rem;
  }
  
  .duplicates-table th,
  .duplicates-table td {
    padding: 0.5rem;
  }
  
  .confidence-bar {
    width: 60px;
  }
  
  .action-links {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* Loading State */
.duplicates-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  color: #666;
}

.duplicates-loading::after {
  content: "";
  width: 40px;
  height: 40px;
  margin-left: 1rem;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a90e2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Review Page Styles */
.review-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.review-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
}

.card-header.primary {
  background: #e3f2fd;
  color: #1976d2;
}

.card-header.analysis {
  background: #fff3e0;
  color: #f57c00;
}

.card-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-list dt {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  margin-bottom: 0.25rem;
}

.info-list dd {
  font-size: 1rem;
  color: #333;
  margin: 0;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stats-section {
  border-top: 1px solid #e5e5e5;
  padding-top: 1rem;
  margin-top: 1rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4a90e2;
}

.lifetime-value {
  margin-top: 1rem;
}

.value-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: #7c3aed;
}

/* Analysis Sections */
.analysis-section {
  margin-bottom: 1.5rem;
}

.analysis-section h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  margin: 0 0 0.75rem 0;
}

.match-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.match-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.confidence-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.confidence-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
}

.confidence-bar.large {
  flex: 1;
  height: 12px;
}

.recommendation-section {
  border-top: 1px solid #e5e5e5;
  padding-top: 1rem;
}

.recommendation-box {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 6px;
  padding: 1rem;
}

.recommendation-box p {
  color: #1565c0;
  font-size: 0.9rem;
  margin: 0;
}

.link-secondary {
  color: #7c3aed;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.link-secondary:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* Responsive for review page */
@media (max-width: 1024px) {
  .review-cards {
    grid-template-columns: 1fr;
  }
}

/* Preview Merge Page */
.merge-preview-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
}

.merge-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.merge-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
}

.merge-card-header.primary {
  background: #d4f4dd;
  color: #27ae60;
}

.merge-card-header.secondary {
  background: #ffeaa7;
  color: #e74c3c;
}

.merge-card-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.merge-card-body {
  padding: 1.5rem;
}

.merge-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.merge-info-list dt {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #666;
  margin-bottom: 0.125rem;
}

.merge-info-list dd {
  font-size: 0.95rem;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.merge-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.arrow-container {
  text-align: center;
}

.arrow-icon {
  width: 4rem;
  height: 4rem;
  color: #999;
  margin: 0 auto 0.5rem;
}

.arrow-label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
}

.move-summary {
  background: #e3f2fd;
  border-radius: 8px;
  padding: 1rem;
  min-width: 200px;
}

.move-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1976d2;
  margin-bottom: 0.5rem;
}

.move-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
  color: #1565c0;
  line-height: 1.6;
}

.merge-summary-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  overflow: hidden;
}

.summary-header {
  padding: 1rem 1.5rem;
  background: #e3f2fd;
  border-bottom: 1px solid #90caf9;
}

.summary-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: #1976d2;
}

.summary-body {
  padding: 1.5rem;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.summary-stat {
  padding: 0 1rem;
}

.summary-label {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 2rem;
  font-weight: 700;
  color: #4a90e2;
}

.merge-confirm-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.confirm-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  background: #fafafa;
}

.confirm-header h2 {
  font-size: 1.25rem;
  margin: 0;
  color: #333;
}

.confirm-body {
  padding: 1.5rem;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-fields > div {
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.confirm-footer {
  border-top: 1px solid #e5e5e5;
  padding-top: 1rem;
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.confirm-message {
  font-size: 0.875rem;
  color: #666;
}

.confirm-actions {
  display: flex;
  gap: 1rem;
}

.merge-blocked {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
}

.merge-blocked p {
  color: #666;
  font-size: 1rem;
  margin: 0;
}

.alert {
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.alert-danger {
  background: #fee;
  border: 1px solid #fcc;
  color: #c00;
}

.alert-danger p {
  margin: 0;
  font-weight: 600;
}

/* Responsive for merge preview */
@media (max-width: 1024px) {
  .merge-preview-grid {
    grid-template-columns: 1fr;
  }
  
  .merge-arrow {
    padding: 1rem;
  }
  
  .arrow-icon {
    transform: rotate(90deg);
  }
  
  .summary-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}