@use 'sass:map' as map;
@use '@angular/material' as mat;
@use 'styles/theming' as theming;

:host {
  display: flex;
  flex-direction: column;
  height: 100%;
}

%line {
  border-bottom: 1px solid
    map.get(theming.$theme, 'color', 'foreground', 'divider');
}

.subject-line {
  @extend %line;
  input {
    width: 0;
    flex-grow: 1;
    @include mat.typography-level(theming.$typography-config, 'title');
  }
}

.sender-line {
  @extend %line;
  padding: 0 16px;

  mat-form-field {
    width: 100%;
    ::ng-deep {
      .mat-form-field-wrapper {
        padding-bottom: 1em;
      }
      .mat-form-field-underline {
        visibility: hidden;
      }
    }
    &:has(:focus-visible) ::ng-deep {
      .mat-form-field-underline {
        visibility: visible;
      }
    }
  }
}

.recipient-line {
  @extend %line;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 8px;

  mat-chip-list {
    width: 0;
    flex-grow: 1;
    mat-chip {
      min-height: initial;
      height: 28px;
      background-color: rgb(238 241 243); // TODO: calc color?
      @include mat.typography-level(theming.$typography-config, 'body-1');
      &:active {
        box-shadow: none;
      }
      [matChipAvatar] {
        margin-left: 0;
        width: 28px;
        height: 28px;
      }
    }
  }
}

.content-section {
  height: 0;
  flex-grow: 1;
  padding: 16px;
  textarea {
    width: 100%;
    height: 100%;
  }
}
