/* Content Layout */
.content-wrapper {
  padding: 1rem;
  max-width: 100%;
  overflow-x: hidden;
}

.main-body {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Field Builder Styles */
.field-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background-color: #fff;
  border-radius: 0.25rem;
  flex-wrap: wrap;
}

.field-row:hover {
  background-color: #f8f9fa;
}

.step-card {
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
}

.step-number {
  font-size: 6rem !important;
  font-weight: bold !important;
  margin-right: 2rem !important;
  color: #666 !important;
  min-width: 120px !important;
  text-align: center !important;
  line-height: 1 !important;
}

.upload-area {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px dashed #dee2e6;
  border-radius: 0.25rem;
  text-align: center;
}

.file-list {
  margin-top: 1rem;
  width: 100%;
}

.file-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
}

/* Results Table Styles */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

/* Step group header styles */
.step-group th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  text-align: center;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Column header styles */
.results-table thead tr:not(.step-group) th {
  background-color: #fff;
  border-bottom: 1px solid #dee2e6;
  padding: 0.75rem;
  font-weight: 500;
  color: #6c757d;
  text-align: left;
  font-size: 0.9rem;
}

/* Step header styles */
.step-header {
  background-color: #f8f9fa !important;
  font-weight: bold !important;
  color: #495057 !important;
  text-align: center !important;
  border-bottom: 2px solid #dee2e6 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Field column styles */
[class^="step-"][class$="-field"] {
  min-width: 150px;
  padding: 0.75rem !important;
}

/* Separator column styles */
.separator {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  background-color: #f8f9fa !important;
  border-left: 2px solid #dee2e6 !important;
  border-right: 2px solid #dee2e6 !important;
  padding: 0 !important;
}

/* Table cell styles */
.results-table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid #dee2e6;
  color: #212529;
  font-size: 0.9rem;
}

/* Hover effect */
.results-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.04);
}

/* Alternating row colors */
.results-table tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* DataTables wrapper styles */
.dataTables_wrapper {
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  width: 100%;
}

/* DataTables controls */
.dataTables_length,
.dataTables_filter {
  margin-bottom: 1.5rem;
}

.dataTables_length select,
.dataTables_filter input {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.9rem;
}

.dataTables_filter input {
  min-width: 250px;
}

/* Pagination styles */
.dataTables_paginate {
  margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
  padding: 0.375rem 0.75rem;
  margin: 0 0.25rem;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  color: #495057;
}

.dataTables_paginate .paginate_button.current {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff !important;
}

.dataTables_paginate .paginate_button:hover:not(.current) {
  background-color: #e9ecef;
  border-color: #dee2e6;
  color: #212529 !important;
}

/* Export buttons */
.dt-buttons {
  margin-bottom: 1.5rem;
  gap: 0.5rem;
  display: flex;
}

.dt-button {
  padding: 0.375rem 1rem !important;
  font-size: 0.9rem !important;
  line-height: 1.5;
  border-radius: 0.25rem !important;
  color: #fff !important;
  background: linear-gradient(to bottom, #6c757d 0%, #5a6268 100%) !important;
  border: 1px solid #545b62 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dt-button:hover {
  background: linear-gradient(to bottom, #5a6268 0%, #4e555b 100%) !important;
  border-color: #4e555b !important;
}

/* Loading and error states */
.dataTables_processing {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  margin-left: -100px;
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Additional Field Builder Styles */
.field-builder {
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.25rem;
  width: 100%;
  overflow-x: auto;
}

.field-builder-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.field-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.field-type-select {
  min-width: 150px;
}

.field-name-input {
  flex: 1;
}

.field-remove-button {
  padding: 0.25rem !important;
}

.field-options {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
}

.field-switch-group {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

/* Table Responsiveness */
.table-responsive {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive styles */
@media (max-width: 1200px) {
  .step-number {
    font-size: 5rem !important;
    min-width: 100px !important;
  }
}

@media (max-width: 992px) {
  .step-number {
    font-size: 4rem !important;
    min-width: 80px !important;
  }

  [class^="step-"][class$="-field"] {
    min-width: 130px;
  }
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 0.5rem;
  }

  .dataTables_wrapper {
    padding: 0.5rem;
  }

  .step-number {
    font-size: 3rem !important;
    min-width: 60px !important;
    margin-right: 1rem !important;
  }

  .field-switch-group {
    flex-direction: column;
    gap: 1rem;
  }

  .field-name-input,
  .field-type-select {
    width: 100%;
  }

  .field-remove-button {
    margin-left: auto;
  }

  .dt-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .dataTables_filter input {
    width: 100%;
    min-width: unset;
  }

  [class^="step-"][class$="-field"] {
    min-width: 110px;
  }
}

@media (max-width: 576px) {
  .step-number {
    font-size: 2.5rem !important;
    min-width: 50px !important;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .field-row > * {
    width: 100% !important;
  }

  .dataTables_length,
  .dataTables_filter {
    width: 100%;
    margin-bottom: 1rem;
  }

  .dataTables_paginate {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  [class^="step-"][class$="-field"] {
    min-width: 100px;
  }
}
