@use './colors';

@mixin header {
  .seam-content-header {
    height: 56px;
    display: flex;
    align-items: center;
    position: relative;
    justify-content: center;
    margin: 0 16px;

    &.seam-content-header-contained {
      margin: 0;
    }

    .seam-back-icon {
      position: absolute;
      top: 50%;
      transform: translate(4px, -50%);
      left: 0;
      font-size: 24px;
      cursor: pointer;
    }

    .seam-title {
      font-size: 16px;
      line-height: 134%;
      color: colors.$text-gray-1;
    }

    .seam-subheading {
      display: block;
      font-size: 12px;
      line-height: 140%;
      text-align: center;
      color: colors.$text-gray-1;
    }
  }
}

@mixin detail-section {
  .seam-padded-container {
    padding: 0 16px;
  }

  .seam-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .seam-detail-section-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .seam-detail-section {
    width: 100%;
  }

  .seam-detail-label-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 4px;
    margin-bottom: 8px;
  }

  .seam-detail-label {
    color: colors.$text-gray-1;
    font-size: 16px;
    font-weight: 400;
    line-height: 134%;
  }

  .seam-detail-group {
    border-radius: 8px;
    border: 1px solid colors.$text-gray-3;
    overflow: hidden;
  }

  .seam-detail-section-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
  }

  .seam-detail-section-footer-content-text {
    font-size: 12px;
    color: colors.$text-gray-2-5;
  }

  .seam-detail-section-tooltip-inner-content {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@mixin detail-row-common {
  .seam-detail-row,
  .seam-accordion-row {
    background-color: colors.$white;

    &:not(:last-of-type) {
      border-bottom: 1px solid colors.$divider-stroke-light;
    }

    &.seam-detail-row-clickable {
      cursor: pointer;
      transition: 0.2s ease;

      &:hover {
        background-color: colors.$bg-a;
      }
    }
  }

  .seam-detail-row,
  .seam-accordion-row-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    min-height: 64px;
    padding: 8px 16px;
  }

  .seam-detail-row-label-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .seam-detail-row-label-column {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .seam-detail-row-label-block {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 4px;
  }

  .seam-row-label {
    font-size: 16px;
    font-weight: 600;
    line-height: 118%;
  }

  .seam-detail-row-empty-label {
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    line-height: 118%;
    color: colors.$text-gray-2;
  }

  .seam-row-sublabel {
    color: colors.$text-gray-1;
    font-size: 14px;
    font-weight: 400;
    line-height: 118%;

    &.seam-row-sublabel-text-default {
      color: colors.$text-default;
    }
  }

  .seam-detail-row-hstack {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .seam-detail-row-end-alignment {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    flex-direction: row;
    gap: 24px;
    padding-top: 12px;
  }

  .seam-detail-row-rotated-icon {
    transform: rotate(-90deg);
  }
}

@mixin detail-row {
  .seam-detail-row-right-area-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
}

@mixin accordion-row {
  .seam-accordion-row {
    overflow: hidden;

    .seam-accordion-row-trigger {
      appearance: none;
      width: 100%;
      background-color: colors.$white;
      font-size: 16px;
      border: none;
      box-shadow: none;
      cursor: pointer;
      font-family: inherit;
    }

    .seam-accordion-row-content {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      flex-direction: column;
      max-height: 0;
      opacity: 0;
      transition: all 0.3s ease-in-out;
    }

    &[aria-expanded='true'] {
      .seam-accordion-row-content {
        max-height: 128px;
        opacity: 1;
      }

      .seam-accordion-icon-wrap {
        transform: rotate(180deg);
      }

      .seam-row-trigger-right-content {
        transform: scale(0.95);
        opacity: 0;
      }
    }

    .seam-accordion-row-inner-content {
      width: 100%;
      height: 128px;
      padding: 0 16px;
      overflow: hidden;
    }

    .seam-row-inner-wrap {
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: row;
      gap: 16px;
    }

    .seam-row-trigger-right-content {
      transition: 0.2s ease-in-out;
    }

    .seam-accordion-icon-wrap {
      width: 24px;
      height: 24px;
      display: flex;
      justify-content: center;
      align-items: center;
      transition: transform 0.2s ease-in-out;
      font-size: 24px;
    }
  }
}

@mixin all {
  @include header;
  @include detail-section;
  @include detail-row-common;
  @include detail-row;
  @include accordion-row;
}
