@use '../styles/tokens' as *;

.trace-detail {
  padding: $spacing-16;
  height: 100%;
  overflow-y: auto;

  &__header {
    display: flex;
    align-items: center;
    gap: $spacing-8;
    margin-bottom: $spacing-4;
    font-size: $font-size-md;
    font-weight: 600;
  }

  &__pathname {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__step-title {
    font-size: $font-size-md;
    color: var(--fg);
    margin-bottom: $spacing-2;
  }

  &__node-id {
    font-family: monospace;
    font-size: $font-size-sm;
    color: var(--fg-muted);
    margin-bottom: $spacing-16;
  }

  &__cards {
    display: flex;
    flex-wrap: wrap;
    gap: $spacing-12;
    margin-bottom: $spacing-16;
  }

  &__error {
    margin-bottom: $spacing-16;
    padding: $spacing-12;
    border: 1px solid var(--color-error);
    border-radius: $radius-md;
  }

  &__error-header {
    display: flex;
    align-items: baseline;
    gap: $spacing-8;
  }

  &__error-status {
    font-family: monospace;
    font-size: $font-size-sm;
    font-weight: 600;
    color: var(--color-error);
  }

  &__error-message {
    font-size: $font-size-md;
    font-weight: 600;
    color: var(--color-error);
  }

  &__error-stack {
    margin-top: $spacing-8;

    summary {
      font-size: $font-size-sm;
      color: var(--fg-muted);
      cursor: pointer;
    }

    pre {
      margin: $spacing-8 0 0;
      max-height: 240px;
      overflow: auto;
      font-family: monospace;
      font-size: $font-size-xs;
      color: var(--fg);
      white-space: pre;
    }
  }

  &__properties {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: $spacing-4 $spacing-16;
    margin: 0;
  }

  &__property {
    display: contents;
  }

  &__property-label {
    font-size: $font-size-sm;
    color: var(--fg-muted);
    white-space: nowrap;
  }

  &__property-value {
    font-size: $font-size-sm;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    &--mono {
      font-family: monospace;
    }
  }
}
