<script setup lang="ts">
import BasicInformation from './BasicInformation.vue'
import MilestonesTable from './MilestonesTable.vue'
</script>

<template>
  <div class="tracking-detail">
    <div class="header">
      <div class="detail-status">
        <span class="font_family icon-icon_ocean_b" style="font-size: 64px"></span>
        <div class="no">Tracking No. B83131200164</div>
        <VTag large type="Confirmed">Confirmed</VTag>
      </div>
      <div class="detail-info">
        <div class="item transport-way">
          <div class="place">
            <div class="title">Origin</div>
            <div class="content">
              <span>Shenzhen</span>
              <div class="line_container">
                <hr color="#000000" />
                <div class="right-icon"></div>
              </div>
            </div>
          </div>
          <div class="place">
            <div class="title">Destination</div>
            <div class="content">Valencia</div>
          </div>
        </div>
        <div class="item">
          <div class="title">ETD/ATD</div>
          <div class="content">
            <span>Jun-08-2024 12:00 AM / </span>
            <span style="color: var(--color-neutral-1)">Jun-08-2024 12:00 AM</span>
          </div>
        </div>
        <div class="item">
          <div class="title">ETA/ATA</div>
          <div class="content">
            <span>Oct-26-2024 12:00 AM / </span>
            <span>--</span>
          </div>
        </div>
      </div>
    </div>
    <div class="info-content">
      <VBox :is-see-all="false" :is-draggable="false">
        <template #header>
          <div style="display: flex; border-radius: 12px 12px 0 0">
            <div class="basic-information-header">
              <span>Basic Information</span>
            </div>
            <div style="padding-left: 16px">Business Partners</div>
          </div>
        </template>
        <template #content>
          <BasicInformation ref="basicInformationRef"></BasicInformation>
        </template>
      </VBox>
      <!-- Milestones -->
      <VBox style="margin-top: 16px" :isSeeAll="false" :is-draggable="false">
        <template #header>Milestones</template>
        <template #content>
          <MilestonesTable></MilestonesTable>
        </template>
      </VBox>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.basic-information-header {
  display: flex;
  justify-content: space-between;
  width: 334px;
  padding-right: 16px;
  border-right: 1px solid var(--color-border);
}
.tracking-detail {
  padding: 0 16px 16px;
  & > .header {
    background: linear-gradient(
      251deg,
      rgba(255, 255, 255, 0.3),
      rgba(255, 244, 235, 0.5) 22.66%,
      rgba(240, 243, 255, 0.5) 44.57%,
      rgba(224, 247, 249, 0.6) 80.46%,
      rgba(255, 255, 255, 0.3)
    );

    .detail-status {
      position: relative;
      display: flex;
      align-items: center;
      padding: 0 16px;
      border-bottom: 1px solid var(--color-border);

      .no {
        margin-left: 6px;
        margin-right: 8px;
        font-size: 24px;
        font-weight: 700;
      }
    }
    .detail-info {
      display: flex;
      height: 96px;
      // border-bottom: 1px solid var(--color-border);
      & > .item {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        padding: 16px;
        border-right: 1px solid var(--color-border);
        &:last-child {
          border-right: none;
        }
        .title {
          font-size: 12px;
          color: var(--color-neutral-2);
        }
        .content {
          font-weight: 700;
          color: var(--color-neutral-2);
        }
      }
      .transport-way {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 16px;
        .place {
          flex: 1;
        }
        .title {
          margin-top: 11px;
        }
        .content {
          position: relative;
          display: flex;
          align-items: center;
          margin-top: 8px;
          font-size: 18px;
          font-weight: 700;
          color: var(--color-neutral-1);
          .line_container {
            flex: 1;
            position: relative;
            margin-left: 16px;
          }
          .line_container hr {
            width: 100%;
            border-radius: 0 2px 6px 0;
          }
          .line_container .right-icon {
            position: absolute;
            top: -3px;
            right: 0px;
            width: 10px;
            height: 11px;
            border-top: 2px solid #000000;
            transform: rotate(30deg);
            border-radius: 0 1px 0 0;
          }
        }
      }
    }
  }
}

.info-content {
  margin-top: -1px;
  margin-bottom: 8px;
}

:deep(.data-item) {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
  .title {
    font-size: 12px;
    color: var(--color-neutral-2);
  }
  .content {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-neutral-1);
  }
}
</style>
