/* Test Results Enhancement */
.test-results {
  margin-top: 20px;
  padding: 20px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);

  &.success {
    border-left: 5px solid #28a745;
  }

  &.error {
    border-left: 5px solid #dc3545;
  }

  & h4 {
    margin-top: 0;
  }
}

.test-timings {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 4px;
  margin: 15px 0;

  & h5 {
    margin: 0 0 10px 0;
    color: #495057;
  }
}

.timing-item {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid #dee2e6;

  &:last-child {
    border-bottom: none;
  }
}

.timing-value {
  font-weight: bold;
  color: var(--main-blue);
}

/* Data Preview */
.data-preview {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;

  & h5 {
    margin: 0 0 10px 0;
    color: #495057;
  }

  /* Second .data-preview block merged in */
  margin-top: 1em;
  border: 1px solid #ddd;
  border-radius: 4px;

  & summary {
    background: #f8f9fa;
    padding: 0.5em 1em;
    cursor: pointer;
    border-radius: 4px 4px 0 0;

    &:hover {
      background: #e9ecef;
    }
  }
}

.preview-item {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;

  &:last-child {
    margin-bottom: 0;
  }
}

.preview-sprat-id {
  font-weight: bold;
  color: var(--main-blue);
}

.preview-sci-name {
  font-style: italic;
  color: #2c3e50;
}

.preview-common-name {
  color: #495057;
}

/* Test Results Styling */
.mulesoft-test-results {
  margin-top: 1em;
  padding: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.test-status {
  margin-top: 0;
  margin-bottom: 1em;

  &.success {
    color: #28a745;
  }

  &.failure {
    color: #dc3545;
  }
}

.status-icon {
  margin-right: 0.5em;
}

.test-basic-info p {
  margin-bottom: 0.5em;
}

.performance-breakdown {
  background: #f8f9fa;
  padding: 0.75em;
  margin: 0.5em 0;
  border-radius: 4px;

  &.success {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
  }

  &.failure {
    background: #f8d7da;
    border: 1px solid #f5c6cb;

    & .performance-total {
      border-top-color: #f5c6cb;
    }
  }
}

.performance-steps {
  margin-left: 1em;
  margin-top: 0.5em;
}

.performance-step {
  margin-bottom: 0.3em;
}

.step-icon {
  margin-right: 0.5em;
}

.step-name {
  margin-right: 0.5em;
}

.step-duration {
  font-family: monospace;

  &.success {
    color: #28a745;
  }

  &.failure {
    color: #dc3545;
  }
}

.step-status {
  margin-right: 0.3em;
}

.step-detail {
  margin-left: 1.5em;
  color: #6c757d;
  font-size: 0.9em;
}

.performance-total {
  margin-top: 0.5em;
  padding-top: 0.5em;
  border-top: 1px solid #dee2e6;
}

.preview-note {
  margin-left: 1em;
}

.issue-diagnosis {
  margin: 0.5em 0;
}

.issue-hint {
  padding: 0.5em;
  border-radius: 4px;

  &.auth-issue {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
  }

  &.data-issue {
    margin-top: 0.5em;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
  }
}

.response-data {
  background: #f8f9fa;
  padding: 1em;
  margin: 0;
  border-radius: 0 0 4px 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border-top: 1px solid #ddd;
}

.error-details {
  margin-top: 1em;
}

.error-message {
  background: #f8d7da;
  padding: 1em;
  border-radius: 4px;
  color: #721c24;
  font-family: monospace;
  font-size: 0.9em;
  overflow-x: auto;
}