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

:root {
  --primary-color: #3b82f6;
  --primary-dark: #2563eb;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: var(--text-primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.icon-title {
  flex-shrink: 0;
}

.subtitle {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.upload-section {
  padding: 30px;
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--bg-secondary);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
  transform: translateY(-2px);
}

.upload-icon {
  color: var(--primary-color);
  margin-bottom: 16px;
}

.drop-text {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.drop-text strong {
  color: var(--primary-color);
}

.file-label {
  color: var(--primary-color);
  text-decoration: underline;
  cursor: pointer;
  font-weight: 600;
}

.file-label:hover {
  color: var(--primary-dark);
}

.drop-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.file-input {
  display: none;
}

.loading {
  text-align: center;
  padding: 40px 30px;
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.file-info {
  padding: 0 30px 20px;
}

.info-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-value {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  word-break: break-word;
}

.icon-small {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.summary {
  padding: 16px 30px;
  margin: 0 30px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
}

.summary.same {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.summary.diff {
  background: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning-color);
}

.statistics {
  padding: 0 30px 20px;
}

.statistics h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 16px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-weight: 500;
}

.stat-value {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
}

.actions {
  padding: 0 30px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
}

.table-container {
  padding: 0 30px 30px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

thead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background: var(--bg-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

.footer {
  background: var(--bg-secondary);
  padding: 24px 30px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header {
    padding: 30px 20px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .upload-section {
    padding: 20px;
  }

  .drop-zone {
    padding: 40px 20px;
  }

  .file-info {
    padding: 0 20px 20px;
  }

  .info-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .summary {
    padding: 14px 20px;
    margin: 0 20px 20px;
    font-size: 0.9rem;
  }

  .statistics {
    padding: 0 20px 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    padding: 0 20px 20px;
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .table-container {
    padding: 0 20px 20px;
  }

  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 10px 8px;
  }

  .footer {
    padding: 20px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.3rem;
    gap: 8px;
  }

  .icon-title {
    width: 24px;
    height: 24px;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .drop-zone {
    padding: 30px 15px;
  }

  .drop-text {
    font-size: 1rem;
  }

  .info-value {
    font-size: 1rem;
  }

  table {
    min-width: 900px;
  }
}
