@import 'src/assets/styles/responsive-base.scss';

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

#details-content-container {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  margin-left: 24px;
}

#details-content {
  position: absolute;
  width: 100%;
  max-width: 600px;
}

#details-save {
  flex-basis: 50px;
}

button {
  min-width: 100px;
}

#save-btn-placeholder {
  margin: 30px 0;
  text-align: right;
  min-height: 36px;
}

#details-basic {
  padding: 24px 0px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  box-sizing: border-box;

  #avatar-name-input {
    margin: 16px;
    max-width: 200px;
  }

  #details-basic-inputs {
    display: flex;
    align-items: center;
    margin-bottom: 16px;

    #details-avatar-container {
      position: relative;

      app-avatar {
        width: 57px;
        height: 57px;
        margin: 0 8px;
      }

      mat-icon {
        position: absolute;
        right: 5px;
        bottom: 5px;
      }
    }

    #advanced-menu {
      width: 10px;
      flex: 1 1 auto;
      text-align: right;
    }
  }

  #details-basic-btns {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.check {
  flex: 1 1 250px;
  display: flex;
  align-items: center;
  padding: 16px 8px 0 8px;
  margin: 8px;

  mat-icon {
    margin-left: 8px;
    font-size: 20px;
  }
}

.copy-url {
  display: flex;
  align-items: center;
  padding: 0 8px;
  flex: 1 1 auto;

  input {
    flex: 1 1 auto;
    max-width: auto;
    margin: 8px;
  }

  span {
    display: block;
    white-space: nowrap;
  }

  mat-icon {
    margin: 4px;
  }
}

#members-permissions {
  padding: 24px 0px;

  #member-permissions-header {
    padding: 0 0px;
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 24px;

    div {
      flex: 1 1 auto;
      display: flex;
      align-items: center;
    }

    h2 {
      font-weight: normal;
      margin: 0 8px;
    }

    input {
      max-width: 200px;
    }

    mat-icon {
      margin: 8px;
    }
  }
}

@include screen('phone') {
  #save-btn {
    position: fixed;
    right: 40px;
    bottom: 90px;
    z-index: 10;
  }

  #details-content-container {
    margin-left: 0px;
  }

  #details-basic-btns {
    flex-direction: row !important;
    width: 100%;
  }
  #details-basic {
    display: block;
    padding-left: 10px;
    padding-right: 10px;
  }

  #members-permissions {
    padding-left: 10px;
    padding-right: 10px;
  }

  .opened-member {
    height: auto;

    .avatar mat-icon {
      transform: rotate(180deg) !important;
    }
  }
}

#members {
  display: table;

  .mdi {
    font-size: 22px;
  }

  > div {
    display: table-row;

    > div {
      display: table-cell;
      padding: 12px;
      vertical-align: middle;

      border-bottom: 1px solid rgba(0, 0, 0, 0.2);

      label {
        display: none;
      }
    }

    .user-cell {
      mat-icon {
        display: none;
      }

      .avatar {
        display: flex;
        align-items: center;
        white-space: nowrap;
        cursor: pointer;

        app-avatar {
          width: 32px;
          height: 32px;
          margin: 0 8px 0 0;
        }
      }
    }
  }
}

mat-icon,
.mdi {
  cursor: pointer;
  &.no-button {
    cursor: default;
  }
}

@include screen('phone') {
  #members {
    display: block;

    .opened-member {
      .user-cell mat-icon {
        transform: rotate(180deg) !important;
      }

      > div:not(.user-cell) {
        display: block;
      }
    }

    #members-header {
      display: none;
    }

    > div {
      display: block;
      flex-wrap: wrap;

      > div {
        border-bottom: none;
      }

      > div {
        label {
          display: inline-block;
          margin-right: 8px;
          min-width: 120px;
        }

        display: none;
      }

      .user-cell {
        display: flex;
        justify-content: space-between;

        border-bottom: 1px solid rgba(0, 0, 0, 0.2);

        mat-icon {
          display: block;
        }

        .avatar {
          display: flex;
        }
      }
    }
  }
}
