@use '@scssutils' as *;

.card {
  &.device-card {
    overflow: hidden;
    display: block;
    position: relative;
    display: grid;
    grid-template-rows: auto 0;
    grid-template-columns: 1fr;
    grid-template-areas:
      'main'
      'locations';
    border: 1px solid var(--white);

    h3 {
      @include small-header;
      user-select: none;
    }

    header {
      display: grid;
      align-items: center;
      justify-items: start;
      column-gap: 10px;
      margin-bottom: 18px;
      max-width: 100%;
    }

    .limited {
      max-width: 120px;
    }

    .list-cell-text {
      display: flex;
      flex-flow: row;
      align-items: center;
      justify-content: flex-start;

      h3 {
        display: inline-block;
      }
    }

    .main-info {
      & > header {
        grid-template-rows: 40px;
        grid-template-columns: 40px 1fr 55px;
        max-width: 100%;
        overflow: hidden;

        &.biometry {
          grid-template-columns: 40px 12px 1fr 55px;
        }

        .biometry-icon {
          width: 12px;
          height: 12px;
        }

        & > .avatar-icon {
          grid-row: 1;
          grid-column: 1 / 2;
          height: 100%;
          width: 100%;

          svg {
            width: 30px;
            height: 30px;
          }
        }

        & > h3 {
          grid-row: 1;
          grid-column: 2 / 3;
        }
      }
    }

    .location {
      max-width: 100%;
      overflow: hidden;

      & > header {
        grid-template-rows: 40px;
        grid-template-columns: 22px 1fr;

        & > svg {
          grid-row: 1;
          grid-column: 1 / 2;
        }

        & > .info-wrapper {
          grid-row: 1;
          grid-column: 2 / 3;
          display: grid;
          grid-template-rows: 40px;
          grid-template-columns: auto 83px;
          column-gap: 10px;
          align-items: center;
          justify-items: start;
        }
      }
    }

    .main-info,
    .location {
      box-sizing: border-box;
      padding: 20px 25px;
    }

    & > .main-info {
      grid-area: main;
    }

    .section-content {
      display: flex;
      flex-flow: row nowrap;
      justify-content: space-between;
      align-items: flex-start;

      label {
        display: block;
        margin-bottom: 8px;
      }

      p {
        @include typography-legacy(15px, 18px, medium);

        &.no-data {
          color: var(--text-main);
          font-size: 11px;
          text-align: left;
        }
      }
    }

    & > .locations {
      grid-area: locations;
      display: grid;
      grid-template-rows: auto;
      grid-template-columns: 1fr;
      grid-auto-flow: row;

      & > .location {
        display: block;
        box-sizing: border-box;
        padding: 19px 24px;
        border: 1px solid transparent;
        border-top-color: var(--gray-lighter);

        &:last-child {
          border-bottom-right-radius: 15px;
          border-bottom-left-radius: 15px;
        }
      }
    }

    & > .card-controls {
      display: flex;
      flex-flow: row nowrap;
      position: absolute;
      top: 10px;
      right: 15px;

      .device-card-expand {
        border: 0 solid transparent;
        background-color: transparent;
        cursor: pointer;

        svg {
          width: 22px !important;
          height: 22px;
        }
      }
    }

    &.expanded {
      grid-template-rows: auto auto;
    }
  }
}

.copy {
  background-color: transparent;
  border: 0 solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
}
