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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.container {
  max-width: 900px;
  margin: 20px auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 40px;
  height: calc(100vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

h1 {
  text-align: center;
  color: #333;
  margin-bottom: 30px;
  font-size: 2.2em;
  font-weight: 300;
  flex-shrink: 0;
}

/* Step Progress Indicator */
.step-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 30px;
  position: relative;
  flex-shrink: 0;
}

.step-progress::before {
  content: "";
  position: absolute;
  top: 25px;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: #e9ecef;
  z-index: 1;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-number {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e9ecef;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.step-title {
  font-size: 14px;
  color: #6c757d;
  text-align: center;
  font-weight: 500;
  max-width: 120px;
  line-height: 1.3;
}

.step.active .step-number {
  background: #a136f8;
  color: white;
  box-shadow: 0 4px 15px rgba(161, 54, 248, 0.4);
}

.step.active .step-title {
  color: #333;
  font-weight: 600;
}

.step.completed .step-number {
  background: #7dffaf;
  color: #333;
}

.step.completed .step-title {
  color: #7dffaf;
  font-weight: 600;
}

/* Step Content */
.step-content {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 30px;
  flex: 1;
  overflow-y: scroll;
  overflow-x: hidden;
  margin-bottom: 0;
  min-height: 0;
  max-height: calc(100vh - 280px);
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar styling */
.step-content::-webkit-scrollbar {
  width: 8px;
}

.step-content::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 4px;
}

.step-content::-webkit-scrollbar-thumb {
  background: #a136f8;
  border-radius: 4px;
}

.step-content::-webkit-scrollbar-thumb:hover {
  background: #8e2de2;
}

.step-header {
  text-align: center;
  margin-bottom: 30px;
}

.step-header h2 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.8em;
  font-weight: 400;
}

.step-header p {
  color: #6c757d;
  font-size: 16px;
}

/* Document Type Hints */
.document-hints {
  background: linear-gradient(135deg, #f8f9ff 0%, #e8f5e8 100%);
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 30px;
  flex-shrink: 0;
}

.document-hints h3 {
  color: #333;
  margin-bottom: 15px;
  font-size: 1.3em;
  text-align: center;
  font-weight: 600;
}

.document-hints p {
  color: #666;
  text-align: center;
  margin-bottom: 20px;
  font-size: 15px;
}

.hint-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
  justify-content: center;
}

.hint-item {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: white;
  padding: 18px;
  border-radius: 10px;
  border-left: 4px solid #a136f8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  min-height: 70px;
}

.hint-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(161, 54, 248, 0.1);
}

.hint-icon {
  font-size: 28px;
  min-width: 35px;
  text-align: center;
  padding-top: 2px;
}

.hint-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.hint-text strong {
  color: #333;
  font-weight: 600;
  font-size: 16px;
}

.hint-text span {
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

.file-format-note {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  color: #856404;
  font-size: 14px;
}

.file-format-note strong {
  color: #664d03;
}

/* File Upload Styling */
.file-upload {
  margin-bottom: 30px;
  flex-shrink: 0;
}

#fileInput {
  display: none;
}

.upload-btn {
  display: inline-block;
  padding: 20px 40px;
  background: #a136f8;
  color: white;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
  border: none;
  text-align: center;
  width: 100%;
  margin-bottom: 20px;
}

.upload-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(161, 54, 248, 0.4);
}

.file-list {
  padding: 20px;
  background: white;
  border-radius: 8px;
  min-height: 80px;
  border: 2px dashed #dee2e6;
}

.file-item {
  background: #e9ecef;
  padding: 12px 16px;
  margin: 8px 0;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-name {
  font-weight: 600;
  color: #495057;
}

.file-size {
  color: #6c757d;
  font-size: 14px;
}

/* Selected Files Summary */
.selected-files-summary {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid #dee2e6;
}

.files-count {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
}

/* Document Types */
.document-types-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid #dee2e6;
}

.document-types-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.document-type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
  border-left: 5px solid #a136f8;
  transition: transform 0.2s ease;
}

.document-type-item:hover {
  transform: translateY(-2px);
}

.document-type-name {
  font-weight: 700;
  color: #495057;
  text-transform: capitalize;
  font-size: 16px;
}

.document-type-count {
  background: #a136f8;
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

/* JSON Container */
.json-container {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  margin-bottom: 30px;
  overflow: hidden;
}

.json-header {
  background: #e9ecef;
  padding: 15px 25px;
  border-bottom: 1px solid #dee2e6;
}

.json-header h3 {
  margin: 0;
  color: #495057;
  font-size: 1.2em;
}

#jsonOutput {
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #495057;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 25px;
  margin: 0;
  max-height: 500px;
  overflow-y: auto;
  background: #f8f9fa;
}

/* Processing Status */
.processing-status {
  text-align: center;
  padding: 40px;
  margin-top: 30px;
}

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

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

.processing-status p {
  color: #666;
  font-size: 18px;
  font-weight: 500;
}

/* Step Actions */
.step-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

.next-btn,
.back-btn,
.process-btn,
.download-btn,
.start-over-btn {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 180px;
}

.next-btn,
.process-btn {
  background: #7dffaf;
  color: #333;
}

.next-btn:hover:not(:disabled),
.process-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(125, 255, 175, 0.4);
}

.next-btn:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.back-btn:hover {
  background: #5a6268;
  transform: translateY(-2px);
}

.download-btn {
  background: #a136f8;
  color: white;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(161, 54, 248, 0.4);
}

.start-over-btn {
  background: #7dffaf;
  color: #333;
}

.start-over-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(125, 255, 175, 0.4);
}

/* Error Messages */
.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 15px 20px;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid #f5c6cb;
  text-align: center;
}

/* Login Page Styles */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 40px;
  width: 100%;
  max-width: 450px;
  text-align: center;
}

.login-header {
  margin-bottom: 30px;
}

.login-header h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 2.2em;
  font-weight: 300;
}

.login-header p {
  color: #6c757d;
  font-size: 16px;
}

.login-form {
  text-align: left;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-weight: 600;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
  background: #f8f9fa;
}

.form-group input:focus {
  outline: none;
  border-color: #a136f8;
  background: white;
}

.login-btn {
  width: 100%;
  padding: 15px;
  background: #a136f8;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 25px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(161, 54, 248, 0.4);
}

.demo-credentials {
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.demo-credentials p {
  margin: 5px 0;
  color: #1976d2;
  font-size: 14px;
}

.demo-credentials code {
  background: #1976d2;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.login-form .error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 12px;
  border-radius: 6px;
  margin-top: 15px;
  border: 1px solid #f5c6cb;
  text-align: center;
  font-size: 14px;
}

/* Logout Section */
.logout-section {
  position: absolute;
  top: 20px;
  right: 60px;
  z-index: 1000;
}

.logout-btn {
  padding: 10px 20px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background: #c82333;
  transform: translateY(-1px);
}

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

  .container {
    margin: 10px auto;
    padding: 20px;
    height: calc(100vh - 20px);
  }

  .step-content {
    max-height: calc(100vh - 200px);
    padding: 20px;
  }

  .login-card {
    padding: 30px 20px;
    margin: 10px;
  }

  .login-header h1 {
    font-size: 1.8em;
  }

  h1 {
    font-size: 1.8em;
    margin-bottom: 20px;
  }

  .step-content {
    padding: 20px;
  }

  .step-progress {
    flex-wrap: wrap;
    gap: 20px;
  }

  .step-progress::before {
    display: none;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .step-title {
    font-size: 12px;
  }

  .step-actions {
    flex-direction: column;
  }

  .next-btn,
  .back-btn,
  .process-btn,
  .download-btn,
  .start-over-btn {
    width: 100%;
    min-width: auto;
  }

  .document-types-list {
    grid-template-columns: 1fr;
  }

  .hint-items {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .hint-item {
    padding: 15px;
    min-height: auto;
    gap: 12px;
  }

  .hint-icon {
    font-size: 24px;
    min-width: 30px;
  }

  .hint-text strong {
    font-size: 15px;
  }

  .hint-text span {
    font-size: 12px;
  }

  .logout-section {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 1000;
  }

  .logout-btn {
    padding: 8px 16px;
    font-size: 12px;
  }
}
