* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
}

h1 {
  font-size: 28px;
  margin-bottom: 8px;
  font-weight: 700;
}

.tagline {
  font-size: 14px;
  opacity: 0.95;
  font-weight: 500;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.options-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.options-section h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.option-group {
  margin-bottom: 20px;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.option-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s;
}

.option-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.help-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.upload-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.upload-section h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.section-help {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background-color: var(--bg-color);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary-color);
  background-color: #f0f9ff;
}

.upload-area.drag-over {
  transform: scale(1.02);
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--primary-color);
}

.upload-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-subtext {
  font-size: 13px;
  color: var(--text-secondary);
}

.file-info {
  margin-top: 16px;
  padding: 12px;
  background-color: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
  flex: 1;
  margin-right: 12px;
}

.remove-file {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.remove-file:hover {
  background-color: #fee2e2;
}

.mapping-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.secondary-btn {
  flex: 1;
  padding: 12px;
  background: var(--bg-color);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: #f0f9ff;
}

.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.process-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-lg);
  disabled: true;
}

.process-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.2);
}

.process-btn:active:not(:disabled) {
  transform: translateY(0);
}

.process-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.process-btn.loading .btn-text {
  display: none;
}

.process-btn.loading .btn-loader {
  display: inline;
}

.status-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.status-box {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
}

.status-box.success {
  background-color: #f0fdf4;
  border-color: var(--success-color);
}

.status-box.error {
  background-color: #fef2f2;
  border-color: var(--error-color);
}

.status-box.info {
  background-color: #eff6ff;
  border-color: var(--primary-color);
}

.status-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}

.results-section {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.results-section h2 {
  font-size: 18px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.disclaimer {
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
}

.table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background-color: var(--bg-color);
}

th {
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
  border-bottom: none;
}

.name-input {
  width: 100%;
  padding: 8px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background-color: var(--bg-color);
  color: var(--text-primary);
}

.name-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.results-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.results-actions .primary-btn {
  flex: 1;
  min-width: 0;
}

.primary-btn {
  flex: 1;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.primary-btn:active {
  transform: translateY(0);
}

footer {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 13px;
}

@media (max-width: 640px) {
  .container {
    padding: 12px;
  }

  header {
    padding: 24px 16px;
  }

  h1 {
    font-size: 24px;
  }

  .tagline {
    font-size: 13px;
  }

  .upload-area {
    padding: 30px 16px;
  }

  .upload-icon {
    width: 40px;
    height: 40px;
  }

  .upload-text {
    font-size: 15px;
  }

  th, td {
    padding: 8px 4px;
    font-size: 13px;
  }

  .name-input {
    padding: 6px;
    font-size: 13px;
  }

  .results-actions {
    flex-direction: column;
  }
}
