* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  text-align: center;
  color: white;
  margin-bottom: 40px;
  padding: 20px;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.header p {
  font-size: 1.2em;
  opacity: 0.9;
}

.upload-section {
  margin-bottom: 40px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 20px;
}

.card h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.5em;
}

.upload-area {
  border: 3px dashed #ddd;
  border-radius: 8px;
  padding: 60px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #667eea;
  background-color: #f8f9ff;
}

.upload-area .icon {
  font-size: 4em;
  display: block;
  margin-bottom: 20px;
}

.upload-area p {
  color: #666;
  font-size: 1.1em;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 6px;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  margin: 5px;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: #4CAF50;
  color: white;
}

.btn-success:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-warning {
  background: #ff9800;
  color: white;
}

.btn-warning:hover {
  background: #e68900;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 30px;
  gap: 20px;
}

.stat-item {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  flex: 1;
}

.stat-item strong {
  display: block;
  font-size: 2em;
  color: #667eea;
  margin-bottom: 5px;
}

.stat-item span {
  color: #666;
  font-size: 0.9em;
}

.stat-warning {
  background: #fff3cd !important;
  border: 2px solid #ff9800;
}

.stat-warning strong {
  color: #e68900 !important;
}

.table-container {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

th {
  background: #667eea;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

tr:hover {
  background-color: #f8f9ff;
}

.actions {
  text-align: center;
  margin-top: 20px;
}

.info-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  margin-bottom: 20px;
}

.info-section h3 {
  color: #333;
  margin-bottom: 20px;
  font-size: 1.3em;
}

.info-section ul {
  list-style: none;
}

.info-section li {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  color: #555;
  line-height: 1.6;
}

.info-section li:last-child {
  border-bottom: none;
}

.info-section strong {
  color: #667eea;
  font-weight: 600;
}

.example-section {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.example-section h3 {
  color: #333;
  margin-bottom: 25px;
  font-size: 1.4em;
  text-align: center;
}

.example-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.example-card h4 {
  color: #667eea;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.code-block {
  background: #2d2d2d;
  color: #f8f8f2;
  border-radius: 6px;
  padding: 15px;
  margin: 10px 0;
  overflow-x: auto;
}

.code-block strong {
  color: #50fa7b;
  display: block;
  margin-bottom: 8px;
}

.code-block pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}

.example-note {
  background: #e7f3ff;
  border-left: 4px solid #667eea;
  padding: 15px;
  margin-top: 15px;
  border-radius: 4px;
  font-size: 0.95em;
  line-height: 1.8;
  color: #333;
}

.example-note strong {
  color: #667eea;
  display: block;
  margin-bottom: 8px;
}

.example-download {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  text-align: center;
}

.example-download h4 {
  color: white;
  margin-bottom: 10px;
}

.example-download p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 15px;
}

.sample-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.sample-buttons .btn {
  background: white;
  color: #667eea;
  font-weight: 600;
}

.sample-buttons .btn:hover {
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
}

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

#loadingMessage {
  font-size: 1.1em;
  color: #333;
  margin: 0;
  font-weight: 600;
}

.duplicate-controls {
  background: #fff9e6;
  border: 2px solid #ff9800;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.duplicate-warning h3 {
  color: #e68900;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.duplicate-warning p {
  color: #666;
  margin-bottom: 15px;
}

.duplicate-details {
  margin: 15px 0;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

.duplicate-groups {
  max-height: 400px;
  overflow-y: auto;
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

.duplicate-group {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-left: 3px solid #ff9800;
  border-radius: 4px;
}

.duplicate-group strong {
  color: #333;
  display: block;
  margin-bottom: 8px;
}

.duplicate-group ul {
  list-style: none;
  padding-left: 20px;
  margin: 0;
}

.duplicate-group li {
  color: #666;
  padding: 4px 0;
  font-size: 0.9em;
}

.duplicate-options {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #ffd54f;
}

.duplicate-options h4 {
  color: #333;
  margin-bottom: 15px;
}

.radio-option {
  display: block;
  padding: 12px;
  margin: 8px 0;
  background: white;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.radio-option:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.radio-option input[type="radio"] {
  margin-right: 10px;
  cursor: pointer;
}

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

.radio-option span {
  font-size: 1em;
  color: #333;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.8em;
  }
  
  .stats {
    flex-direction: column;
  }
  
  .card {
    padding: 20px;
  }
  
  table {
    font-size: 0.9em;
  }
  
  .duplicate-controls {
    padding: 15px;
  }
}