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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  padding: 40px;
}

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

.header-left {
  flex: 1;
}

.back-btn {
  background: transparent;
  border: none;
  color: #667eea;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  margin-right: 15px;
}

.back-btn:hover {
  color: #764ba2;
}

h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 28px;
}

.subtitle {
  color: #666;
  margin-bottom: 20px;
  font-size: 14px;
}

.file-info {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #666;
}

.form-group {
  margin-bottom: 24px;
}

label {
  display: block;
  color: #333;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

input[type="file"],
select {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
  font-family: inherit;
}

input[type="file"]:hover,
select:hover {
  border-color: #667eea;
}

input[type="file"]:focus,
select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  margin-right: 10px;
}

.checkbox-label {
  margin: 0;
  cursor: pointer;
  color: #555;
  font-weight: 500;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  flex: 1;
  min-width: 140px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f0f0f0;
  color: #333;
  flex: 1;
  min-width: 140px;
}

.btn-secondary:hover:not(:disabled) {
  background: #e0e0e0;
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  color: #667eea;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  flex: none;
}

.btn-link:hover:not(:disabled) {
  color: #764ba2;
}

.status-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  display: none;
}

.status-section.show {
  display: block;
}

.status-header {
  color: #333;
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 14px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
}

.status-label {
  color: #666;
}

.status-value {
  font-weight: 600;
  color: #333;
}

.status-value.pending {
  color: #ff9800;
}

.status-value.running {
  color: #2196f3;
}

.status-value.done {
  color: #4caf50;
}

.status-value.failed {
  color: #f44336;
}

.progress-container {
  margin: 16px 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 4px;
}

.message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  display: none;
}

.message.show {
  display: block;
}

.message.info {
  background: #e3f2fd;
  color: #1976d2;
  border-left: 4px solid #1976d2;
}

.message.success {
  background: #e8f5e9;
  color: #388e3c;
  border-left: 4px solid #388e3c;
}

.message.error {
  background: #ffebee;
  color: #d32f2f;
  border-left: 4px solid #d32f2f;
}

.message.warning {
  background: #fff3e0;
  color: #f57c00;
  border-left: 4px solid #f57c00;
}

.download-link {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  text-align: center;
  width: 100%;
}

.download-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.job-id-display {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 6px;
  font-family: monospace;
  color: #333;
  font-size: 13px;
  margin-top: 8px;
  word-break: break-all;
  margin-bottom: 12px;
}

.jobs-list {
  display: none;
}

.jobs-list.show {
  display: block;
}

.jobs-grid {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.job-card {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.job-card:hover {
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.job-card-id {
  font-family: monospace;
  font-weight: 600;
  color: #333;
  font-size: 13px;
}

.job-card-status {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.job-card-status.pending {
  background: #fff3e0;
  color: #f57c00;
}

.job-card-status.running {
  background: #e3f2fd;
  color: #1976d2;
}

.job-card-status.done {
  background: #e8f5e9;
  color: #388e3c;
}

.job-card-status.failed {
  background: #ffebee;
  color: #d32f2f;
}

.job-card-details {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.job-card-action {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-tiny {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

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

.btn-tiny-primary:hover {
  background: #764ba2;
}

.btn-tiny-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-tiny-secondary:hover {
  background: #d0d0d0;
}

.no-jobs {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

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

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* Upload Progress Styles */
.upload-progress-section {
  background: linear-gradient(135deg, #f5f7ff 0%, #f0f4ff 100%);
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.progress-title {
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.progress-percent {
  color: #667eea;
  font-size: 16px;
  font-weight: 700;
  min-width: 50px;
  text-align: right;
}

.progress-bar-container {
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar-background {
  background: white;
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  border: 1px solid #e0e7ff;
  box-shadow: inset 0 1px 3px rgba(102, 126, 234, 0.1);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
}

.progress-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e0e7ff;
}

.stat-label {
  color: #666;
  font-weight: 500;
}

.stat-value {
  color: #333;
  font-weight: 700;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 11px;
}

@media (max-width: 600px) {
  .container {
    max-width: 100%;
    padding: 20px;
  }

  .button-group {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    min-width: auto;
  }

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

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

  .progress-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .progress-percent {
    text-align: left;
    margin-top: 8px;
  }
}
